Software Development Kit (SDK) and API Discussions

RESTAPI for Cloning LUNs from a Snapshot copy in a volume

neha_T
3,819 Views

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

4 REPLIES 4

SanGuyEMC
3,490 Views

could you please share details if LUN clone from VOL snapshot has been sorted out ? I do have similar requirement.

neha_T
3,451 Views

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.

 

gaurav_verma
3,273 Views

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)

neha_T
3,257 Views

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:

post /1.0/ontap/storage-vms/{key}/advanced/jobs/proxy-api

 

 

Public