NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

ONTAP Rest API Discussions

List all Snapshots

ST123
4,685 Views

Hi,

 

I want to list all snapshots from a storage cluster per api call, but I get a different output on CLI vs API. API output is only from one SVM?!

 

API-Request: https://<cluster_mgmt_ip>/api/storage/volumes/*/snapshots

CLI: Cluster::> snapshot show

 

Best Regards

ST

 

1 ACCEPTED SOLUTION

JohnChampion
4,473 Views

Confirmed - interesting the REST API even accepts a wildcard for the volume.uuid - I would expect it would throw an invalid URL error.

 

You can use the Private CLI method and get back results in standard JSON result/records format. The field names are the same as in the CLI - and you cannot use a wildcard (fields=*) with the private CLI method.

 

https://{clustermgtip}/api/private/cli/snapshot?fields=vserver,volume,snapshot,create-time,size,snapmirror-label

 

View solution in original post

3 REPLIES 3

JohnChampion
4,474 Views

Confirmed - interesting the REST API even accepts a wildcard for the volume.uuid - I would expect it would throw an invalid URL error.

 

You can use the Private CLI method and get back results in standard JSON result/records format. The field names are the same as in the CLI - and you cannot use a wildcard (fields=*) with the private CLI method.

 

https://{clustermgtip}/api/private/cli/snapshot?fields=vserver,volume,snapshot,create-time,size,snapmirror-label

 

ST123
4,432 Views

I didn't know the /private parameter, exactly what I was looking for, thanks! 

JohnChampion
4,376 Views

If you look at the top of the ONTAP REST API Online Reference (clusterip/docs/api) under "Features for all ONTAP APIs" the last topic "Using the private CLI passthrough with the ONTAP REST API" has a good description and some examples.

Public