Skip to main content

clusters

Creates, updates, deletes, gets or lists a clusters resource.

Overview

Nameclusters
TypeResource
Idgoogle.redis.clusters

Fields

NameDatatypeDescription
namestringRequired. Identifier. Unique name of the resource in this scope including project and location using the form: projects/{project_id}/locations/{location_id}/clusters/{cluster_id}
authorizationModestringOptional. The authorization mode of the Redis cluster. If not provided, auth feature is disabled for the cluster.
createTimestringOutput only. The timestamp associated with the cluster creation request.
crossClusterReplicationConfigobjectCross cluster replication config.
deletionProtectionEnabledbooleanOptional. The delete operation will fail when the value is set to true.
discoveryEndpointsarrayOutput only. Endpoints created on each given network, for Redis clients to connect to the cluster. Currently only one discovery endpoint is supported.
maintenancePolicyobjectMaintenance policy per cluster.
maintenanceScheduleobjectUpcoming maitenance schedule.
nodeTypestringOptional. The type of a redis node in the cluster. NodeType determines the underlying machine-type of a redis node.
persistenceConfigobjectConfiguration of the persistence functionality.
preciseSizeGbnumberOutput only. Precise value of redis memory size in GB for the entire cluster.
pscConfigsarrayRequired. Each PscConfig configures the consumer network where IPs will be designated to the cluster for client access through Private Service Connect Automation. Currently, only one PscConfig is supported.
pscConnectionsarrayOutput only. PSC connections for discovery of the cluster topology and accessing the cluster.
redisConfigsobjectOptional. Key/Value pairs of customer overrides for mutable Redis Configs
replicaCountintegerOptional. The number of replica nodes per shard.
shardCountintegerOptional. Number of shards for the Redis cluster.
sizeGbintegerOutput only. Redis memory size in GB for the entire cluster rounded up to the next integer.
statestringOutput only. The current state of this cluster. Can be CREATING, READY, UPDATING, DELETING and SUSPENDED
stateInfoobjectRepresents additional information about the state of the cluster.
transitEncryptionModestringOptional. The in-transit encryption for the Redis cluster. If not provided, encryption is disabled for the cluster.
uidstringOutput only. System assigned, unique identifier for the cluster.
zoneDistributionConfigobjectZone distribution config for allocation of cluster resources.

Methods

NameAccessible byRequired ParamsDescription
getSELECTclustersId, locationsId, projectsIdGets the details of a specific Redis cluster.
listSELECTlocationsId, projectsIdLists all Redis clusters owned by a project in either the specified location (region) or all locations. The location should have the following format: * projects/{project_id}/locations/{location_id} If location_id is specified as - (wildcard), then all regions available to the project are queried, and the results are aggregated.
createINSERTlocationsId, projectsIdCreates a Redis cluster based on the specified properties. The creation is executed asynchronously and callers may check the returned operation to track its progress. Once the operation is completed the Redis cluster will be fully functional. The completed longrunning.Operation will contain the new cluster object in the response field. The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.
deleteDELETEclustersId, locationsId, projectsIdDeletes a specific Redis cluster. Cluster stops serving and data is deleted.
patchUPDATEclustersId, locationsId, projectsIdUpdates the metadata and configuration of a specific Redis cluster. Completed longrunning.Operation will contain the new cluster object in the response field. The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.
reschedule_cluster_maintenanceEXECclustersId, locationsId, projectsIdReschedules upcoming maintenance event.

SELECT examples

Lists all Redis clusters owned by a project in either the specified location (region) or all locations. The location should have the following format: * projects/{project_id}/locations/{location_id} If location_id is specified as - (wildcard), then all regions available to the project are queried, and the results are aggregated.

SELECT
name,
authorizationMode,
createTime,
crossClusterReplicationConfig,
deletionProtectionEnabled,
discoveryEndpoints,
maintenancePolicy,
maintenanceSchedule,
nodeType,
persistenceConfig,
preciseSizeGb,
pscConfigs,
pscConnections,
redisConfigs,
replicaCount,
shardCount,
sizeGb,
state,
stateInfo,
transitEncryptionMode,
uid,
zoneDistributionConfig
FROM google.redis.clusters
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new clusters resource.

/*+ create */
INSERT INTO google.redis.clusters (
locationsId,
projectsId,
name,
replicaCount,
authorizationMode,
transitEncryptionMode,
shardCount,
pscConfigs,
nodeType,
persistenceConfig,
redisConfigs,
zoneDistributionConfig,
crossClusterReplicationConfig,
deletionProtectionEnabled,
maintenancePolicy
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ name }}',
'{{ replicaCount }}',
'{{ authorizationMode }}',
'{{ transitEncryptionMode }}',
'{{ shardCount }}',
'{{ pscConfigs }}',
'{{ nodeType }}',
'{{ persistenceConfig }}',
'{{ redisConfigs }}',
'{{ zoneDistributionConfig }}',
'{{ crossClusterReplicationConfig }}',
{{ deletionProtectionEnabled }},
'{{ maintenancePolicy }}'
;

UPDATE example

Updates a clusters resource.

/*+ update */
UPDATE google.redis.clusters
SET
name = '{{ name }}',
replicaCount = '{{ replicaCount }}',
authorizationMode = '{{ authorizationMode }}',
transitEncryptionMode = '{{ transitEncryptionMode }}',
shardCount = '{{ shardCount }}',
pscConfigs = '{{ pscConfigs }}',
nodeType = '{{ nodeType }}',
persistenceConfig = '{{ persistenceConfig }}',
redisConfigs = '{{ redisConfigs }}',
zoneDistributionConfig = '{{ zoneDistributionConfig }}',
crossClusterReplicationConfig = '{{ crossClusterReplicationConfig }}',
deletionProtectionEnabled = true|false,
maintenancePolicy = '{{ maintenancePolicy }}'
WHERE
clustersId = '{{ clustersId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified clusters resource.

/*+ delete */
DELETE FROM google.redis.clusters
WHERE clustersId = '{{ clustersId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';