Skip to main content

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

Namemanaged_restorable_dropped_database_backup_short_term_retention_policies
TypeResource
Idazure.sql.managed_restorable_dropped_database_backup_short_term_retention_policies

Fields

NameDatatypeDescription
managedInstanceNametextfield from the properties object
policyNametextfield from the properties object
resourceGroupNametextfield from the properties object
restorableDroppedDatabaseIdtextfield from the properties object
retention_daystextfield from the properties object
subscriptionIdtextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTmanagedInstanceName, policyName, resourceGroupName, restorableDroppedDatabaseId, subscriptionIdGets a dropped database's short term retention policy.
list_by_restorable_dropped_databaseSELECTmanagedInstanceName, resourceGroupName, restorableDroppedDatabaseId, subscriptionIdGets a dropped database's short term retention policy list.
create_or_updateINSERTmanagedInstanceName, policyName, resourceGroupName, restorableDroppedDatabaseId, subscriptionIdSets a database's short term retention policy.
updateUPDATEmanagedInstanceName, policyName, resourceGroupName, restorableDroppedDatabaseId, subscriptionIdSets a database's short term retention policy.

SELECT examples

Gets a dropped database's short term retention policy list.

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 }}';

INSERT example

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

/*+ 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 }}'
;

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 }}';