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