<?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 Python: List files on vserver in Software Development Kit (SDK) and API Discussions</title>
    <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Python-List-files-on-vserver/m-p/21664#M794</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was trying to use the Python API to query a list of files on a specific volume on a specific vserver, so far i have been successfully able to do that using the powershell command:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;Read-NcDirectory /vol/volume0 -VserverContext nfs_test | where {$_.Type -match "directory" -and $_.Name -notmatch "\."} | Read-NcDirectory&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I try to accomplish a similar task using the python API:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;import sys&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;sys.path.append("C:\sdk\lib\python\NetApp")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;from NaServer import *&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;s = NaServer("10.0.0.1", 1 , 20)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;s.set_server_type("FILER")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;s.set_transport_type("HTTPS")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;s.set_port(443)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;s.set_style("LOGIN")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;s.set_admin_user("admin", "password")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;api = NaElement("file-list-directory-iter")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;api.child_add_string("encoded",True)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;api.child_add_string("path","&lt;SPAN style="color: #008080; font-family: 'courier new', courier;"&gt;/vol/volume0&lt;/SPAN&gt;")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;xo = s.invoke_elem(api)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;if (xo.results_status() == "failed") :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print ("Error:\n")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print (xo.sprintf())&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.exit (1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;print "Received:\n"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;print xo.sprintf()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get the following output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-family: 'courier new', courier;"&gt;Error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-family: 'courier new', courier;"&gt; &amp;lt;results status="failed" errno="13005" reason="Unable to find API: file-list-directory-iter-start"&amp;gt;&amp;lt;/results&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone been able to accomplish this? My main task is to verify all .vmdk and .qcow files inside a specific volume and check its QoS policy, if there's none I must be able to add one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any tips? Any hints? Anything?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jun 2025 05:29:35 GMT</pubDate>
    <dc:creator>ROMEROJNR</dc:creator>
    <dc:date>2025-06-05T05:29:35Z</dc:date>
    <item>
      <title>Python: List files on vserver</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Python-List-files-on-vserver/m-p/21664#M794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was trying to use the Python API to query a list of files on a specific volume on a specific vserver, so far i have been successfully able to do that using the powershell command:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;Read-NcDirectory /vol/volume0 -VserverContext nfs_test | where {$_.Type -match "directory" -and $_.Name -notmatch "\."} | Read-NcDirectory&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I try to accomplish a similar task using the python API:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;import sys&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;sys.path.append("C:\sdk\lib\python\NetApp")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;from NaServer import *&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;s = NaServer("10.0.0.1", 1 , 20)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;s.set_server_type("FILER")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;s.set_transport_type("HTTPS")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;s.set_port(443)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;s.set_style("LOGIN")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;s.set_admin_user("admin", "password")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;api = NaElement("file-list-directory-iter")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;api.child_add_string("encoded",True)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;api.child_add_string("path","&lt;SPAN style="color: #008080; font-family: 'courier new', courier;"&gt;/vol/volume0&lt;/SPAN&gt;")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;xo = s.invoke_elem(api)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;if (xo.results_status() == "failed") :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print ("Error:\n")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print (xo.sprintf())&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.exit (1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;print "Received:\n"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; color: #008080;"&gt;print xo.sprintf()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get the following output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-family: 'courier new', courier;"&gt;Error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-family: 'courier new', courier;"&gt; &amp;lt;results status="failed" errno="13005" reason="Unable to find API: file-list-directory-iter-start"&amp;gt;&amp;lt;/results&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone been able to accomplish this? My main task is to verify all .vmdk and .qcow files inside a specific volume and check its QoS policy, if there's none I must be able to add one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any tips? Any hints? Anything?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2025 05:29:35 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Python-List-files-on-vserver/m-p/21664#M794</guid>
      <dc:creator>ROMEROJNR</dc:creator>
      <dc:date>2025-06-05T05:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: Python: List files on vserver</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Python-List-files-on-vserver/m-p/21667#M795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The iter-start APIs calls aren't there any more, just file-list-directory-iter.&lt;/P&gt;&lt;P&gt;See the element next-tag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use the&amp;nbsp; ZExplore utility to find clues on these issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this response has been helpful to you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At your service,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eugene E. Kashpureff, Sr.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Independent NetApp Consultant, K&amp;amp;H Research &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.linkedin.com/in/eugenekashpureff" target="_blank"&gt;http://www.linkedin.com/in/eugenekashpureff&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Senior NetApp Instructor, IT Learning Solutions &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://sg.itls.asia/netapp" target="_blank"&gt;http://sg.itls.asia/netapp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;(P.S. I appreciate points for helpful or correct answers.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Aug 2014 07:12:35 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Python-List-files-on-vserver/m-p/21667#M795</guid>
      <dc:creator>ekashpureff</dc:creator>
      <dc:date>2014-08-30T07:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Python: List files on vserver</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Python-List-files-on-vserver/m-p/21675#M796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: Arial, Helvetica, Verdana, sans-serif; color: #454545; background-color: #ffffff;"&gt;I also tried the &lt;SPAN style="color: #454545; font-family: Arial, Helvetica, Verdana, sans-serif; background-color: #ffffff;"&gt;file-list-directory-iter, but I&lt;/SPAN&gt; get the same error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: Arial, Helvetica, Verdana, sans-serif; color: #454545; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier; color: #ff0000;"&gt;Error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Arial, Helvetica, Verdana, sans-serif; color: #454545; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier; color: #ff0000;"&gt;&amp;lt;results status="failed" errno="13005" reason="Unable to find API: file-list-directory-iter"&amp;gt;&amp;lt;/results&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I must also add that I'm with a clustered mode infrastructure. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Sep 2014 11:41:25 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Python-List-files-on-vserver/m-p/21675#M796</guid>
      <dc:creator>ROMEROJNR</dc:creator>
      <dc:date>2014-09-02T11:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: Python: List files on vserver</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Python-List-files-on-vserver/m-p/21680#M797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The API is indeed called &lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;file-list-directory-iter&lt;/STRONG&gt;&lt;/SPAN&gt;. Note that it is a Vserver-specific API, so you need to either:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Set the desired Vserver using &lt;STRONG style="font-family: courier new,courier;"&gt;s.set_vserver(vserver_name)&lt;/STRONG&gt;, OR&lt;/LI&gt;&lt;LI&gt;Connect to the Vserver management IP rather than the cluster management IP.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Ben&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Sep 2014 16:17:54 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Python-List-files-on-vserver/m-p/21680#M797</guid>
      <dc:creator>zulanch</dc:creator>
      <dc:date>2014-09-02T16:17:54Z</dc:date>
    </item>
  </channel>
</rss>

