Software Development Kit (SDK) and API Discussions
Software Development Kit (SDK) and API Discussions
hi
i know the cli command to clone the lun from snapshot copy of volume in netapp Array..
CLI commands:
1. create snapshot:
volume snapshot create -vserver vs1 -volume vol1 -snapshot vol1_snapshot
2. clone one lun:
file clone create -vserver vs1 -volume vol1 -source-path lun1 -snapshot-name vol1_snapshot -destination-path lun1_snap_clone
i know the RESTAPI for creating a snapshot . i want to know restapi for Cloning LUNs from a Snapshot copy in a volume
BTW this is in cluster mode
-neha
could you please share details if LUN clone from VOL snapshot has been sorted out ? I do have similar requirement.
As there is no restApi from cloning lun from volume
so i use ZAPI and generate the xml structure to clone the lun and then use that xml code in proxy-api request.
Hope this will help.
api = NaElement("volume-clone-create")
api.child_add_string("junction-path","/test_clone")
api.child_add_string("parent-snapshot","test-snap")
api.child_add_string("parent-volume","vol_test2")
api.child_add_string("volume","test_clone")
api.child_add_string("volume-type","RW")
xo = s.invoke_elem(api)
there no direct Rest-Api for this, but you can achieve this by using RestApi+ZAPI
first you have to create a xml or json body for cloing the lun from snapshot
{'api': {'clone-create':
{'destination-path': “dest”,
'snapshot-name': “snap_name”,
'source-path': “src”,
'volume': “volname”}}}
then pass payload to Rest-Api: