Software Development Kit (SDK) and API Discussions

RESTAPI for Cloning LUNs from a Snapshot copy in a volume

neha_T

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

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

neha_T

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

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

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

 

 

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public