Skip to main content

clusters

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

Overview

Nameclusters
TypeResource
Idazure.cosmosdb_for_postgresql.clusters

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}".
namestringThe name of the resource.
administratorLoginstringThe administrator's login name of the servers in the cluster.
administratorLoginPasswordstringThe password of the administrator login. Required for creation.
authConfigobjectAuthentication configuration of a cluster.
citusVersionstringThe Citus extension version on all cluster servers.
coordinatorEnablePublicIpAccessbooleanIf public access is enabled on coordinator.
coordinatorServerEditionstringThe edition of a coordinator server (default: GeneralPurpose). Required for creation.
coordinatorStorageQuotaInMbintegerThe storage of a server in MB. Required for creation. See https://learn.microsoft.com/azure/cosmos-db/postgresql/resources-compute for more information.
coordinatorVCoresintegerThe vCores count of a server (max: 96). Required for creation. See https://learn.microsoft.com/azure/cosmos-db/postgresql/resources-compute for more information.
databaseNamestringThe database name of the cluster. Only one database per cluster is supported.
earliestRestoreTimestring (date-time)The earliest restore point time (ISO8601 format) for the cluster.
enableGeoBackupbooleanIf cluster backup is stored in another Azure region in addition to the copy of the backup stored in the cluster's region. Enabled only at the time of cluster creation.
enableHabooleanIf high availability (HA) is enabled or not for the cluster.
enableShardsOnCoordinatorbooleanIf distributed tables are placed on coordinator or not. Should be set to 'true' on single node clusters. Requires shard rebalancing after value is changed.
locationstringThe geo-location where the resource lives. Required.
maintenanceWindowobjectMaintenance window of a cluster.
nodeCountintegerWorker node count of the cluster. When node count is 0, it represents a single node configuration with the ability to create distributed tables on that node. 2 or more worker nodes represent multi-node configuration. Node count value cannot be 1. Required for creation.
nodeEnablePublicIpAccessbooleanIf public access is enabled on worker nodes.
nodeServerEditionstringThe edition of a node server (default: MemoryOptimized).
nodeStorageQuotaInMbintegerThe storage in MB on each worker node. See https://learn.microsoft.com/azure/cosmos-db/postgresql/resources-compute for more information.
nodeVCoresintegerThe compute in vCores on each worker node (max: 104). See https://learn.microsoft.com/azure/cosmos-db/postgresql/resources-compute for more information.
pointInTimeUTCstring (date-time)Date and time in UTC (ISO8601 format) for cluster restore.
postgresqlVersionstringThe major PostgreSQL version on all cluster servers.
preferredPrimaryZonestringPreferred primary availability zone (AZ) for all cluster servers.
privateEndpointConnectionsarrayThe private endpoint connections for a cluster.
provisioningStatestringProvisioning state of the cluster.
readReplicasarrayThe array of read replica clusters.
serverNamesarrayThe list of server names in the cluster.
sourceLocationstringThe Azure region of source cluster for read replica clusters.
sourceResourceIdstringThe resource id of source cluster for read replica clusters.
statestringA state of a cluster/server that is visible to user.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsobjectResource tags.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, cluster_name, subscription_idGets information about a cluster such as compute and storage configuration and cluster lifecycle metadata such as cluster creation date and time.
check_name_availabilityselectsubscription_idChecks availability of a cluster name. Cluster names should be globally unique; at least 3 characters and at most 40 characters long; they must only contain lowercase letters, numbers, and hyphens; and must not start or end with a hyphen.
list_by_resource_groupselectresource_group_name, subscription_idLists all clusters in a resource group.
listselectsubscription_idLists all clusters in a subscription.
createinsertresource_group_name, cluster_name, subscription_id, locationCreates a new cluster with servers.
updateupdateresource_group_name, cluster_name, subscription_idUpdates an existing cluster. The request body can contain one or several properties from the cluster definition.
deletedeleteresource_group_name, cluster_name, subscription_idDeletes a cluster together with servers in it.
restartexecresource_group_name, cluster_name, subscription_idRestarts all nodes in the cluster.
startexecresource_group_name, cluster_name, subscription_idStarts stopped compute on all cluster nodes.
stopexecresource_group_name, cluster_name, subscription_idStops compute on all cluster nodes.
promote_read_replicaexecresource_group_name, cluster_name, subscription_idPromotes read replica cluster to an independent read-write cluster.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
cluster_namestringThe name of the cluster. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring

SELECT examples

Gets information about a cluster such as compute and storage configuration and cluster lifecycle metadata such as cluster creation date and time.

SELECT
id,
name,
administratorLogin,
administratorLoginPassword,
authConfig,
citusVersion,
coordinatorEnablePublicIpAccess,
coordinatorServerEdition,
coordinatorStorageQuotaInMb,
coordinatorVCores,
databaseName,
earliestRestoreTime,
enableGeoBackup,
enableHa,
enableShardsOnCoordinator,
location,
maintenanceWindow,
nodeCount,
nodeEnablePublicIpAccess,
nodeServerEdition,
nodeStorageQuotaInMb,
nodeVCores,
pointInTimeUTC,
postgresqlVersion,
preferredPrimaryZone,
privateEndpointConnections,
provisioningState,
readReplicas,
serverNames,
sourceLocation,
sourceResourceId,
state,
systemData,
tags,
type
FROM azure.cosmosdb_for_postgresql.clusters
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND cluster_name = '{{ cluster_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Creates a new cluster with servers.

INSERT INTO azure.cosmosdb_for_postgresql.clusters (
tags,
location,
properties,
resource_group_name,
cluster_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ properties }}',
'{{ resource_group_name }}',
'{{ cluster_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type
;

UPDATE examples

Updates an existing cluster. The request body can contain one or several properties from the cluster definition.

UPDATE azure.cosmosdb_for_postgresql.clusters
SET
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND cluster_name = '{{ cluster_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type;

DELETE examples

Deletes a cluster together with servers in it.

DELETE FROM azure.cosmosdb_for_postgresql.clusters
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND cluster_name = '{{ cluster_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

Restarts all nodes in the cluster.

EXEC azure.cosmosdb_for_postgresql.clusters.restart 
@resource_group_name='{{ resource_group_name }}' --required,
@cluster_name='{{ cluster_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;