Skip to content

Commit

Permalink
Memorystore Cluster_Disabled : Rename Standalone value in Mode field …
Browse files Browse the repository at this point in the history
…to Cluster_Disabled (#12761)

Co-authored-by: asatyarth <asatyarth@google.com>
  • Loading branch information
arunsatyarth and asatyarth authored Jan 29, 2025
1 parent 0e9d4ce commit 67558a9
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 62 deletions.
125 changes: 64 additions & 61 deletions mmv1/products/memorystore/Instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -301,74 +301,77 @@ properties:
description: "Endpoints for the instance."
output: true
item_type:
type: Array
description: "A group of PSC connections. They are created in the same VPC network, one for each service attachment in the cluster."
item_type:
type: NestedObject
properties:
- name: 'pscConnectionId'
type: String
description:
"Output only. The PSC connection id of the forwarding rule connected
to the\nservice attachment. "
output: true
- name: 'ipAddress'
type: String
description:
"Output only. The IP allocated on the consumer network for the
PSC forwarding rule. "
output: true
- name: 'forwardingRule'
type: String
description: "Output only. The URI of the consumer side forwarding rule.\nFormat:\nprojects/{project}/regions/{region}/forwardingRules/{forwarding_rule} "
output: true
- name: 'projectId'
type: String
description:
"Output only. The consumer project_id where the forwarding rule is
created from. "
output: true
- name: 'network'
type: String
description:
"Output only. The consumer network where the IP address resides, in
the form of\nprojects/{project_id}/global/networks/{network_id}. "
output: true
- name: 'serviceAttachment'
type: String
description:
"Output only. The service attachment which is the target of the PSC connection, in the form of
projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}."
output: true
- name: 'pscConnectionStatus'
type: Enum
description:
"Output Only. The status of the PSC connection: whether a connection exists and ACTIVE or it no longer exists.
\n Possible values:\n ACTIVE \n NOT_FOUND"
output: true
enum_values:
- 'ACTIVE'
- 'NOT_FOUND'
- name: 'connectionType'
type: Enum
description:
"Output Only. Type of a PSC Connection.
\n Possible values:\n CONNECTION_TYPE_DISCOVERY \n CONNECTION_TYPE_PRIMARY \n CONNECTION_TYPE_READER"
output: true
enum_values:
- 'CONNECTION_TYPE_READER'
- 'CONNECTION_TYPE_PRIMARY'
- 'CONNECTION_TYPE_DISCOVERY'
type: NestedObject
properties:
- name: 'connections'
type: Array
description: "A group of PSC connections. They are created in the same VPC network, one for each service attachment in the cluster."
item_type:
type: NestedObject
properties:
- name: 'pscAutoConnection'
type: NestedObject
description: "Detailed information of a PSC connection that is created through service connectivity automation."
properties:
- name: 'pscConnectionId'
type: String
description:
"Output only. The PSC connection id of the forwarding rule connected
to the\nservice attachment. "
output: true
- name: 'ipAddress'
type: String
description:
"Output only. The IP allocated on the consumer network for the
PSC forwarding rule. "
output: true
- name: 'forwardingRule'
type: String
description: "Output only. The URI of the consumer side forwarding rule.\nFormat:\nprojects/{project}/regions/{region}/forwardingRules/{forwarding_rule} "
output: true
- name: 'projectId'
type: String
description:
"Output only. The consumer project_id where the forwarding rule is
created from. "
output: true
- name: 'network'
type: String
description:
"Output only. The consumer network where the IP address resides, in
the form of\nprojects/{project_id}/global/networks/{network_id}. "
output: true
- name: 'serviceAttachment'
type: String
description:
"Output only. The service attachment which is the target of the PSC connection, in the form of
projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}."
output: true
- name: 'connectionType'
type: Enum
description:
"Output Only. Type of a PSC Connection.
\n Possible values:\n CONNECTION_TYPE_DISCOVERY \n CONNECTION_TYPE_PRIMARY \n CONNECTION_TYPE_READER"
output: true
enum_values:
- 'CONNECTION_TYPE_READER'
- 'CONNECTION_TYPE_PRIMARY'
- 'CONNECTION_TYPE_DISCOVERY'
- name: 'port'
type: Integer
description:
"Output only. Ports of the exposed endpoint."
output: true
- name: 'mode'
type: Enum
description:
"Optional. Standalone or cluster.
\n Possible values:\n CLUSTER\nSTANDALONE"
"Optional. cluster or cluster-disabled.
\n Possible values:\n CLUSTER\n CLUSTER_DISABLED"
default_from_api: true
immutable: true
enum_values:
- 'CLUSTER'
- 'STANDALONE'
- 'CLUSTER_DISABLED'
- name: 'pscAutoConnections'
type: Array
description:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// Retrieve pscAutoConnections from API response
v, ok := res["pscAutoConnections"]
if !ok {
if _, endpointsFound := res["endpoints"]; endpointsFound {
return res, nil // For Cluster Disabled instances, we would have 'endpoints' instead of 'pscAutoConnections'
}
return nil, fmt.Errorf("pscAutoConnections field not found in API response")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ resource "google_memorystore_instance" "{{$.PrimaryResourceId}}" {
}
engine_version = "VALKEY_7_2"
deletion_protection_enabled = false
mode = "STANDALONE"
mode = "CLUSTER_DISABLED"
persistence_config {
mode = "RDB"
rdb_config {
Expand Down

0 comments on commit 67558a9

Please sign in to comment.