<?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: FileInfo Received : list directory / more than one record in ONTAP Rest API Discussions</title>
    <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/FileInfo-Received-list-directory-more-than-one-record/m-p/441008#M410</link>
    <description>&lt;P&gt;Hi, sorry for the trouble. This is a bug in the get() function. I filed a bug (#1527088) to solve this issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the meantime, you can use get_collection() as a work around. I believe you had an issue with get_collection because you sent in `mypath` a keyword argument. If you remove 'path=' from the argument and just send it in as a positional argument it should work. Please try something like this:&lt;/P&gt;&lt;PRE&gt;import logging&lt;BR /&gt;from netapp_ontap import HostConnection, NetAppRestError, config, utils&lt;BR /&gt;from netapp_ontap.resources import Volume,FileInfo&lt;BR /&gt;logging.basicConfig(level=logging.DEBUG)&lt;BR /&gt;utils.DEBUG=1&lt;BR /&gt;config.CONNECTION = HostConnection('XXXXX', 'xxxx', 'xxx',verify=False)&lt;BR /&gt;&lt;BR /&gt;volume = Volume.find(**{'svm.name': "VSERVER", 'name': "volume_name"})&lt;BR /&gt;mypath="dir1/dir2/dir3"&lt;BR /&gt;files = FileInfo.get_collection(volume.uuid, mypath)&lt;BR /&gt;for file in files:&lt;BR /&gt;    print(file)&lt;/PRE&gt;&lt;DIV&gt;&lt;DIV&gt;Please let me know if you have any issues with that.&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Jan 2023 15:27:52 GMT</pubDate>
    <dc:creator>ddegraaf</dc:creator>
    <dc:date>2023-01-18T15:27:52Z</dc:date>
    <item>
      <title>FileInfo Received : list directory / more than one record</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/FileInfo-Received-list-directory-more-than-one-record/m-p/440962#M409</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to list files in a directory. It's ok when i use curl but i have error when using python netapp-ontap.&lt;/P&gt;&lt;P&gt;I'm using the snippet in the documentation, i get this error with&amp;nbsp; netapp-ontap 9.12.10rc1, 9.11.0, 9.10.1.0. :&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#FF0000"&gt; raise NetAppRestError(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;netapp_ontap.error.NetAppRestError: Received more than one record in the response FileInfo.&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;Code :&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;import logging&lt;BR /&gt;from netapp_ontap import HostConnection, NetAppRestError, config, utils&lt;BR /&gt;from netapp_ontap.resources import Volume,FileInfo&lt;BR /&gt;logging.basicConfig(level=logging.DEBUG)&lt;BR /&gt;utils.DEBUG=1&lt;BR /&gt;config.CONNECTION = HostConnection('XXXXX', 'xxxx', 'xxx',verify=False)&lt;BR /&gt;&lt;BR /&gt;volume = Volume.find(**{'svm.name': "VSERVER", 'name': "volume_name"})&lt;BR /&gt;mypath="dir1/dir2/dir3"&lt;BR /&gt;res=FileInfo(volume.uuid, path=mypath)&lt;BR /&gt;res.get()&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried to use get_collection but the called url is not good :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;GET /api/storage/volumes/0c692b41-yyyyy/files&lt;FONT color="#FF0000"&gt;?&lt;/FONT&gt;dir1%2Fdir2%Fdir3 instead of&amp;nbsp;&lt;/P&gt;&lt;P&gt;GET /api/storage/volumes/0c692b41-yyyyy/files/dir1%2Fdir2%Fdir3&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 09:54:11 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/FileInfo-Received-list-directory-more-than-one-record/m-p/440962#M409</guid>
      <dc:creator>Oc77</dc:creator>
      <dc:date>2025-06-04T09:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: FileInfo Received : list directory / more than one record</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/FileInfo-Received-list-directory-more-than-one-record/m-p/441008#M410</link>
      <description>&lt;P&gt;Hi, sorry for the trouble. This is a bug in the get() function. I filed a bug (#1527088) to solve this issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the meantime, you can use get_collection() as a work around. I believe you had an issue with get_collection because you sent in `mypath` a keyword argument. If you remove 'path=' from the argument and just send it in as a positional argument it should work. Please try something like this:&lt;/P&gt;&lt;PRE&gt;import logging&lt;BR /&gt;from netapp_ontap import HostConnection, NetAppRestError, config, utils&lt;BR /&gt;from netapp_ontap.resources import Volume,FileInfo&lt;BR /&gt;logging.basicConfig(level=logging.DEBUG)&lt;BR /&gt;utils.DEBUG=1&lt;BR /&gt;config.CONNECTION = HostConnection('XXXXX', 'xxxx', 'xxx',verify=False)&lt;BR /&gt;&lt;BR /&gt;volume = Volume.find(**{'svm.name': "VSERVER", 'name': "volume_name"})&lt;BR /&gt;mypath="dir1/dir2/dir3"&lt;BR /&gt;files = FileInfo.get_collection(volume.uuid, mypath)&lt;BR /&gt;for file in files:&lt;BR /&gt;    print(file)&lt;/PRE&gt;&lt;DIV&gt;&lt;DIV&gt;Please let me know if you have any issues with that.&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 15:27:52 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/FileInfo-Received-list-directory-more-than-one-record/m-p/441008#M410</guid>
      <dc:creator>ddegraaf</dc:creator>
      <dc:date>2023-01-18T15:27:52Z</dc:date>
    </item>
    <item>
      <title>Re: FileInfo Received : list directory / more than one record</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/FileInfo-Received-list-directory-more-than-one-record/m-p/441009#M411</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Your code is working. Thanks for your help !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 15:35:42 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/FileInfo-Received-list-directory-more-than-one-record/m-p/441009#M411</guid>
      <dc:creator>Oc77</dc:creator>
      <dc:date>2023-01-18T15:35:42Z</dc:date>
    </item>
  </channel>
</rss>

