protection_policies
Creates, updates, deletes, gets or lists a protection_policies
resource.
Overview
Name | protection_policies |
Type | Resource |
Id | azure.recovery_services_backup.protection_policies |
Fields
- vw_protection_policies
- protection_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 |
backup_management_type | text | field from the properties object |
policyName | text | field from the properties object |
protected_items_count | text | field from the properties object |
resourceGroupName | text | field from the properties object |
resource_guard_operation_requests | 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" |
vaultName | text | field from the properties object |
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 | Base class for backup policy. Workload-specific backup policies are derived from this class. |
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 | policyName, resourceGroupName, subscriptionId, vaultName | Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous |
operation. Status of the operation can be fetched using GetPolicyOperationResult API. | |||
create_or_update | INSERT | policyName, resourceGroupName, subscriptionId, vaultName | Creates or modifies a backup policy. This is an asynchronous operation. Status of the operation can be fetched |
using GetPolicyOperationResult API. | |||
delete | DELETE | policyName, resourceGroupName, subscriptionId, vaultName | Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of the |
operation can be fetched using GetProtectionPolicyOperationResult API. |
SELECT
examples
Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous operation. Status of the operation can be fetched using GetPolicyOperationResult API.
- vw_protection_policies
- protection_policies
SELECT
id,
name,
backup_management_type,
policyName,
protected_items_count,
resourceGroupName,
resource_guard_operation_requests,
subscriptionId,
type,
vaultName
FROM azure.recovery_services_backup.vw_protection_policies
WHERE policyName = '{{ policyName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND vaultName = '{{ vaultName }}';
SELECT
id,
name,
properties,
type
FROM azure.recovery_services_backup.protection_policies
WHERE policyName = '{{ policyName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND vaultName = '{{ vaultName }}';
INSERT
example
Use the following StackQL query and manifest file to create a new protection_policies
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.recovery_services_backup.protection_policies (
policyName,
resourceGroupName,
subscriptionId,
vaultName,
properties
)
SELECT
'{{ policyName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ vaultName }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: id
value: string
- name: name
value: string
- name: type
value: string
- name: properties
value:
- name: protectedItemsCount
value: integer
- name: backupManagementType
value: string
- name: resourceGuardOperationRequests
value:
- string
DELETE
example
Deletes the specified protection_policies
resource.
/*+ delete */
DELETE FROM azure.recovery_services_backup.protection_policies
WHERE policyName = '{{ policyName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND vaultName = '{{ vaultName }}';