ONTAP Rest API Discussions
ONTAP Rest API Discussions
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
Solved! See The Solution
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
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
I didn't know the /private parameter, exactly what I was looking for, thanks!
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.