managed_instance_long_term_retention_policies
Creates, updates, deletes, gets or lists a managed_instance_long_term_retention_policies
resource.
Overview
Name | managed_instance_long_term_retention_policies |
Type | Resource |
Id | azure.sql.managed_instance_long_term_retention_policies |
Fields
- vw_managed_instance_long_term_retention_policies
- managed_instance_long_term_retention_policies
Name | Datatype | Description |
---|---|---|
databaseName | text | field from the properties object |
managedInstanceName | 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 |
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, managedInstanceName, policyName, resourceGroupName, subscriptionId | Gets a managed database's long term retention policy. |
list_by_database | SELECT | databaseName, managedInstanceName, resourceGroupName, subscriptionId | Gets a database's long term retention policy. |
create_or_update | INSERT | databaseName, managedInstanceName, policyName, resourceGroupName, subscriptionId | Sets a managed database's long term retention policy. |
SELECT
examples
Gets a database's long term retention policy.
- vw_managed_instance_long_term_retention_policies
- managed_instance_long_term_retention_policies
SELECT
databaseName,
managedInstanceName,
monthly_retention,
policyName,
resourceGroupName,
subscriptionId,
week_of_year,
weekly_retention,
yearly_retention
FROM azure.sql.vw_managed_instance_long_term_retention_policies
WHERE databaseName = '{{ databaseName }}'
AND managedInstanceName = '{{ managedInstanceName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';
SELECT
properties
FROM azure.sql.managed_instance_long_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_instance_long_term_retention_policies
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.sql.managed_instance_long_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: weeklyRetention
value: string
- name: monthlyRetention
value: string
- name: yearlyRetention
value: string
- name: weekOfYear
value: integer