ONTAP Rest API Discussions
ONTAP Rest API Discussions
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
Solved! See The Solution
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?
Hi, could you tell me which version of ONTAP you are running?
It is 9.8P12
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?