Skip to main content
NetApp Knowledge Base

REST API is different from CLI results

Views:
120
Visibility:
Public
Votes:
0
Category:
ontap-9
Specialty:
CORE
Last Updated:

Applies to

  • ONTAP
  • REST
  • Active Filesystem (AFS)

Issue

When executing REST calls to get snapshot usage information, it does not match the size field displayed from the command line interface of ONTAP

The example below shows a REST and CLI output example demonstrating the size difference in the report:

svm1::> snap list -volume svm1_root -snapshot weekly.2024-03-01_1427 -fields blocks, size, usedblocks
vserver volume    snapshot               size  blocks usedblocks
------- --------- ---------------------- ----- ------ ----------
svm1    svm1_root weekly.2024-03-01_1427 220KB 1%     34%

% curl --insecure -u vsadmin -X GET "https://10.61.87.72/api/storage/volumes/4ce95854-cf08-11ed-81ae-005056a034e0/snapshots?svm.name=svm1&fields=size&return_records=true&return_timeout=0" -H  "accept: application/json" -  "authorization: Basic dnNhZG1pbjpOZXRhcHAxIQ=="
Enter host password for user 'vsadmin':
{
  "records": [
    {
      "uuid": "f22002fa-5626-4976-9ec7-8ecd74be1a4c",
      "svm": {
        "name": "svm1"
      },
      "name": "weekly.2024-03-01_1427",
      "size": 348160
    }
  ],
  "num_records": 1,
  "_links": {
    "self": {
      "href": "/api/storage/volumes/4ce95854-cf08-11ed-81ae-005056a034e0/snapshots?svm.name=svm1&fields=size&return_records=true&return_timeout=0"
    },
    "next": {
      "href": "/api/storage/volumes/4ce95854-cf08-11ed-81ae-005056a034e0/snapshots?start.cpcount=11&start.uuid=f22002fa-5626-4976-9ec7-8ecd74be1a4c&svm.name=svm1&fields=size&return_records=true&return_timeout=0"
    }
  }

 
 

Sign in to view the entire content of this KB article.

New to NetApp?

Learn more about our award-winning Support

NetApp provides no representations or warranties regarding the accuracy or reliability or serviceability of any information or recommendations provided in this publication or with respect to any results that may be obtained by the use of the information or observance of any recommendations provided herein. The information in this document is distributed AS IS and the use of this information or the implementation of any recommendations or techniques herein is a customer's responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. This document and the information contained herein may be used solely in connection with the NetApp products discussed in this document.