backup_short_term_retention_policies
Creates, updates, deletes, gets or lists a backup_short_term_retention_policies
resource.
Overview
Name | backup_short_term_retention_policies |
Type | Resource |
Id | azure.sql.backup_short_term_retention_policies |
Fields
- vw_backup_short_term_retention_policies
- backup_short_term_retention_policies
Name | Datatype | Description |
---|---|---|
databaseName | text | field from the properties object |
diff_backup_interval_in_hours | text | field from the properties object |
policyName | text | field from the properties object |
resourceGroupName | text | field from the properties object |
retention_days | text | field from the properties object |
serverName | text | field from the properties object |
subscriptionId | text | field from the properties object |
Name | Datatype | Description |
---|---|---|
properties | object | Properties of a short term retention policy |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | databaseName, policyName, resourceGroupName, serverName, subscriptionId | Gets a database's short term retention policy. |
list_by_database | SELECT | databaseName, resourceGroupName, serverName, subscriptionId | Gets a database's short term retention policy. |
create_or_update | INSERT | databaseName, policyName, resourceGroupName, serverName, subscriptionId | Updates a database's short term retention policy. |
update | UPDATE | databaseName, policyName, resourceGroupName, serverName, subscriptionId | Updates a database's short term retention policy. |
SELECT
examples
Gets a database's short term retention policy.
- vw_backup_short_term_retention_policies
- backup_short_term_retention_policies
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 }}';
SELECT
properties
FROM azure.sql.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.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.sql.backup_short_term_retention_policies (
databaseName,
policyName,
resourceGroupName,
serverName,
subscriptionId,
properties
)
SELECT
'{{ databaseName }}',
'{{ policyName }}',
'{{ resourceGroupName }}',
'{{ serverName }}',
'{{ subscriptionId }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: properties
value:
- name: retentionDays
value: integer
- name: diffBackupIntervalInHours
value: integer
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 }}';