<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: python Rest Api 9.7 quota report broken in Software Development Kit (SDK) and API Discussions</title>
    <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/python-Rest-Api-9-7-quota-report-broken/m-p/156116#M3041</link>
    <description>&lt;P&gt;I'm not sure why you are getting the error shown from the code snippet you have highlighted. That error means that the field you are trying to access, hard_limit, is not populated in your local copy of the object.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you trying to access this field directly in later code? When I return my current QuotaReport list, that field isn't set by the API so I get the same error only when I try to access it:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;&amp;gt;&amp;gt;&amp;gt; with HostConnection("x.x.x.x", username="yyyy", password="zzzz", verify=False):
  2     for report in QuotaReport.get_collection(fields="*"):
  3         print(report)
  4         print(f"The hard limit is: {report.space.hard_limit}")
QuotaReport({'files': {'used': {'total': 0}}, 'index': 5764607523034234880, 'space': {'used': {'total': 0}}, 'svm': {'uuid': 'b72dc47d-9078-11ea-b848-005056bb7869', '_links': {'self': {'href': '/api/svm/svms/b72dc47d-9078-11ea-b848-005056bb7869'}}, 'name': 'vs1'}, 'type': 'tree', 'qtree': {'name': ''}, '_links': {'self': {'href': '/api/storage/quota/reports/b8e9e683-9078-11ea-b848-005056bb7869/5764607523034234880'}}, 'volume': {'uuid': 'b8e9e683-9078-11ea-b848-005056bb7869', '_links': {'self': {'href': '/api/storage/volumes/b8e9e683-9078-11ea-b848-005056bb7869'}}, 'name': 'vs1_root'}})
Traceback (most recent call last):
  File "&amp;lt;stdin&amp;gt;", line 4, in &amp;lt;module&amp;gt;
  File "/home/pyenv3/lib/python3.7/site-packages/netapp_ontap/resource.py", line 191, in __getattribute__
    ) from None
AttributeError: The 'hard_limit' field has not been set on the QuotaReportSpace. Try refreshing the object by calling get().

The 'hard_limit' field has not been set on the QuotaReportSpace. Try refreshing the object by calling get().
&amp;gt;&amp;gt;&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to account for some records that have it and some that don't, then you could change your code like this:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;&amp;gt;&amp;gt;&amp;gt; with HostConnection("x.x.x.x", username="yyyy", password="zzzz", verify=False):
  2     for report in QuotaReport.get_collection(fields="*"):
  3         print(report)
  4         print(f"The hard limit is: {getattr(report.space, 'hard_limit', 'not set')}")
QuotaReport({'files': {'used': {'total': 0}}, 'index': 5764607523034234880, 'space': {'used': {'total': 0}}, 'svm': {'uuid': 'b72dc47d-9078-11ea-b848-005056bb7869', '_links': {'self': {'href': '/api/svm/svms/b72dc47d-9078-11ea-b848-005056bb7869'}}, 'name': 'vs1'}, 'type': 'tree', 'qtree': {'name': ''}, '_links': {'self': {'href': '/api/storage/quota/reports/b8e9e683-9078-11ea-b848-005056bb7869/5764607523034234880'}}, 'volume': {'uuid': 'b8e9e683-9078-11ea-b848-005056bb7869', '_links': {'self': {'href': '/api/storage/volumes/b8e9e683-9078-11ea-b848-005056bb7869'}}, 'name': 'vs1_root'}})
The hard limit is: not set
&amp;gt;&amp;gt;&amp;gt;&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 11 May 2020 10:40:58 GMT</pubDate>
    <dc:creator>RobertBlackhart</dc:creator>
    <dc:date>2020-05-11T10:40:58Z</dc:date>
    <item>
      <title>python Rest Api 9.7 quota report broken</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/python-Rest-Api-9-7-quota-report-broken/m-p/156098#M3039</link>
      <description>&lt;PRE&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;netapp_ontap.resources &lt;SPAN&gt;import &lt;/SPAN&gt;QuotaReport&lt;BR /&gt;result = QuotaReport.get_collection(&lt;SPAN&gt;volume&lt;/SPAN&gt;=&lt;SPAN&gt;'vol_users'&lt;/SPAN&gt;, &lt;SPAN&gt;fields&lt;/SPAN&gt;=&lt;SPAN&gt;"*"&lt;/SPAN&gt;)&lt;/PRE&gt;
&lt;P&gt;Error received:&lt;/P&gt;
&lt;P&gt;AttributeError: The 'hard_limit' field has not been set on the QuotaReportSpace. Try refreshing the object by calling get().&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This was working fine on 9.6&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The error seems to be the api does not read the qtree users quota rule but expects a define user quota rule&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My Env:&lt;/P&gt;
&lt;P&gt;Python 3.6&lt;/P&gt;
&lt;P&gt;netapp_ontap: 9.7.2&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 11:10:39 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/python-Rest-Api-9-7-quota-report-broken/m-p/156098#M3039</guid>
      <dc:creator>nicola_mendella</dc:creator>
      <dc:date>2025-06-04T11:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: python Rest Api 9.7 quota report broken</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/python-Rest-Api-9-7-quota-report-broken/m-p/156116#M3041</link>
      <description>&lt;P&gt;I'm not sure why you are getting the error shown from the code snippet you have highlighted. That error means that the field you are trying to access, hard_limit, is not populated in your local copy of the object.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you trying to access this field directly in later code? When I return my current QuotaReport list, that field isn't set by the API so I get the same error only when I try to access it:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;&amp;gt;&amp;gt;&amp;gt; with HostConnection("x.x.x.x", username="yyyy", password="zzzz", verify=False):
  2     for report in QuotaReport.get_collection(fields="*"):
  3         print(report)
  4         print(f"The hard limit is: {report.space.hard_limit}")
QuotaReport({'files': {'used': {'total': 0}}, 'index': 5764607523034234880, 'space': {'used': {'total': 0}}, 'svm': {'uuid': 'b72dc47d-9078-11ea-b848-005056bb7869', '_links': {'self': {'href': '/api/svm/svms/b72dc47d-9078-11ea-b848-005056bb7869'}}, 'name': 'vs1'}, 'type': 'tree', 'qtree': {'name': ''}, '_links': {'self': {'href': '/api/storage/quota/reports/b8e9e683-9078-11ea-b848-005056bb7869/5764607523034234880'}}, 'volume': {'uuid': 'b8e9e683-9078-11ea-b848-005056bb7869', '_links': {'self': {'href': '/api/storage/volumes/b8e9e683-9078-11ea-b848-005056bb7869'}}, 'name': 'vs1_root'}})
Traceback (most recent call last):
  File "&amp;lt;stdin&amp;gt;", line 4, in &amp;lt;module&amp;gt;
  File "/home/pyenv3/lib/python3.7/site-packages/netapp_ontap/resource.py", line 191, in __getattribute__
    ) from None
AttributeError: The 'hard_limit' field has not been set on the QuotaReportSpace. Try refreshing the object by calling get().

The 'hard_limit' field has not been set on the QuotaReportSpace. Try refreshing the object by calling get().
&amp;gt;&amp;gt;&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to account for some records that have it and some that don't, then you could change your code like this:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;&amp;gt;&amp;gt;&amp;gt; with HostConnection("x.x.x.x", username="yyyy", password="zzzz", verify=False):
  2     for report in QuotaReport.get_collection(fields="*"):
  3         print(report)
  4         print(f"The hard limit is: {getattr(report.space, 'hard_limit', 'not set')}")
QuotaReport({'files': {'used': {'total': 0}}, 'index': 5764607523034234880, 'space': {'used': {'total': 0}}, 'svm': {'uuid': 'b72dc47d-9078-11ea-b848-005056bb7869', '_links': {'self': {'href': '/api/svm/svms/b72dc47d-9078-11ea-b848-005056bb7869'}}, 'name': 'vs1'}, 'type': 'tree', 'qtree': {'name': ''}, '_links': {'self': {'href': '/api/storage/quota/reports/b8e9e683-9078-11ea-b848-005056bb7869/5764607523034234880'}}, 'volume': {'uuid': 'b8e9e683-9078-11ea-b848-005056bb7869', '_links': {'self': {'href': '/api/storage/volumes/b8e9e683-9078-11ea-b848-005056bb7869'}}, 'name': 'vs1_root'}})
The hard limit is: not set
&amp;gt;&amp;gt;&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 11 May 2020 10:40:58 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/python-Rest-Api-9-7-quota-report-broken/m-p/156116#M3041</guid>
      <dc:creator>RobertBlackhart</dc:creator>
      <dc:date>2020-05-11T10:40:58Z</dc:date>
    </item>
  </channel>
</rss>

