Skip to main content

backups

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

Overview

Namebackups
TypeResource
Idazure.postgresql.backups

Fields

NameDatatypeDescription
backupNametextfield from the properties object
backup_typetextfield from the properties object
completed_timetextfield from the properties object
resourceGroupNametextfield from the properties object
serverNametextfield from the properties object
sourcetextfield from the properties object
subscriptionIdtextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTbackupName, resourceGroupName, serverName, subscriptionIdGet specific backup for a given server.
list_by_serverSELECTresourceGroupName, serverName, subscriptionIdList all the backups for a given server.
createINSERTbackupName, resourceGroupName, serverName, subscriptionIdCreate a specific backup for PostgreSQL flexible server.
deleteDELETEbackupName, resourceGroupName, serverName, subscriptionIdDeletes a specific backup.

SELECT examples

List all the backups for a given server.

SELECT
backupName,
backup_type,
completed_time,
resourceGroupName,
serverName,
source,
subscriptionId
FROM azure.postgresql.vw_backups
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

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

/*+ create */
INSERT INTO azure.postgresql.backups (
backupName,
resourceGroupName,
serverName,
subscriptionId
)
SELECT
'{{ backupName }}',
'{{ resourceGroupName }}',
'{{ serverName }}',
'{{ subscriptionId }}'
;

DELETE example

Deletes the specified backups resource.

/*+ delete */
DELETE FROM azure.postgresql.backups
WHERE backupName = '{{ backupName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';