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
The following fields are returned by SELECT queries:
- get
| 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. |
backupManagementType | string | This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. Required. Default value is None. |
eTag | string | Optional ETag. |
location | string | The geo-location where the resource lives. |
protectedItemsCount | integer | Number of items associated with this policy. |
resourceGuardOperationRequests | array | ResourceGuard Operation Requests. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | vault_name, resource_group_name, policy_name, subscription_id | 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 | vault_name, resource_group_name, policy_name, subscription_id | x-ms-authorization-auxiliary | Creates or modifies a backup policy. This is an asynchronous operation. Status of the operation can be fetched using GetPolicyOperationResult API. |
create_or_update | replace | vault_name, resource_group_name, policy_name, subscription_id | x-ms-authorization-auxiliary | Creates or modifies a backup policy. This is an asynchronous operation. Status of the operation can be fetched using GetPolicyOperationResult API. |
delete | delete | vault_name, resource_group_name, policy_name, subscription_id | Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of the operation can be fetched using GetProtectionPolicyOperationResult API. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
policy_name | string | Backup policy information to be fetched. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string | |
vault_name | string | The name of the VaultResource. Required. |
x-ms-authorization-auxiliary | string | Default value is None. |
SELECT examples
- get
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.
SELECT
id,
name,
backupManagementType,
eTag,
location,
protectedItemsCount,
resourceGuardOperationRequests,
systemData,
tags,
type
FROM azure.recovery_services_backup.protection_policies
WHERE vault_name = '{{ vault_name }}' -- required
AND resource_group_name = '{{ resource_group_name }}' -- required
AND policy_name = '{{ policy_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
Creates or modifies a backup policy. This is an asynchronous operation. Status of the operation can be fetched using GetPolicyOperationResult API.
INSERT INTO azure.recovery_services_backup.protection_policies (
properties,
tags,
location,
eTag,
vault_name,
resource_group_name,
policy_name,
subscription_id,
x-ms-authorization-auxiliary
)
SELECT
'{{ properties }}',
'{{ tags }}',
'{{ location }}',
'{{ eTag }}',
'{{ vault_name }}',
'{{ resource_group_name }}',
'{{ policy_name }}',
'{{ subscription_id }}',
'{{ x-ms-authorization-auxiliary }}'
RETURNING
id,
name,
eTag,
location,
properties,
systemData,
tags,
type
;
# Description fields are for documentation purposes
- name: protection_policies
props:
- name: vault_name
value: "{{ vault_name }}"
description: Required parameter for the protection_policies resource.
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the protection_policies resource.
- name: policy_name
value: "{{ policy_name }}"
description: Required parameter for the protection_policies resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the protection_policies resource.
- name: properties
description: |
ProtectionPolicyResource properties.
value:
protectedItemsCount: {{ protectedItemsCount }}
backupManagementType: "{{ backupManagementType }}"
resourceGuardOperationRequests:
- "{{ resourceGuardOperationRequests }}"
- name: tags
value: "{{ tags }}"
description: |
Resource tags.
- name: location
value: "{{ location }}"
description: |
The geo-location where the resource lives.
- name: eTag
value: "{{ eTag }}"
description: |
Optional ETag.
- name: x-ms-authorization-auxiliary
value: "{{ x-ms-authorization-auxiliary }}"
description: Default value is None.
description: Default value is None.
REPLACE examples
- create_or_update
Creates or modifies a backup policy. This is an asynchronous operation. Status of the operation can be fetched using GetPolicyOperationResult API.
REPLACE azure.recovery_services_backup.protection_policies
SET
properties = '{{ properties }}',
tags = '{{ tags }}',
location = '{{ location }}',
eTag = '{{ eTag }}'
WHERE
vault_name = '{{ vault_name }}' --required
AND resource_group_name = '{{ resource_group_name }}' --required
AND policy_name = '{{ policy_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND x-ms-authorization-auxiliary = '{{ x-ms-authorization-auxiliary}}'
RETURNING
id,
name,
eTag,
location,
properties,
systemData,
tags,
type;
DELETE examples
- delete
Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of the operation can be fetched using GetProtectionPolicyOperationResult API.
DELETE FROM azure.recovery_services_backup.protection_policies
WHERE vault_name = '{{ vault_name }}' --required
AND resource_group_name = '{{ resource_group_name }}' --required
AND policy_name = '{{ policy_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;