<?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 code for calling the quota-report-iter API? in Software Development Kit (SDK) and API Discussions</title>
    <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/python-code-for-calling-the-quota-report-iter-API/m-p/121908#M2041</link>
    <description>&lt;P&gt;Awesome, thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 01 Aug 2016 19:59:16 GMT</pubDate>
    <dc:creator>victor_engle</dc:creator>
    <dc:date>2016-08-01T19:59:16Z</dc:date>
    <item>
      <title>python code for calling the quota-report-iter API?</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/python-code-for-calling-the-quota-report-iter-API/m-p/121805#M2034</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone share some example python code for calling the quota-report-iter API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need an example of how to use the tag input attribute and also how to set&amp;nbsp;the max-records input attribute. I'd like to be able to get several hundred quota records each iteration.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have this much working and can get all the quota attributes but it only returns 20 records.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;s = NaServer(filer, 1, 3)&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;out = s.invoke("quota-report-iter")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 19:46:01 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/python-code-for-calling-the-quota-report-iter-API/m-p/121805#M2034</guid>
      <dc:creator>victor_engle</dc:creator>
      <dc:date>2025-06-04T19:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: python code for calling the quota-report-iter API?</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/python-code-for-calling-the-quota-report-iter-API/m-p/121867#M2035</link>
      <description>&lt;P&gt;Hi Victor,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is some python code for using the volume-get-iter api. &amp;nbsp;All of the "-iter" apis should work the same, so you should be able to change to use the quota-report-iter api and the properties being inspected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#! /usr/bin/python

from NaServer import *

server = NaServer("your.cluster", 1, 3)
server.set_admin_user("username", "password")
server.set_transport_type("HTTP")

tag = "";

while tag != None:
    if not tag:
        result = server.invoke('volume-get-iter', 'max-records', 1)
    else:
        result = server.invoke('volume-get-iter', 'tag', tag, 'max-records', 1)
    
    if result.results_status() == "failed":
        reason = result.results_reason()
        print( reason + "\n" )
        sys.exit(2)
    
    if result.child_get_int('num-records') == 0:
        print( "No volumes returned" )
        sys.exit(0)
    
    tag = result.child_get_string('next-tag')
    
    for volume in result.child_get('attributes-list').children_get():
        name = volume.child_get('volume-id-attributes').child_get_string('name')
        print( "Found volume with name: " + name )&lt;/PRE&gt;&lt;P&gt;Note that I used the "max-records" attribute with the ZAPI query to force it to have to do more than one request to the controller. &amp;nbsp;In a real environment you'll want it to do as few ZAPI calls to the cluster as possible for speed purposes (and CPU/network utilization on both ends).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2016 18:04:35 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/python-code-for-calling-the-quota-report-iter-API/m-p/121867#M2035</guid>
      <dc:creator>asulliva</dc:creator>
      <dc:date>2016-07-29T18:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: python code for calling the quota-report-iter API?</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/python-code-for-calling-the-quota-report-iter-API/m-p/121908#M2041</link>
      <description>&lt;P&gt;Awesome, thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2016 19:59:16 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/python-code-for-calling-the-quota-report-iter-API/m-p/121908#M2041</guid>
      <dc:creator>victor_engle</dc:creator>
      <dc:date>2016-08-01T19:59:16Z</dc:date>
    </item>
  </channel>
</rss>

