protection_intent
Creates, updates, deletes, gets or lists a protection_intent resource.
Overview
| Name | protection_intent |
| Type | Resource |
| Id | azure.recovery_services_backup.protection_intent |
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 | Type of backup management for the backed up item. Known values are: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", "AzureStorage", "AzureWorkload", and "DefaultBackup". (Invalid, AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql, AzureStorage, AzureWorkload, DefaultBackup) |
eTag | string | Optional ETag. |
itemId | string | ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId. |
location | string | The geo-location where the resource lives. |
policyId | string | ID of the backup policy with which this item is backed up. |
protectionIntentItemType | string | backup protectionIntent type. Required. Known values are: "Invalid", "AzureResourceItem", "RecoveryServiceVaultItem", "AzureWorkloadContainerAutoProtectionIntent", "AzureWorkloadAutoProtectionIntent", and "AzureWorkloadSQLAutoProtectionIntent". |
protectionState | string | Backup state of this backup item. Known values are: "Invalid", "NotProtected", "Protecting", "Protected", and "ProtectionFailed". (Invalid, NotProtected, Protecting, Protected, ProtectionFailed) |
sourceResourceId | string | ARM ID of the resource to be backed up. |
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, fabric_name, intent_object_name, subscription_id | Provides the details of the protection intent up item. This is an asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. | |
create_or_update | insert | vault_name, resource_group_name, fabric_name, intent_object_name, subscription_id | Create Intent for Enabling backup of an item. This is a synchronous operation. | |
create_or_update | replace | vault_name, resource_group_name, fabric_name, intent_object_name, subscription_id | Create Intent for Enabling backup of an item. This is a synchronous operation. | |
delete | delete | vault_name, resource_group_name, fabric_name, intent_object_name, subscription_id | Used to remove intent from an item. | |
validate | exec | azure_region, subscription_id | It will validate followings 1. Vault capacity 2. VM is already protected 3. Any VM related configuration passed in properties. It will validate followings 1. Vault capacity 2. VM is already protected 3. Any VM related configuration passed in properties. |
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 |
|---|---|---|
azure_region | string | Azure region to hit Api. Required. |
fabric_name | string | The name of the BackupFabricResource. Required. |
intent_object_name | string | Backed up item name whose details are 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. |
SELECT examples
- get
Provides the details of the protection intent up item. This is an asynchronous operation. To know the status of the operation, call the GetItemOperationResult API.
SELECT
id,
name,
backupManagementType,
eTag,
itemId,
location,
policyId,
protectionIntentItemType,
protectionState,
sourceResourceId,
systemData,
tags,
type
FROM azure.recovery_services_backup.protection_intent
WHERE vault_name = '{{ vault_name }}' -- required
AND resource_group_name = '{{ resource_group_name }}' -- required
AND fabric_name = '{{ fabric_name }}' -- required
AND intent_object_name = '{{ intent_object_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
Create Intent for Enabling backup of an item. This is a synchronous operation.
INSERT INTO azure.recovery_services_backup.protection_intent (
properties,
tags,
location,
eTag,
vault_name,
resource_group_name,
fabric_name,
intent_object_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ tags }}',
'{{ location }}',
'{{ eTag }}',
'{{ vault_name }}',
'{{ resource_group_name }}',
'{{ fabric_name }}',
'{{ intent_object_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
eTag,
location,
properties,
systemData,
tags,
type
;
# Description fields are for documentation purposes
- name: protection_intent
props:
- name: vault_name
value: "{{ vault_name }}"
description: Required parameter for the protection_intent resource.
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the protection_intent resource.
- name: fabric_name
value: "{{ fabric_name }}"
description: Required parameter for the protection_intent resource.
- name: intent_object_name
value: "{{ intent_object_name }}"
description: Required parameter for the protection_intent resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the protection_intent resource.
- name: properties
description: |
ProtectionIntentResource properties.
value:
protectionIntentItemType: "{{ protectionIntentItemType }}"
backupManagementType: "{{ backupManagementType }}"
sourceResourceId: "{{ sourceResourceId }}"
itemId: "{{ itemId }}"
policyId: "{{ policyId }}"
protectionState: "{{ protectionState }}"
- 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.
REPLACE examples
- create_or_update
Create Intent for Enabling backup of an item. This is a synchronous operation.
REPLACE azure.recovery_services_backup.protection_intent
SET
properties = '{{ properties }}',
tags = '{{ tags }}',
location = '{{ location }}',
eTag = '{{ eTag }}'
WHERE
vault_name = '{{ vault_name }}' --required
AND resource_group_name = '{{ resource_group_name }}' --required
AND fabric_name = '{{ fabric_name }}' --required
AND intent_object_name = '{{ intent_object_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
eTag,
location,
properties,
systemData,
tags,
type;
DELETE examples
- delete
Used to remove intent from an item.
DELETE FROM azure.recovery_services_backup.protection_intent
WHERE vault_name = '{{ vault_name }}' --required
AND resource_group_name = '{{ resource_group_name }}' --required
AND fabric_name = '{{ fabric_name }}' --required
AND intent_object_name = '{{ intent_object_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;
Lifecycle Methods
- validate
It will validate followings 1. Vault capacity 2. VM is already protected 3. Any VM related configuration passed in properties. It will validate followings 1. Vault capacity 2. VM is already protected 3. Any VM related configuration passed in properties.
EXEC azure.recovery_services_backup.protection_intent.validate
@azure_region='{{ azure_region }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"resourceType": "{{ resourceType }}",
"resourceId": "{{ resourceId }}",
"vaultId": "{{ vaultId }}",
"properties": "{{ properties }}"
}'
;