clusters
Creates, updates, deletes, gets or lists a clusters
resource.
Overview
Name | clusters |
Type | Resource |
Id | azure.postgresql_hsc.clusters |
Fields
The following fields are returned by SELECT
queries:
- get
- list_by_resource_group
- list
Name | Datatype | Description |
---|---|---|
identity | object | Describes the identity of the cluster. |
location | string | The geo-location where the resource lives |
properties | object | Properties of the cluster. |
tags | object | Resource tags. |
Name | Datatype | Description |
---|---|---|
identity | object | Describes the identity of the cluster. |
location | string | The geo-location where the resource lives |
properties | object | Properties of the cluster. |
tags | object | Resource tags. |
Name | Datatype | Description |
---|---|---|
identity | object | Describes the identity of the cluster. |
location | string | The geo-location where the resource lives |
properties | object | Properties of the cluster. |
tags | object | Resource tags. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | subscriptionId , resourceGroupName , clusterName | Gets information about a cluster such as compute and storage configuration and cluster lifecycle metadata such as cluster creation date and time. | |
list_by_resource_group | select | subscriptionId , resourceGroupName | Lists all clusters in a resource group. | |
list | select | subscriptionId | Lists all clusters in a subscription. | |
create | insert | subscriptionId , resourceGroupName , clusterName | Creates a new cluster with servers. | |
update | update | subscriptionId , resourceGroupName , clusterName | Updates an existing cluster. The request body can contain one or several properties from the cluster definition. | |
delete | delete | subscriptionId , resourceGroupName , clusterName | Deletes a cluster together with servers in it. | |
restart | exec | subscriptionId , resourceGroupName , clusterName | Restarts all nodes in the cluster. | |
start | exec | subscriptionId , resourceGroupName , clusterName | Starts stopped compute on all cluster nodes. | |
stop | exec | subscriptionId , resourceGroupName , clusterName | Stops compute on all cluster nodes. | |
promote_read_replica | exec | subscriptionId , resourceGroupName , clusterName | Promotes read replica cluster to an independent read-write cluster. | |
check_name_availability | exec | subscriptionId , name , type | Checks 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.
Name | Datatype | Description |
---|---|---|
clusterName | string | The name of the cluster. |
resourceGroupName | string | The name of the resource group. The name is case insensitive. |
subscriptionId | string (uuid) | The ID of the target subscription. The value must be an UUID. |
SELECT
examples
- get
- list_by_resource_group
- list
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
;
Lists all clusters in a resource group.
SELECT
identity,
location,
properties,
tags
FROM azure.postgresql_hsc.clusters
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
;
Lists all clusters in a subscription.
SELECT
identity,
location,
properties,
tags
FROM azure.postgresql_hsc.clusters
WHERE subscriptionId = '{{ subscriptionId }}' -- required
;
INSERT
examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: clusters
props:
- name: subscriptionId
value: string (uuid)
description: Required parameter for the clusters resource.
- name: resourceGroupName
value: string
description: Required parameter for the clusters resource.
- name: clusterName
value: string
description: Required parameter for the clusters resource.
- name: properties
value: object
description: |
Properties of the cluster.
- name: identity
value: object
description: |
Describes the identity of the cluster.
- name: tags
value: object
description: |
Resource tags.
- name: location
value: string
description: |
The geo-location where the resource lives
UPDATE
examples
- update
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
- delete
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
- restart
- start
- stop
- promote_read_replica
- check_name_availability
Restarts all nodes in the cluster.
EXEC azure.postgresql_hsc.clusters.restart
@subscriptionId='{{ subscriptionId }}' --required,
@resourceGroupName='{{ resourceGroupName }}' --required,
@clusterName='{{ clusterName }}' --required
;
Starts stopped compute on all cluster nodes.
EXEC azure.postgresql_hsc.clusters.start
@subscriptionId='{{ subscriptionId }}' --required,
@resourceGroupName='{{ resourceGroupName }}' --required,
@clusterName='{{ clusterName }}' --required
;
Stops compute on all cluster nodes.
EXEC azure.postgresql_hsc.clusters.stop
@subscriptionId='{{ subscriptionId }}' --required,
@resourceGroupName='{{ resourceGroupName }}' --required,
@clusterName='{{ clusterName }}' --required
;
Promotes read replica cluster to an independent read-write cluster.
EXEC azure.postgresql_hsc.clusters.promote_read_replica
@subscriptionId='{{ subscriptionId }}' --required,
@resourceGroupName='{{ resourceGroupName }}' --required,
@clusterName='{{ clusterName }}' --required
@@json=
'{
"enableGeoBackup": {{ enableGeoBackup }}
}'
;
Checks 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.
EXEC azure.postgresql_hsc.clusters.check_name_availability
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"name": "{{ name }}",
"type": "{{ type }}"
}'
;