Skip to main content

backup_short_term_retention_policies

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

Overview

Namebackup_short_term_retention_policies
TypeResource
Idazure.sql.backup_short_term_retention_policies

Fields

NameDatatypeDescription
databaseNametextfield from the properties object
diff_backup_interval_in_hourstextfield from the properties object
policyNametextfield from the properties object
resourceGroupNametextfield from the properties object
retention_daystextfield from the properties object
serverNametextfield from the properties object
subscriptionIdtextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTdatabaseName, policyName, resourceGroupName, serverName, subscriptionIdGets a database's short term retention policy.
list_by_databaseSELECTdatabaseName, resourceGroupName, serverName, subscriptionIdGets a database's short term retention policy.
create_or_updateINSERTdatabaseName, policyName, resourceGroupName, serverName, subscriptionIdUpdates a database's short term retention policy.
updateUPDATEdatabaseName, policyName, resourceGroupName, serverName, subscriptionIdUpdates a database's short term retention policy.

SELECT examples

Gets a database's short term retention policy.

SELECT
databaseName,
diff_backup_interval_in_hours,
policyName,
resourceGroupName,
retention_days,
serverName,
subscriptionId
FROM azure.sql.vw_backup_short_term_retention_policies
WHERE databaseName = '{{ databaseName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

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

/*+ create */
INSERT INTO azure.sql.backup_short_term_retention_policies (
databaseName,
policyName,
resourceGroupName,
serverName,
subscriptionId,
properties
)
SELECT
'{{ databaseName }}',
'{{ policyName }}',
'{{ resourceGroupName }}',
'{{ serverName }}',
'{{ subscriptionId }}',
'{{ properties }}'
;

UPDATE example

Updates a backup_short_term_retention_policies resource.

/*+ update */
UPDATE azure.sql.backup_short_term_retention_policies
SET
properties = '{{ properties }}'
WHERE
databaseName = '{{ databaseName }}'
AND policyName = '{{ policyName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';