Update the SnapMirror policy
PATCH /snapmirror/policies/{uuid}
Introduced In: 9.6
Updates the SnapMirror policy.
Important notes
-
The properties "transfer_schedule" and "throttle" can be modified only if all the SnapMirror relationships associated with the specified SnapMirror policy have the same values.
-
The properties "retention.label" and "retention.count" are mandatory if "retention" is provided in the input. The provided "retention.label" is the final list and is replaced with the existing values.
-
The value of the "identity_preservation" property cannot be changed if the SnapMirror relationships associated with the policy have different identity_preservation configurations.
-
If the SnapMirror policy "identity_preservation" value matches the "identity_preservation" value of the associated SnapMirror relationships, then the "identity_preservation" value can be changed from a higher "identity_preservation" threshold value to a lower "identity_preservation" threshold value but not vice-versa. For example, the threshold value of the "identity_preservation" property can be changed from "full" to "exclude_network_config" to "exclude_network_and_protocol_config", but could not be increased from "exclude_network_and_protocol_config" to "exclude_network_config" to "full".
Related ONTAP commands
-
snapmirror policy modify
Example
Updating the "retention" property
PATCH "/api/snapmirror/policies/fe65686d-00dc-11e9-b5fb-0050568e3f83" '{"retention" : {"label" : ["sm_created", "lab2"], "count": ["1","2"], "creation_schedule": {"name": ["weekly"]}}}'
Updating "transfer_schedule", "throttle", and "identity_preservation" properties
PATCH "/api/snapmirror/policies/8aef950b-3bef-11e9-80ac-0050568ea591" '{"transfer_schedule.name" : "weekly", "throttle" : "100", "identity_preservation":"exclude_network_and_protocol_config"}'
Learn more
Parameters
Name | Type | In | Required | Description |
---|---|---|---|---|
uuid |
string |
path |
True |
Policy UUID |
return_timeout |
integer |
query |
False |
The number of seconds to allow the call to execute before returning. When doing a POST, PATCH, or DELETE operation on a single record, the default is 0 seconds. This means that if an asynchronous operation is started, the server immediately returns HTTP code 202 (Accepted) along with a link to the job. If a non-zero value is specified for POST, PATCH, or DELETE operations, ONTAP waits that length of time to see if the job completes so it can return something other than 202.
|
Request Body
Name | Type | Description |
---|---|---|
_links |
||
comment |
string |
Comment associated with the policy. |
identity_preservation |
string |
Specifies which configuration of the source SVM is replicated to the destination SVM. This property is applicable only for SVM data protection with "async" policy type. |
name |
string |
|
network_compression_enabled |
boolean |
Specifies whether network compression is enabled for transfers. This is applicable only to the policies of type "async". |
retention |
array[snapmirror_policy_rule] |
Policy on Snapshot copy retention. |
scope |
string |
Set to "svm" for policies owned by an SVM, otherwise set to "cluster". |
svm |
||
sync_common_snapshot_schedule |
Schedule used to create common Snapshot copies for synchronous relationships. |
|
sync_type |
string |
|
throttle |
integer |
Throttle in KB/s. Default to unlimited. |
transfer_schedule |
The schedule used to update asynchronous relationships. |
|
type |
string |
|
uuid |
string |
Example request
{
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"comment": "string",
"identity_preservation": "string",
"name": "Asynchronous",
"retention": [
{
"count": "7",
"creation_schedule": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "weekly",
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
},
"label": "hourly",
"prefix": "string"
}
],
"scope": "string",
"svm": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "svm1",
"uuid": "02c9e252-41be-11e9-81d5-00a0986138f7"
},
"sync_common_snapshot_schedule": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "weekly",
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
},
"sync_type": "string",
"throttle": 0,
"transfer_schedule": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"name": "weekly",
"uuid": "1cd8a442-86d1-11e0-ae1c-123478563412"
},
"type": "string",
"uuid": "4ea7a442-86d1-11e0-ae1c-123478563412"
}
Response
Status: 202, Accepted
Name | Type | Description |
---|---|---|
job |
Example response
{
"job": {
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"uuid": "string"
}
}
Error
Status: Default
ONTAP Error Response codes
Error code | Description |
---|---|
13303842 |
SnapMirror policy is not supported. |
13303843 |
Conflicting values between SnapMirror policy and SnapMirror relationships for either 'transfer_schedule, throttle or identity_preservation' properties |
13303850 |
Invalid input parameter |
13303887 |
Failed to create SnapMirror policy. Reason: Maximum number of allowed retention rules reached |
Name | Type | Description |
---|---|---|
error |
Example error
{
"error": {
"arguments": [
{
"code": "string",
"message": "string"
}
],
"code": "4",
"message": "entry doesn't exist",
"target": "uuid"
}
}
Definitions
See Definitions
href
Name | Type | Description |
---|---|---|
href |
string |
_links
Name | Type | Description |
---|---|---|
self |
creation_schedule
Schedule used to create Snapshot copies on the destination for long term retention.
Name | Type | Description |
---|---|---|
_links |
||
name |
string |
Job schedule name |
uuid |
string |
Job schedule UUID |
snapmirror_policy_rule
SnapMirror policy rule for retention.
Name | Type | Description |
---|---|---|
count |
integer |
Number of Snapshot copies to be kept for retention. |
creation_schedule |
Schedule used to create Snapshot copies on the destination for long term retention. |
|
label |
string |
Snapshot copy label |
prefix |
string |
Specifies the prefix for the Snapshot copy name to be created as per the schedule. If no value is specified, then the label is used as the prefix. |
svm
Name | Type | Description |
---|---|---|
_links |
||
name |
string |
The name of the SVM. |
uuid |
string |
The unique identifier of the SVM. |
sync_common_snapshot_schedule
Schedule used to create common Snapshot copies for synchronous relationships.
Name | Type | Description |
---|---|---|
_links |
||
name |
string |
Job schedule name |
uuid |
string |
Job schedule UUID |
transfer_schedule
The schedule used to update asynchronous relationships.
Name | Type | Description |
---|---|---|
_links |
||
name |
string |
Job schedule name |
uuid |
string |
Job schedule UUID |
snapmirror_policy
SnapMirror policy information. SnapMirror policy can either be of type "async" or "sync". The policy type "async" can be associated with a SnapMirror relationship that has either the FlexVol volume or FlexGroup volume or SVM as the endpoint. The policy type "sync" along with "sync_type" as "sync" or "strict_sync" can be associated with a SnapMirror relationship that has FlexVol volume as the endpoint. The policy type "sync" can have a "sync_type" of either "sync", "strict_sync" or "automated_failover". If the "sync_type" is "sync" then a write success is returned to the client after writing the data to the source endpoint and before writing the data to the destination endpoint. If the "sync_type" is "strict_sync" then a write success is returned to the client after writing the data to the both source and destination endpoints. If the "sync_type" is "automated_failover" then the policy can be associated with a SnapMirror relationship that has Consistency Group as the endpoint. Use the "sync" policy with "sync_type" as "automated_failover" to establish SnapMirror relationships for business continuity usecases. SnapMirror relationships with policy type as "sync" and "sync_type" as "automated_failover" can be monitored by the Mediator, if configured. In case the source Consistency Group endpoint is not reachable, the Mediator may trigger a failover to the destination Consistency Group endpoint.
Name | Type | Description |
---|---|---|
_links |
||
comment |
string |
Comment associated with the policy. |
identity_preservation |
string |
Specifies which configuration of the source SVM is replicated to the destination SVM. This property is applicable only for SVM data protection with "async" policy type. |
name |
string |
|
network_compression_enabled |
boolean |
Specifies whether network compression is enabled for transfers. This is applicable only to the policies of type "async". |
retention |
array[snapmirror_policy_rule] |
Policy on Snapshot copy retention. |
scope |
string |
Set to "svm" for policies owned by an SVM, otherwise set to "cluster". |
svm |
||
sync_common_snapshot_schedule |
Schedule used to create common Snapshot copies for synchronous relationships. |
|
sync_type |
string |
|
throttle |
integer |
Throttle in KB/s. Default to unlimited. |
transfer_schedule |
The schedule used to update asynchronous relationships. |
|
type |
string |
|
uuid |
string |
job_link
Name | Type | Description |
---|---|---|
_links |
||
uuid |
string |
The UUID of the asynchronous job that is triggered by a POST, PATCH, or DELETE operation. |
error_arguments
Name | Type | Description |
---|---|---|
code |
string |
Argument code |
message |
string |
Message argument |
error
Name | Type | Description |
---|---|---|
arguments |
array[error_arguments] |
Message arguments |
code |
string |
Error code |
message |
string |
Error message |
target |
string |
The target parameter that caused the error. |