Retrieve SnapMirror async and sync policy types
GET /snapmirror/policies
Introduced In: 9.6
Retrieves SnapMirror policies of type "async" and "sync".
Related ONTAP commands
-
snapmirror policy show
Example
The following example shows how to retrieve a collection of SnapMirror policies.
GET "/api/snapmirror/policies"
Learn more
Parameters
Name | Type | In | Required | Description |
---|---|---|---|---|
sync_common_snapshot_schedule.uuid |
string |
query |
False |
Filter by sync_common_snapshot_schedule.uuid |
sync_common_snapshot_schedule.name |
string |
query |
False |
Filter by sync_common_snapshot_schedule.name |
name |
string |
query |
False |
Filter by name |
create_snapshot_on_source |
boolean |
query |
False |
Filter by create_snapshot_on_source
|
retention.label |
string |
query |
False |
Filter by retention.label |
retention.preserve |
boolean |
query |
False |
Filter by retention.preserve
|
retention.warn |
integer |
query |
False |
Filter by retention.warn
|
retention.period |
string |
query |
False |
Filter by retention.period
|
retention.prefix |
string |
query |
False |
Filter by retention.prefix |
retention.creation_schedule.uuid |
string |
query |
False |
Filter by retention.creation_schedule.uuid |
retention.creation_schedule.name |
string |
query |
False |
Filter by retention.creation_schedule.name |
retention.count |
integer |
query |
False |
Filter by retention.count |
svm.uuid |
string |
query |
False |
Filter by svm.uuid |
svm.name |
string |
query |
False |
Filter by svm.name |
sync_type |
string |
query |
False |
Filter by sync_type |
copy_latest_source_snapshot |
boolean |
query |
False |
Filter by copy_latest_source_snapshot
|
transfer_schedule.uuid |
string |
query |
False |
Filter by transfer_schedule.uuid |
transfer_schedule.name |
string |
query |
False |
Filter by transfer_schedule.name |
type |
string |
query |
False |
Filter by type |
identity_preservation |
string |
query |
False |
Filter by identity_preservation |
scope |
string |
query |
False |
Filter by scope |
network_compression_enabled |
boolean |
query |
False |
Filter by network_compression_enabled |
rpo |
integer |
query |
False |
Filter by rpo
|
copy_all_source_snapshots |
boolean |
query |
False |
Filter by copy_all_source_snapshots
|
throttle |
integer |
query |
False |
Filter by throttle |
comment |
string |
query |
False |
Filter by comment |
uuid |
string |
query |
False |
Filter by uuid |
fields |
array[string] |
query |
False |
Specify the fields to return. |
max_records |
integer |
query |
False |
Limit the number of records returned. |
return_records |
boolean |
query |
False |
The default is true for GET calls. When set to false, only the number of records is returned.
|
return_timeout |
integer |
query |
False |
The number of seconds to allow the call to execute before returning. When iterating over a collection, the default is 15 seconds. ONTAP returns earlier if either max records or the end of the collection is reached.
|
order_by |
array[string] |
query |
False |
Order results by specified fields and optional [asc |
Response
Status: 200, Ok
Name | Type | Description |
---|---|---|
_links |
||
num_records |
integer |
Number of records |
records |
array[snapmirror_policy] |
Example response
{
"_links": {
"next": {
"href": "/api/resourcelink"
},
"self": {
"href": "/api/resourcelink"
}
},
"num_records": 1,
"records": [
{
"_links": {
"self": {
"href": "/api/resourcelink"
}
},
"comment": "string",
"copy_all_source_snapshots": 1,
"copy_latest_source_snapshot": 1,
"create_snapshot_on_source": "",
"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",
"period": "P30D",
"prefix": "string",
"preserve": 1,
"warn": 4
}
],
"rpo": 0,
"scope": "string",
"snapshot_lock_mode": "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"
}
]
}
Error
Status: Default
ONTAP Error Response codes
Error code | Description |
---|---|
13303842 |
SnapMirror policy is not supported. |
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 |
---|---|---|
next |
||
self |
_links
Name | Type | Description |
---|---|---|
self |
archive
Archive information for the objects in an object store SnapMirror relationship. This property is applicable only for "async" policies with "create_snapshot_on_source" set to "false".
Name | Type | Description |
---|---|---|
after_days |
integer |
Number of days after which the objects are archived. This is only applicable when "archive.enabled" is "true". If this property is not set when "archive.enabled" is "true", the default value is "0" and therefore archiving will be triggered instantly. The value range is 0..999. If the value is set to "0", the latest snapshot copy will be archived. The value of after_days cannot be changed from "0" if any FlexVol SnapMirror relationship is associated with the policy. |
enabled |
boolean |
When set to "true", the objects are archived. When set to "false", the objects are not archived. |
creation_schedule
Schedule used to create Snapshot copies on the destination for long term retention. Only cron schedules are supported for SnapMirror.
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. Maximum value will differ based on type of relationship and scaling factor. For normal SnapMirror relationship without Snapshot copy scaling enabled maximum value can be 251 and with Snapshot copy scaling enabled it can be 1019. For object store SnapMirror relationships maximum value can be 4091. |
creation_schedule |
Schedule used to create Snapshot copies on the destination for long term retention. Only cron schedules are supported for SnapMirror. |
|
label |
string |
Snapshot copy label |
period |
string |
Specifies the duration for which the Snapshot copies are locked. The retention period value represents a duration and must be in the ISO-8601 duration format. Years, months, days, hours, minutes, and seconds are represented as "P |
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. |
preserve |
boolean |
Specifies the behavior when the Snapshot copy retention count is reached on the SnapMirror destination for the rule. The default value is false, which means that the oldest Snapshot copy is deleted to make room for new ones but only if the number of Snapshot copies has exceeded the retention count specified in the 'count' property. When set to true and where the Snapshot copies have reached the retention count, an incremental SnapMirror transfer will fail or if the rule has a schedule, Snapshot copies will be no longer be created on the SnapMirror destination. |
warn |
integer |
Specifies the warning threshold count for the rule. The default value is zero. When set to a value greater than zero, an event is generated after the number of Snapshot copies (for the particular rule) retained on a SnapMirror destination reaches the specified warning limit. The preserve property for the rule must be true in order to set the warn property to a value greater than zero. |
svm
SVM, applies only to SVM-scoped objects.
Name | Type | Description |
---|---|---|
_links |
||
name |
string |
The name of the SVM. This field cannot be specified in a PATCH method. |
uuid |
string |
The unique identifier of the SVM. This field cannot be specified in a PATCH method. |
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. Only cron schedules are supported for SnapMirror.
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", "sync" or "continuous". The policy type "async" can be associated with a SnapMirror relationship that has either a FlexVol volume, 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 a FlexVol volume as the endpoint. The policy type "sync" can have a "sync_type" of either "sync", "strict_sync", "automated_failover" or "automated_failover_duplex". If the "sync_type" is "sync", 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", a write success is returned to the client after writing the data to both source and destination endpoints. If the "sync_type" is "automated_failover", the policy can be associated with a SnapMirror active sync relationship that has a consistency group as the endpoint and provides asymmetric active active access to the two storage copies. If the "sync_type" is "automated_failover_duplex", the policy can be associated with a SnapMirror active sync relationship that has a consistency group as the endpoint and provides symmetric active active access to the two storage copies. Use the "sync" policy with "sync_type" as "automated_failover" or "automated_failover_duplex" to establish SnapMirror active sync relationships for business continuity use cases. SnapMirror relationships with policy types as "sync" and "sync_type" as "automated_failover" or "automated_failover_duplex" can be monitored by the Mediator, if configured. If the source Consistency Group endpoint is not reachable, the Mediator might trigger a failover to the destination consistency group endpoint. A policy type of "continuous" can be associated with SnapMirror relationships that have either ONTAP S3 buckets or non-ONTAP object stores as endpoints. This type of policy is used for FabricLink owned targets.
Name | Type | Description |
---|---|---|
_links |
||
archive |
Archive information for the objects in an object store SnapMirror relationship. This property is applicable only for "async" policies with "create_snapshot_on_source" set to "false". |
|
comment |
string |
Comment associated with the policy. |
copy_all_source_snapshots |
boolean |
Specifies that all the source Snapshot copies (including the one created by SnapMirror before the transfer begins) should be copied to the destination on a transfer. "Retention" properties cannot be specified along with this property. This is applicable only to async policies. Property can only be set to 'true'. |
copy_latest_source_snapshot |
boolean |
Specifies that the latest source Snapshot copy (created by SnapMirror before the transfer begins) should be copied to the destination on a transfer. "Retention" properties cannot be specified along with this property. This is applicable only to async policies. Property can only be set to 'true'. |
create_snapshot_on_source |
boolean |
Specifies whether a new Snapshot copy should be created on the source at the beginning of an update or resync operation. This is applicable only to async policies. Property can only be set to 'false'. |
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 |
Name of the policy. |
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] |
Rules for Snapshot copy retention. |
rpo |
integer |
Specifies the duration of time for which a change to be propagated to a mirror should be delayed, in seconds. This is an intentional propagation delay between mirrors and is configurable down to zero, which means an immediate propagation. This is supported for policies of type 'continuous'. |
scope |
string |
Set to "svm" for policies owned by an SVM, otherwise set to "cluster". |
snapshot_lock_mode |
string |
Specifies the lock mode of the Snapshot copies stored in the object store. This property is applicable only to policies of type "async" with "create_snapshot_on_source" set to "false". When set to enterprise or compliance, the policy can be associated only with SnapMirror relationships where the source endpoint is a FlexVol volume and the destination endpoint is an object store. When set to compliance, no users can delete a Snapshot copy until the retention period has expired. When set to enterprise, users that have special permissions can delete a Snapshot copy before the retention period has expired. |
svm |
SVM, applies only to SVM-scoped objects. |
|
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. Only cron schedules are supported for SnapMirror. |
|
type |
string |
|
uuid |
string |
Unique identifier of the SnapMirror policy. |
error_arguments
Name | Type | Description |
---|---|---|
code |
string |
Argument code |
message |
string |
Message argument |
returned_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. |