Skip to main content

clusters

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

Overview

Nameclusters
TypeResource
Idazure.postgresql_hsc.clusters

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
identityobjectDescribes the identity of the cluster.
locationstringThe geo-location where the resource lives
propertiesobjectProperties of the cluster.
tagsobjectResource tags.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectsubscriptionId, resourceGroupName, clusterNameGets information about a cluster such as compute and storage configuration and cluster lifecycle metadata such as cluster creation date and time.
list_by_resource_groupselectsubscriptionId, resourceGroupNameLists all clusters in a resource group.
listselectsubscriptionIdLists all clusters in a subscription.
createinsertsubscriptionId, resourceGroupName, clusterNameCreates a new cluster with servers.
updateupdatesubscriptionId, resourceGroupName, clusterNameUpdates an existing cluster. The request body can contain one or several properties from the cluster definition.
deletedeletesubscriptionId, resourceGroupName, clusterNameDeletes a cluster together with servers in it.
restartexecsubscriptionId, resourceGroupName, clusterNameRestarts all nodes in the cluster.
startexecsubscriptionId, resourceGroupName, clusterNameStarts stopped compute on all cluster nodes.
stopexecsubscriptionId, resourceGroupName, clusterNameStops compute on all cluster nodes.
promote_read_replicaexecsubscriptionId, resourceGroupName, clusterNamePromotes read replica cluster to an independent read-write cluster.
check_name_availabilityexecsubscriptionId, name, typeChecks 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.

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
clusterNamestringThe name of the cluster.
resourceGroupNamestringThe name of the resource group. The name is case insensitive.
subscriptionIdstring (uuid)The ID of the target subscription. The value must be an UUID.

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
identity,
location,
properties,
tags
FROM azure.postgresql_hsc.clusters
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND clusterName = '{{ clusterName }}' -- required
;

INSERT examples

Creates a new cluster with servers.

INSERT INTO azure.postgresql_hsc.clusters (
data__properties,
data__identity,
data__tags,
data__location,
subscriptionId,
resourceGroupName,
clusterName
)
SELECT
'{{ properties }}',
'{{ identity }}',
'{{ tags }}',
'{{ location }}',
'{{ subscriptionId }}',
'{{ resourceGroupName }}',
'{{ clusterName }}'
RETURNING
identity,
location,
properties,
tags
;

UPDATE examples

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

UPDATE azure.postgresql_hsc.clusters
SET
data__properties = '{{ properties }}',
data__identity = '{{ identity }}',
data__tags = '{{ tags }}'
WHERE
subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND clusterName = '{{ clusterName }}' --required
RETURNING
identity,
location,
properties,
tags;

DELETE examples

Deletes a cluster together with servers in it.

DELETE FROM azure.postgresql_hsc.clusters
WHERE subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND clusterName = '{{ clusterName }}' --required
;

Lifecycle Methods

Restarts all nodes in the cluster.

EXEC azure.postgresql_hsc.clusters.restart 
@subscriptionId='{{ subscriptionId }}' --required,
@resourceGroupName='{{ resourceGroupName }}' --required,
@clusterName='{{ clusterName }}' --required
;