long_term_retention_policies
Creates, updates, deletes, gets or lists a long_term_retention_policies
resource.
Overview
Name | long_term_retention_policies |
Type | Resource |
Id | azure.sql.long_term_retention_policies |
Fields
- vw_long_term_retention_policies
- long_term_retention_policies
Name | Datatype | Description |
---|---|---|
backup_storage_access_tier | text | field from the properties object |
databaseName | text | field from the properties object |
make_backups_immutable | text | field from the properties object |
monthly_retention | text | field from the properties object |
policyName | text | field from the properties object |
resourceGroupName | text | field from the properties object |
serverName | text | field from the properties object |
subscriptionId | text | field from the properties object |
week_of_year | text | field from the properties object |
weekly_retention | text | field from the properties object |
yearly_retention | text | field from the properties object |
Name | Datatype | Description |
---|---|---|
properties | object | Properties of a long term retention policy |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | databaseName, policyName, resourceGroupName, serverName, subscriptionId | Gets a database's long term retention policy. |
list_by_database | SELECT | databaseName, resourceGroupName, serverName, subscriptionId | Gets a database's long term retention policy. |
create_or_update | INSERT | databaseName, policyName, resourceGroupName, serverName, subscriptionId | Set or update a database's long term retention policy. |
SELECT
examples
Gets a database's long term retention policy.
- vw_long_term_retention_policies
- long_term_retention_policies
SELECT
backup_storage_access_tier,
databaseName,
make_backups_immutable,
monthly_retention,
policyName,
resourceGroupName,
serverName,
subscriptionId,
week_of_year,
weekly_retention,
yearly_retention
FROM azure.sql.vw_long_term_retention_policies
WHERE databaseName = '{{ databaseName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';
SELECT
properties
FROM azure.sql.long_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 long_term_retention_policies
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.sql.long_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: makeBackupsImmutable
value: boolean
- name: backupStorageAccessTier
value: string
- name: weeklyRetention
value: string
- name: monthlyRetention
value: string
- name: yearlyRetention
value: string
- name: weekOfYear
value: integer