def delete_snapmirror() -> None: """Delete Snapmirror""" print("=============================================") print() show_snapmirror() snapmirror_uuid = input("Enter the UUID of the snapmirror to be deleted:-") snapmirrorrelationship = SnapmirrorRelationship.find(uuid=snapmirror_uuid) try: if snapmirrorrelationship.delete(poll=True): print("Snapmirror Relationship has been deleted Successfully.") except NetAppRestError as error: print("Exception caught :" + str(error))
def patch_snapmirror() -> None: """Update Snapmirror Relation""" print("=============================================") print() show_snapmirror() snapmirror_uuid = input("Enter the UUID of the snapmirror to be updated:-") snapmirrortransfer = SnapmirrorRelationship.find(uuid=snapmirror_uuid) snapchoice = input( "Enter the state to update?[snapmirrored/paused/broken_off/uninitialized/synchronizing] ") snapmirrortransfer.state = snapchoice try: if snapmirrortransfer.patch(poll=True): print("Snapmirror Relationship Updated Successfully") except NetAppRestError as error: print("Exception caught :" + str(error))
def list_snapmirror() -> None: """List Snapmirror""" print("List of SnapMirror Relationships:") print("=================================") try: for snapmirrorrelationship in SnapmirrorRelationship.get_collection( fields="uuid"): print(snapmirrorrelationship.uuid) snapmirror1 = SnapmirrorRelationship.find( uuid=snapmirrorrelationship.uuid) print(snapmirror1.source.path) print(snapmirror1.destination.path) print(snapmirror1.state) print("-----------------------------") except NetAppRestError as error: print("Exception caught :" + str(error))