management_policies
Creates, updates, deletes, gets or lists a management_policies
resource.
Overview
Name | management_policies |
Type | Resource |
Id | azure.storage.management_policies |
Fields
- vw_management_policies
- management_policies
Name | Datatype | Description |
---|---|---|
id | text | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
name | text | The name of the resource |
accountName | text | field from the properties object |
last_modified_time | text | field from the properties object |
managementPolicyName | text | field from the properties object |
policy | text | field from the properties object |
resourceGroupName | text | field from the properties object |
subscriptionId | text | field from the properties object |
type | text | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" |
Name | Datatype | Description |
---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
name | string | The name of the resource |
properties | object | The Storage Account ManagementPolicy properties. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | accountName, managementPolicyName, resourceGroupName, subscriptionId | Gets the managementpolicy associated with the specified storage account. |
create_or_update | INSERT | accountName, managementPolicyName, resourceGroupName, subscriptionId | Sets the managementpolicy to the specified storage account. |
delete | DELETE | accountName, managementPolicyName, resourceGroupName, subscriptionId | Deletes the managementpolicy associated with the specified storage account. |
SELECT
examples
Gets the managementpolicy associated with the specified storage account.
- vw_management_policies
- management_policies
SELECT
id,
name,
accountName,
last_modified_time,
managementPolicyName,
policy,
resourceGroupName,
subscriptionId,
type
FROM azure.storage.vw_management_policies
WHERE accountName = '{{ accountName }}'
AND managementPolicyName = '{{ managementPolicyName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';
SELECT
id,
name,
properties,
type
FROM azure.storage.management_policies
WHERE accountName = '{{ accountName }}'
AND managementPolicyName = '{{ managementPolicyName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new management_policies
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.storage.management_policies (
accountName,
managementPolicyName,
resourceGroupName,
subscriptionId,
properties
)
SELECT
'{{ accountName }}',
'{{ managementPolicyName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: properties
value:
- name: lastModifiedTime
value: string
- name: policy
value:
- name: rules
value:
- - name: enabled
value: boolean
- name: name
value: string
- name: type
value: string
- name: definition
value:
- name: actions
value:
- name: baseBlob
value:
- name: tierToCool
value:
- name: daysAfterModificationGreaterThan
value: number
- name: daysAfterLastAccessTimeGreaterThan
value: number
- name: daysAfterLastTierChangeGreaterThan
value: number
- name: daysAfterCreationGreaterThan
value: number
- name: enableAutoTierToHotFromCool
value: boolean
- name: snapshot
value:
- name: tierToCool
value:
- name: daysAfterCreationGreaterThan
value: number
- name: daysAfterLastTierChangeGreaterThan
value: number
- name: version
value: []
- name: filters
value:
- name: prefixMatch
value:
- string
- name: blobTypes
value:
- string
- name: blobIndexMatch
value:
- - name: name
value: string
- name: op
value: string
- name: value
value: string
- name: id
value: string
- name: name
value: string
- name: type
value: string
DELETE
example
Deletes the specified management_policies
resource.
/*+ delete */
DELETE FROM azure.storage.management_policies
WHERE accountName = '{{ accountName }}'
AND managementPolicyName = '{{ managementPolicyName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';