ONTAP Rest API Discussions

Quota report REST API not returning any results after timeout value expires

ns-api-guru
1,719 Views

When I run 'quota report' command from ONTAP CLI, I can see the quota report with no issues.

 

But when I use REST API, it does not return anything:

curl -X GET -k "https://cluster/api/storage/quota/reports?volume.name=TEST&fields=type%2Cspace%2Cusers%2Cgroup%2Cqtree&return_timeout=120"
Enter host password for user 'test':
{
  "records": [
  ],
  "num_records": 0,
  "_links": {
    "self": {
      "href": "/api/storage/quota/reports?volume.name=TEST&fields=type%2Cspace%2Cusers%2Cgroup%2Cqtree&return_timeout=120"
    },
    "next": {
      "href": "/api/storage/quota/reports?start.svm.uuid..."
    }
  }
}

 

For other volumes, this call was also returning empty result set but when I increased the timeout value to 120, issue was resolved. Looks like this particular volume (and many others on this specific cluster) is taking much longer than 120 seconds to return something. However, ONTAP does not allow setting timeout to more than 120 seconds.

 

How should I resolve this?

 

Thanks

1 ACCEPTED SOLUTION

Twesha
1,568 Views

Normally, if the timeout is reached (120 seconds in your case), the GET call will return the records collected in that time along with a pagination link. If there were any quota reports on that volume, you would at least get some in that 120 seconds. So, it's surprising to me that you got 0 records. Is it possible that the query you provided is not returning anything? Could you try doing a GET on /api/storage/quota/reports/{volume.uuid} and see if you get any records? 

View solution in original post

3 REPLIES 3

Twesha
1,668 Views

Hi, could you tell me which version of ONTAP you are running?

ns-api-guru
1,657 Views

It is 9.8P12

Twesha
1,569 Views

Normally, if the timeout is reached (120 seconds in your case), the GET call will return the records collected in that time along with a pagination link. If there were any quota reports on that volume, you would at least get some in that 120 seconds. So, it's surprising to me that you got 0 records. Is it possible that the query you provided is not returning anything? Could you try doing a GET on /api/storage/quota/reports/{volume.uuid} and see if you get any records? 

Public