Skip to main content
A newer release of this product is available.

Create a SnapMirror policy

Contributors

POST /snapmirror/policies

Creates a SnapMirror policy. The parameter "identity_preservation" is applicable to only SnapMirror relationships with SVM endpoints and it indicates which configuration of the source SVM is replicated to the destination SVM.

It takes the following values:

  • full - indicates that the source SVM configuration is replicated to the destination SVM endpoint.

  • exclude_network_config - indicates that the source SVM configuration other than network configuration is replicated to the destination SVM endpoint.

  • exclude_network_and_protocol_config - indicates that the source SVM configuration is not replicated to the destination SVM endpoint.

Important note

  • The property "identity_preservation" is applicable to only SnapMirror relationships with SVM endpoints and it indicates which configuration of the source SVM is replicated to the destination SVM.

  • The properties "identity_preservation", "retention" and "transfer_schedule" are not applicable for "sync" type policies.

  • The property "sync_common_snapshot_schedule" is not applicabe for an "async" type policy.

  • The property "retention.count" specifies the maximum number of Snapshot copies that are retained on the SnapMirror destination volume.

  • When the property "retention.label" is specified, the Snapshot copies that have a SnapMirror label matching this property is transferred to the SnapMirror destination.

  • When the property "retention.creation_schedule" is specified, Snapshot copies are directly created on the SnapMirror destination. The Snapshot copies created have the same content as the latest Snapshot copy already present on the SnapMirror destination.

Required properties

  • name - Name of the new SnapMirror policy.

  • svm.name or svm.uuid - Name or UUID of the SVM that owns the SnapMirror policy.

Default property values

If not specified in POST, the following default property values are assigned:

  • type - async

  • sync_type - sync (when type is sync)

  • network_compression_enabled - false

  • throttle - 0

  • identity_preservation - exclude_network_and_protocol_config

  • snapmirror policy create

Examples

Creating a SnapMirror policy of type "sync"

 POST "/api/snapmirror/policies/" '{"name": "policy1", "svm.name": "VS0", "type": "sync", "sync_type": "sync"}'

Creating a SnapMirror policy of type "async" with retention values

 POST "/api/snapmirror/policies" '{"name": "policy_ret", "svm": {"name": "vs1"}, "retention": {"label": ["smcreate"], "count": ["2"], "creation_schedule": ["weekly"]}}'

Creating a SnapMirror policy of type "async"

 POST "/api/snapmirror/policies" '{"name": "newPolicy", "svm":{"name" : "vs1"}, "type": "async"}'

Parameters

Name Type In Required Description

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

_links

comment

string

Comment associated with the policy.

identity_preservation

string

Specifies which configuration of the source SVM is replicated to destination. This field is applicable only for SVM data protection and async policies.

name

string

network_compression_enabled

boolean

Specifies whether network compression is enabled for transfers. This is applicable only to async policies.

retention

array[snapmirror_policy_rule]

Policy on Snapshot copy retention. This is applicable only to async policies.

scope

string

Set to "svm" for policies owned by an SVM, otherwise set to "cluster".

svm

svm

SVM, applies only to SVM-scoped objects.

sync_common_snapshot_schedule

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

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": "MirrorAndVault",
  "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

job_link

Example response
{
  "job": {
    "_links": {
      "self": {
        "href": "/api/resourcelink"
      }
    },
    "uuid": "string"
  }
}

Error

Status: Default

ONTAP Error Response codes

Error code Description

13303850

Invalid input parameter

Name Type Description

error

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

Name Type Description

self

href

creation_schedule

Schedule used to create Snapshot copies on the destination for long term retention.

Name Type Description

_links

_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

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

SVM, applies only to SVM-scoped objects.

Name Type Description

_links

_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

_links

name

string

Job schedule name

uuid

string

Job schedule UUID

transfer_schedule

The schedule used to update asynchronous relationships.

Name Type Description

_links

_links

name

string

Job schedule name

uuid

string

Job schedule UUID

snapmirror_policy

SnapMirror policy information

Name Type Description

_links

_links

comment

string

Comment associated with the policy.

identity_preservation

string

Specifies which configuration of the source SVM is replicated to destination. This field is applicable only for SVM data protection and async policies.

name

string

network_compression_enabled

boolean

Specifies whether network compression is enabled for transfers. This is applicable only to async policies.

retention

array[snapmirror_policy_rule]

Policy on Snapshot copy retention. This is applicable only to async policies.

scope

string

Set to "svm" for policies owned by an SVM, otherwise set to "cluster".

svm

svm

SVM, applies only to SVM-scoped objects.

sync_common_snapshot_schedule

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

transfer_schedule

The schedule used to update asynchronous relationships.

type

string

uuid

string

Name Type Description

_links

_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.