<?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: syntax for Qtree.find() with multiple arguments in ONTAP Rest API Discussions</title>
    <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/syntax-for-Qtree-find-with-multiple-arguments/m-p/157036#M63</link>
    <description>&lt;P&gt;Brilliant - thank you - I don't think I ever would have come up with that syntax!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--rdp&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jun 2020 17:10:05 GMT</pubDate>
    <dc:creator>richard_payne</dc:creator>
    <dc:date>2020-06-16T17:10:05Z</dc:date>
    <item>
      <title>syntax for Qtree.find() with multiple arguments</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/syntax-for-Qtree-find-with-multiple-arguments/m-p/154976#M38</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Not sure if this should be in here, or in the Python section?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've been doing some work with the Python bindings for the rest API and so far so good, until I came up against Qtrees. In most cases, when looking for object I can do a .find(uuid=&amp;lt;uuid&amp;gt;). Qtrees don't have a uuid, so to query we need (for example) the volume uuid and the qtree id within the volume. Now the REST syntax for that is easy, but what does the python syntax to 'find' look like?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've tried the obvious things - find (volume.uuid=&amp;lt;uuid&amp;gt;,id=&amp;lt;id&amp;gt;) but python doesn't like that...&lt;/P&gt;
&lt;P&gt;I've tried creating Qtree/Volume objects and passing that in, no go....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What am I missing?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thx,&lt;/P&gt;
&lt;P&gt;--rdp&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 11:15:58 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/syntax-for-Qtree-find-with-multiple-arguments/m-p/154976#M38</guid>
      <dc:creator>richard_payne</dc:creator>
      <dc:date>2025-06-04T11:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: syntax for Qtree.find() with multiple arguments</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/syntax-for-Qtree-find-with-multiple-arguments/m-p/157035#M62</link>
      <description>&lt;P&gt;Hi Richard,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry this question went unanswered here for so long. Python (as a language) doesn't allow identifiers to contain the "." character. So here's how you can get around that limitation when using keyword arguments (which turn into query parameters to the API) with netapp_ontap functions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;qtree = Qtree.find(**{"id": "qtree_id", "volume.uuid": "volume_uuid"})&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That is, you can use the ** syntax to expand a dictionary into a list of key/value pairs. In this example, I didn't have to put id in the dictionary. I could have passed it as a normal keyword argument, but I did so for the sake of illustrating how this works with multiple values.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 16:07:53 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/syntax-for-Qtree-find-with-multiple-arguments/m-p/157035#M62</guid>
      <dc:creator>RobertBlackhart</dc:creator>
      <dc:date>2020-06-16T16:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: syntax for Qtree.find() with multiple arguments</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/syntax-for-Qtree-find-with-multiple-arguments/m-p/157036#M63</link>
      <description>&lt;P&gt;Brilliant - thank you - I don't think I ever would have come up with that syntax!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--rdp&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 17:10:05 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/syntax-for-Qtree-find-with-multiple-arguments/m-p/157036#M63</guid>
      <dc:creator>richard_payne</dc:creator>
      <dc:date>2020-06-16T17:10:05Z</dc:date>
    </item>
  </channel>
</rss>

