Skip to main content

servers

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

Overview

Nameservers
TypeResource
Idazure.postgresql.servers

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
identityobjectDescribes the identity of the application.
locationstringThe geo-location where the resource lives
propertiesobjectProperties of the server.
skuobjectSku information related properties of a server.
tagsobjectResource tags.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectsubscriptionId, resourceGroupName, serverNameGets information about a server.
list_by_resource_groupselectsubscriptionId, resourceGroupNameList all the servers in a given resource group.
listselectsubscriptionIdList all the servers in a given subscription.
createinsertsubscriptionId, resourceGroupName, serverNameCreates a new server.
updateupdatesubscriptionId, resourceGroupName, serverNameUpdates an existing server. The request body can contain one to many of the properties present in the normal server definition.
deletedeletesubscriptionId, resourceGroupName, serverNameDeletes a server.
restartexecsubscriptionId, resourceGroupName, serverNameRestarts a server.
startexecsubscriptionId, resourceGroupName, serverNameStarts a server.
stopexecsubscriptionId, resourceGroupName, serverNameStops a server.

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

SELECT examples

Gets information about a server.

SELECT
identity,
location,
properties,
sku,
tags
FROM azure.postgresql.servers
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND serverName = '{{ serverName }}' -- required
;

INSERT examples

Creates a new server.

INSERT INTO azure.postgresql.servers (
data__sku,
data__identity,
data__properties,
data__tags,
data__location,
subscriptionId,
resourceGroupName,
serverName
)
SELECT
'{{ sku }}',
'{{ identity }}',
'{{ properties }}',
'{{ tags }}',
'{{ location }}',
'{{ subscriptionId }}',
'{{ resourceGroupName }}',
'{{ serverName }}'
RETURNING
identity,
location,
properties,
sku,
tags
;

UPDATE examples

Updates an existing server. The request body can contain one to many of the properties present in the normal server definition.

UPDATE azure.postgresql.servers
SET
data__sku = '{{ sku }}',
data__identity = '{{ identity }}',
data__properties = '{{ properties }}',
data__tags = '{{ tags }}'
WHERE
subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND serverName = '{{ serverName }}' --required
RETURNING
identity,
location,
properties,
sku,
tags;

DELETE examples

Deletes a server.

DELETE FROM azure.postgresql.servers
WHERE subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND serverName = '{{ serverName }}' --required
;

Lifecycle Methods

Restarts a server.

EXEC azure.postgresql.servers.restart 
@subscriptionId='{{ subscriptionId }}' --required,
@resourceGroupName='{{ resourceGroupName }}' --required,
@serverName='{{ serverName }}' --required
@@json=
'{
"restartWithFailover": {{ restartWithFailover }},
"failoverMode": "{{ failoverMode }}"
}'
;