Community maintenance is complete. Thank you for your patience!

Software Development Kit (SDK) and API Discussions

Python API quotareport script for user quota


Hi ,


I am new to APi's, Wrote the below one, 
My requirement is to get the quota report for a user. Couls someone kindly help me with the error below.


from netapp_ontap import HostConnection
from netapp_ontap import NetAppRestError
from netapp_ontap.resources import QuotaReport

with HostConnection("xxxxxxxx", username="admin", password="XXXXXX", verify=False):
resource = QuotaReport(
**{"volume.uuid": "de90a323-1349-49c9-acdf-f6822e82f6db"}


when i run this in python script, i am getting below error.


$ ./
Traceback (most recent call last):
File "./", line 11, in <module>
File "/usr/local/lib/python3.6/site-packages/netapp_ontap/resources/", line 1339, in get
return super()._get(**kwargs)
File "/usr/local/lib/python3.6/site-packages/netapp_ontap/", line 55, in wrapper
return on_api_fail(erro)
File "/usr/local/lib/python3.6/site-packages/netapp_ontap/", line 78, in on_api_fail
raise NetAppRestError(cause=erro) from None
netapp_ontap.error.NetAppRestError: Caused by HTTPError('404 Client Error: Not Found for url:',): "2305843013508661248" is an invalid value for field "volume.uuid" (<UUID>)




There were multiple reasons I faced this issue one was VPN connection from home , when you dont have proper ssh connection to the controller from your desktop/jumpserver to your end controller it throws this issue ,


sometimes when you do a .get command it cant find the values if quota report has empty variables try using getattr to set values of unset variables to zero or null

try get collection command


quots = quotareport.get_collection(vol.uuid)

for quotx  in quots :
quotx.get(fields='specifier,volume,space,qtree,files,index,qtree ')



NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner