Skip to main content

backups_automatic_and_on_demand

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

Overview

Namebackups_automatic_and_on_demand
TypeResource
Idazure.postgresql_flexible_servers.backups_automatic_and_on_demand

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
backupTypestringType of backup. Known values are: "Full" and "Customer On-Demand". (Full, Customer On-Demand)
completedTimestring (date-time)Time(ISO8601 format) at which the backup was completed.
sourcestringSource of the backup.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
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, server_name, backup_name, subscription_idGets information of an on demand backup, given its name.
list_by_serverselectresource_group_name, server_name, subscription_idLists all available backups of a server.
createinsertresource_group_name, server_name, backup_name, subscription_idCreates an on demand backup of a server.
deletedeleteresource_group_name, server_name, backup_name, subscription_idDeletes a specific backup, given its name.

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
backup_namestringName of the backup. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
server_namestringThe name of the server. Required.
subscription_idstring

SELECT examples

Gets information of an on demand backup, given its name.

SELECT
id,
name,
backupType,
completedTime,
source,
systemData,
type
FROM azure.postgresql_flexible_servers.backups_automatic_and_on_demand
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND server_name = '{{ server_name }}' -- required
AND backup_name = '{{ backup_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Creates an on demand backup of a server.

INSERT INTO azure.postgresql_flexible_servers.backups_automatic_and_on_demand (
resource_group_name,
server_name,
backup_name,
subscription_id
)
SELECT
'{{ resource_group_name }}',
'{{ server_name }}',
'{{ backup_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;

DELETE examples

Deletes a specific backup, given its name.

DELETE FROM azure.postgresql_flexible_servers.backups_automatic_and_on_demand
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND server_name = '{{ server_name }}' --required
AND backup_name = '{{ backup_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;