object_replication_policies
Creates, updates, deletes, gets or lists an object_replication_policies resource.
Overview
| Name | object_replication_policies |
| Type | Resource |
| Id | azure.storage.object_replication_policies |
Fields
The following fields are returned by SELECT queries:
- get
- list
| 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. |
destinationAccount | string | Required. Destination account name. It should be full resource id if allowCrossTenantReplication set to false. Required. |
enabledTime | string (date-time) | Indicates when the policy is enabled on the source account. |
metrics | object | Optional. The object replication policy metrics feature options. |
policyId | string | A unique id for object replication policy. |
priorityReplication | object | Optional. The object replication policy priority replication feature options. |
rules | array | The storage account object replication rules. |
sourceAccount | string | Required. Source account name. It should be full resource id if allowCrossTenantReplication set to false. Required. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tagsReplication | object | Optional. The object replication policy tags replication feature options. |
type | string | 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. |
destinationAccount | string | Required. Destination account name. It should be full resource id if allowCrossTenantReplication set to false. Required. |
enabledTime | string (date-time) | Indicates when the policy is enabled on the source account. |
metrics | object | Optional. The object replication policy metrics feature options. |
policyId | string | A unique id for object replication policy. |
priorityReplication | object | Optional. The object replication policy priority replication feature options. |
rules | array | The storage account object replication rules. |
sourceAccount | string | Required. Source account name. It should be full resource id if allowCrossTenantReplication set to false. Required. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tagsReplication | object | Optional. The object replication policy tags replication feature options. |
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 | resource_group_name, account_name, object_replication_policy_id, subscription_id | Get the object replication policy of the storage account by policy ID. | |
list | select | resource_group_name, account_name, subscription_id | List the object replication policies associated with the storage account. | |
create_or_update | insert | resource_group_name, account_name, object_replication_policy_id, subscription_id | Create or update the object replication policy of the storage account. | |
create_or_update | replace | resource_group_name, account_name, object_replication_policy_id, subscription_id | Create or update the object replication policy of the storage account. | |
delete | delete | resource_group_name, account_name, object_replication_policy_id, subscription_id | Deletes the object replication policy associated with the specified storage account. |
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 |
|---|---|---|
account_name | string | The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. Required. |
object_replication_policy_id | string | For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string |
SELECT examples
- get
- list
Get the object replication policy of the storage account by policy ID.
SELECT
id,
name,
destinationAccount,
enabledTime,
metrics,
policyId,
priorityReplication,
rules,
sourceAccount,
systemData,
tagsReplication,
type
FROM azure.storage.object_replication_policies
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND account_name = '{{ account_name }}' -- required
AND object_replication_policy_id = '{{ object_replication_policy_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
List the object replication policies associated with the storage account.
SELECT
id,
name,
destinationAccount,
enabledTime,
metrics,
policyId,
priorityReplication,
rules,
sourceAccount,
systemData,
tagsReplication,
type
FROM azure.storage.object_replication_policies
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND account_name = '{{ account_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
Create or update the object replication policy of the storage account.
INSERT INTO azure.storage.object_replication_policies (
properties,
resource_group_name,
account_name,
object_replication_policy_id,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ account_name }}',
'{{ object_replication_policy_id }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: object_replication_policies
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the object_replication_policies resource.
- name: account_name
value: "{{ account_name }}"
description: Required parameter for the object_replication_policies resource.
- name: object_replication_policy_id
value: "{{ object_replication_policy_id }}"
description: Required parameter for the object_replication_policies resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the object_replication_policies resource.
- name: properties
description: |
Returns the Storage Account Object Replication Policy.
value:
policyId: "{{ policyId }}"
enabledTime: "{{ enabledTime }}"
sourceAccount: "{{ sourceAccount }}"
destinationAccount: "{{ destinationAccount }}"
rules:
- ruleId: "{{ ruleId }}"
sourceContainer: "{{ sourceContainer }}"
destinationContainer: "{{ destinationContainer }}"
filters:
prefixMatch:
- "{{ prefixMatch }}"
minCreationTime: "{{ minCreationTime }}"
metrics:
enabled: {{ enabled }}
priorityReplication:
enabled: {{ enabled }}
tagsReplication:
enabled: {{ enabled }}
REPLACE examples
- create_or_update
Create or update the object replication policy of the storage account.
REPLACE azure.storage.object_replication_policies
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND account_name = '{{ account_name }}' --required
AND object_replication_policy_id = '{{ object_replication_policy_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;
DELETE examples
- delete
Deletes the object replication policy associated with the specified storage account.
DELETE FROM azure.storage.object_replication_policies
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND account_name = '{{ account_name }}' --required
AND object_replication_policy_id = '{{ object_replication_policy_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;