NetApp / ontap-rest-python

This repository contains sample code illustrating how to access the ONTAP REST API using Python. This Repository also contains ONTAPI Usage reporting code that helps to identify ONTAPI usage in your environment using ONTAP REST APIs.
BSD 3-Clause "New" or "Revised" License
62 stars 41 forks source link

Snapmirror relationship #27

Closed ignaziocassano closed 3 years ago

ignaziocassano commented 3 years ago

Hello, palese is it possibile an example where I can specify source and destination cluster for snapmirror relationship? The example you wrote cannot do it.

github-actions[bot] commented 3 years ago

Thank you for reporting an issue! If you haven't already joined our Slack community, then we invite you to do so. This is a great place to get help and ask questions from our community.

RobertBlackhart commented 3 years ago

Here are the lines from the example that create the relationship:

https://github.com/NetApp/ontap-rest-python/blob/d2bc8acf062d5b52509106e462c38449acf3f734/examples/python_client_library/snapmirror_operations.py#L54-L60

If you were to change them to add cluster information, you might change 57 and 58 to:

dataobj['source'] = {"path": src, "cluster": {"name": "source_cluster"}}
dataobj['destination'] = {"path": dst, "cluster": {"name": "destination_cluster"}}
ignaziocassano commented 3 years ago

Many thanks