<?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: Script to find volumes containing non-qtree data in multiple filers running ontap7 in Software Development Kit (SDK) and API Discussions</title>
    <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Script-to-find-volumes-containing-non-qtree-data-in-multiple-filers-running/m-p/121448#M2021</link>
    <description>&lt;P&gt;Directories and qtree are same when you invoke "&lt;SPAN&gt;file-list-directory-iter", &amp;nbsp;so use "qtree-list" to exclude qtree of this first list.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;From there you can deduct directories only.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;François&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Jul 2016 12:32:51 GMT</pubDate>
    <dc:creator>francoisbnc</dc:creator>
    <dc:date>2016-07-19T12:32:51Z</dc:date>
    <item>
      <title>Script to find volumes containing non-qtree data in multiple filers running ontap7</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Script-to-find-volumes-containing-non-qtree-data-in-multiple-filers-running/m-p/121102#M1998</link>
      <description>&lt;P&gt;I'm trying to write a python script to satisfy below requirement:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. It should be able to find out a list of volumes containing non-qtree data, with an exception of filenames starting with a 'dot'. E.g. It won't list a volume that has only&amp;nbsp;one file named '.bash_profile' as non-qtree data.&lt;/P&gt;&lt;P&gt;2. The script can be run on a number of filers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm really stuck at listing non-qtree data with the exception above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help will be highly appreciated. I'm using python, but any other language is fine as well.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 20:02:35 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Script-to-find-volumes-containing-non-qtree-data-in-multiple-filers-running/m-p/121102#M1998</guid>
      <dc:creator>ams73</dc:creator>
      <dc:date>2025-06-04T20:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: Script to find volumes containing non-qtree data in multiple filers running ontap7</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Script-to-find-volumes-containing-non-qtree-data-in-multiple-filers-running/m-p/121114#M1999</link>
      <description>&lt;P&gt;Not sure to understand what you are trying to check.&lt;/P&gt;&lt;P&gt;Volumes are qtree as well, so files directly on / are potentially in qtrees.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For me, non-qtree data are more: &amp;nbsp;"directories created as standard (mkdir in unix for example)" but relayed to directories not files.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here an example what I would do:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;netapp.NaServer &lt;SPAN&gt;import &lt;/SPAN&gt;*&lt;BR /&gt;&lt;BR /&gt;s = NaServer(&lt;SPAN&gt;"filer"&lt;/SPAN&gt;, &lt;SPAN&gt;1&lt;/SPAN&gt;, &lt;SPAN&gt;21&lt;/SPAN&gt;)&lt;BR /&gt;s.set_server_type(&lt;SPAN&gt;"FILER"&lt;/SPAN&gt;)&lt;BR /&gt;s.set_transport_type(&lt;SPAN&gt;"HTTPS"&lt;/SPAN&gt;)&lt;BR /&gt;s.set_port(&lt;SPAN&gt;443&lt;/SPAN&gt;)&lt;BR /&gt;s.set_style(&lt;SPAN&gt;"LOGIN"&lt;/SPAN&gt;)&lt;BR /&gt;s.set_admin_user(&lt;SPAN&gt;"root"&lt;/SPAN&gt;, &lt;SPAN&gt;"pwd"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;apivol = NaElement(&lt;SPAN&gt;"volume-list-info"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;outputvol = s.invoke_elem(apivol)&lt;BR /&gt;&lt;BR /&gt;volumes = outputvol.child_get(&lt;SPAN&gt;"volumes"&lt;/SPAN&gt;)&lt;BR /&gt;resultsvol = volumes.children_get()&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;## loop through volumes&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;for &lt;/SPAN&gt;resultvol &lt;SPAN&gt;in &lt;/SPAN&gt;resultsvol:&lt;BR /&gt;    volname = resultvol.child_get_string(&lt;SPAN&gt;"name"&lt;/SPAN&gt;)&lt;BR /&gt;    apiqtree = NaElement(&lt;SPAN&gt;"qtree-list"&lt;/SPAN&gt;)&lt;BR /&gt;    apiqtree.child_add_string(&lt;SPAN&gt;"volume"&lt;/SPAN&gt;, volname)&lt;BR /&gt;    outputqtree = s.invoke_elem(apiqtree)&lt;BR /&gt;    qtrees = outputqtree.child_get(&lt;SPAN&gt;"qtrees"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;    qtreestree = qtrees.children_get()&lt;BR /&gt;    qtreesarray = []&lt;BR /&gt;    &lt;SPAN&gt;# Loop througn qtrees&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;for &lt;/SPAN&gt;resultqtree &lt;SPAN&gt;in &lt;/SPAN&gt;qtreestree:&lt;BR /&gt;        qtreename = resultqtree.child_get_string(&lt;SPAN&gt;"qtree"&lt;/SPAN&gt;)&lt;BR /&gt;        qtreesarray.append(qtreename)&lt;BR /&gt;&lt;BR /&gt;    apidir = NaElement(&lt;SPAN&gt;"file-list-directory-iter-start"&lt;/SPAN&gt;)&lt;BR /&gt;    apidir.child_add_string(&lt;SPAN&gt;"path"&lt;/SPAN&gt;, &lt;SPAN&gt;'/vol/' &lt;/SPAN&gt;+ volname)&lt;BR /&gt;    outputdir = s.invoke_elem(apidir)&lt;BR /&gt;    tagdir = outputdir.child_get_string(&lt;SPAN&gt;"tag"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;    apidir = NaElement(&lt;SPAN&gt;"file-list-directory-iter-next"&lt;/SPAN&gt;)&lt;BR /&gt;    apidir.child_add_string(&lt;SPAN&gt;"tag"&lt;/SPAN&gt;, tagdir)&lt;BR /&gt;    apidir.child_add_string(&lt;SPAN&gt;"maximum"&lt;/SPAN&gt;, &lt;SPAN&gt;'200'&lt;/SPAN&gt;)&lt;BR /&gt;    outputdir = s.invoke_elem(apidir)&lt;BR /&gt;    dirs = outputdir.child_get(&lt;SPAN&gt;"files"&lt;/SPAN&gt;)&lt;BR /&gt;    dirstree = dirs.children_get()&lt;BR /&gt;    &lt;SPAN&gt;for &lt;/SPAN&gt;resultdir &lt;SPAN&gt;in &lt;/SPAN&gt;dirstree:&lt;BR /&gt;        filetype = resultdir.child_get_string(&lt;SPAN&gt;"file-type"&lt;/SPAN&gt;)&lt;BR /&gt;        filename = resultdir.child_get_string(&lt;SPAN&gt;"name"&lt;/SPAN&gt;)&lt;BR /&gt;        &lt;SPAN&gt;if &lt;/SPAN&gt;filetype == &lt;SPAN&gt;'directory'&lt;/SPAN&gt;:&lt;BR /&gt;            &lt;SPAN&gt;if &lt;/SPAN&gt;filename &lt;SPAN&gt;in &lt;/SPAN&gt;qtreesarray:&lt;BR /&gt;                &lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;'qtree:' &lt;/SPAN&gt;+ filename)&lt;BR /&gt;            &lt;SPAN&gt;else&lt;/SPAN&gt;:&lt;BR /&gt;                &lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;'nonqtree:' &lt;/SPAN&gt;+ filename)&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2016 15:12:16 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Script-to-find-volumes-containing-non-qtree-data-in-multiple-filers-running/m-p/121114#M1999</guid>
      <dc:creator>francoisbnc</dc:creator>
      <dc:date>2016-07-08T15:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: Script to find volumes containing non-qtree data in multiple filers running ontap7</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Script-to-find-volumes-containing-non-qtree-data-in-multiple-filers-running/m-p/121150#M2003</link>
      <description>&lt;P&gt;Thank you so much for your help and it almost meets the requirement. Just below 2 items needs to be sorted out:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. The script should consider anything in the volume but not in a qtree, as non-qtree data:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;E.g. in "/vol/volume1/qtree1" anything which is in "volume1" but not in "qtree1" should be listed.&lt;/LI&gt;&lt;LI&gt;It could be a directory or a file.&lt;/LI&gt;&lt;LI&gt;If the volume has 2 qtrees "qtree1" and "qtree2" then both should be excluded from the report.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. The current script shows every qtree twice, once as 'non-qtree' and then again as 'qtree'. it shows like below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-----------------&lt;/P&gt;&lt;P&gt;nonqtree:.&lt;BR /&gt;nonqtree:..&lt;BR /&gt;nonqtree:qtree1&lt;BR /&gt;nonqtree:.&lt;BR /&gt;nonqtree:..&lt;BR /&gt;qtree:qtree1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;nonqtree:.&lt;BR /&gt;nonqtree:..&lt;BR /&gt;nonqtree:qtree2&lt;BR /&gt;nonqtree:.&lt;BR /&gt;nonqtree:..&lt;BR /&gt;qtree:qtree2&lt;/P&gt;&lt;P&gt;-----------------&lt;/P&gt;&lt;P&gt;Ideally it should show the qtree/directory only once - either as 'qtree' or 'non-qtree'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. At present I&amp;nbsp;can get&amp;nbsp;this by comparing the outputs of "qtree status &amp;lt;volume name&amp;gt;" and "priv set advanced; ls/vol/&amp;lt;volume name&amp;gt;". But&amp;nbsp;I feel like&amp;nbsp;that's a crude way and can be done better by leveraging the APIs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really appreciate your help and patience to put the script together.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2016 05:46:51 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Script-to-find-volumes-containing-non-qtree-data-in-multiple-filers-running/m-p/121150#M2003</guid>
      <dc:creator>ams73</dc:creator>
      <dc:date>2016-07-14T05:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: Script to find volumes containing non-qtree data in multiple filers running ontap7</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Script-to-find-volumes-containing-non-qtree-data-in-multiple-filers-running/m-p/121445#M2020</link>
      <description>&lt;P&gt;Looks like I'm not getting the desired output because it considers both, 'qtree' and 'directory' as "directory". I ran below script on a volume containing a 'qtree', a 'directory' and a 'file', the output had "file-type=directory" for both 'qtree' and 'directory'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;api = NaElement("file-list-directory-iter-start")&lt;BR /&gt;api.child_add_string("path","/vol/volume_name")&lt;/P&gt;&lt;P&gt;xo = s.invoke_elem(api)&lt;BR /&gt;if (xo.results_status() == "failed") :&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print ("Error:\n")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print (xo.sprintf())&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.exit (1)&lt;/P&gt;&lt;P&gt;print ("Received:\n")&lt;BR /&gt;print (xo.sprintf())&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So is there any other way to differentiate a 'directory' from a 'qtree'?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 11:45:58 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Script-to-find-volumes-containing-non-qtree-data-in-multiple-filers-running/m-p/121445#M2020</guid>
      <dc:creator>ams73</dc:creator>
      <dc:date>2016-07-19T11:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: Script to find volumes containing non-qtree data in multiple filers running ontap7</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Script-to-find-volumes-containing-non-qtree-data-in-multiple-filers-running/m-p/121448#M2021</link>
      <description>&lt;P&gt;Directories and qtree are same when you invoke "&lt;SPAN&gt;file-list-directory-iter", &amp;nbsp;so use "qtree-list" to exclude qtree of this first list.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;From there you can deduct directories only.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;François&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 12:32:51 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Script-to-find-volumes-containing-non-qtree-data-in-multiple-filers-running/m-p/121448#M2021</guid>
      <dc:creator>francoisbnc</dc:creator>
      <dc:date>2016-07-19T12:32:51Z</dc:date>
    </item>
  </channel>
</rss>

