Skip to main content

managed_backup_short_term_retention_policies

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

Overview

Namemanaged_backup_short_term_retention_policies
TypeResource
Idazure.sql.managed_backup_short_term_retention_policies

Fields

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

Methods

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

SELECT examples

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

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

INSERT example

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

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

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