managed_backup_short_term_retention_policies
Creates, updates, deletes, gets or lists a managed_backup_short_term_retention_policies
resource.
Overview
Name | managed_backup_short_term_retention_policies |
Type | Resource |
Id | azure.sql.managed_backup_short_term_retention_policies |
Fields
- vw_managed_backup_short_term_retention_policies
- managed_backup_short_term_retention_policies
Name | Datatype | Description |
---|---|---|
databaseName | text | field from the properties object |
managedInstanceName | 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 |
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, managedInstanceName, policyName, resourceGroupName, subscriptionId | Gets a managed database's short term retention policy. |
list_by_database | SELECT | databaseName, managedInstanceName, resourceGroupName, subscriptionId | Gets a managed database's short term retention policy list. |
create_or_update | INSERT | databaseName, managedInstanceName, policyName, resourceGroupName, subscriptionId | Updates a managed database's short term retention policy. |
update | UPDATE | databaseName, managedInstanceName, policyName, resourceGroupName, subscriptionId | Updates a managed database's short term retention policy. |
SELECT
examples
Gets a managed database's short term retention policy list.
- vw_managed_backup_short_term_retention_policies
- managed_backup_short_term_retention_policies
SELECT
databaseName,
managedInstanceName,
policyName,
resourceGroupName,
retention_days,
subscriptionId
FROM azure.sql.vw_managed_backup_short_term_retention_policies
WHERE databaseName = '{{ databaseName }}'
AND managedInstanceName = '{{ managedInstanceName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';
SELECT
properties
FROM azure.sql.managed_backup_short_term_retention_policies
WHERE databaseName = '{{ databaseName }}'
AND managedInstanceName = '{{ managedInstanceName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new managed_backup_short_term_retention_policies
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.sql.managed_backup_short_term_retention_policies (
databaseName,
managedInstanceName,
policyName,
resourceGroupName,
subscriptionId,
properties
)
SELECT
'{{ databaseName }}',
'{{ managedInstanceName }}',
'{{ policyName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: properties
value:
- name: retentionDays
value: integer
UPDATE
example
Updates a managed_backup_short_term_retention_policies
resource.
/*+ update */
UPDATE azure.sql.managed_backup_short_term_retention_policies
SET
properties = '{{ properties }}'
WHERE
databaseName = '{{ databaseName }}'
AND managedInstanceName = '{{ managedInstanceName }}'
AND policyName = '{{ policyName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';