<?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 ONTAP 9.6 REST API Python client library - Now available !!! in ONTAP Rest API Discussions</title>
    <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/ONTAP-9-6-REST-API-Python-client-library-Now-available/m-p/149753#M5</link>
    <description>&lt;P&gt;&lt;SPAN&gt;&lt;A style="background-color: #ffffff; font-family: 'Source Sans Pro', Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif;" href="https://pypi.org/project/netapp-ontap/" target="_blank" rel="noopener"&gt;Download ONTAP 9.6 REST API Python Client Library&lt;/A&gt;&amp;nbsp;from pypi.org and access&amp;nbsp;&lt;A style="background-color: #ffffff; font-family: 'Source Sans Pro', Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif;" href="https://library.netapp.com/ecmdocs/ECMLP2858435/html/index.html" target="_blank" rel="noopener"&gt;Python Client Library Documentation&lt;/A&gt;&amp;nbsp;from the NetApp support site.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The Python client library is a package you can use when writing scripts to access the ONTAP REST API. It provides support for several underlying services, including connection management, asynchronous request processing, and exception handling. By using the Python client library, you can quickly develop robust code to support the automation of your ONTAP deployments.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jun 2025 12:22:47 GMT</pubDate>
    <dc:creator>yuvaraju</dc:creator>
    <dc:date>2025-06-04T12:22:47Z</dc:date>
    <item>
      <title>ONTAP 9.6 REST API Python client library - Now available !!!</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/ONTAP-9-6-REST-API-Python-client-library-Now-available/m-p/149753#M5</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;A style="background-color: #ffffff; font-family: 'Source Sans Pro', Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif;" href="https://pypi.org/project/netapp-ontap/" target="_blank" rel="noopener"&gt;Download ONTAP 9.6 REST API Python Client Library&lt;/A&gt;&amp;nbsp;from pypi.org and access&amp;nbsp;&lt;A style="background-color: #ffffff; font-family: 'Source Sans Pro', Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif;" href="https://library.netapp.com/ecmdocs/ECMLP2858435/html/index.html" target="_blank" rel="noopener"&gt;Python Client Library Documentation&lt;/A&gt;&amp;nbsp;from the NetApp support site.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The Python client library is a package you can use when writing scripts to access the ONTAP REST API. It provides support for several underlying services, including connection management, asynchronous request processing, and exception handling. By using the Python client library, you can quickly develop robust code to support the automation of your ONTAP deployments.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 12:22:47 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/ONTAP-9-6-REST-API-Python-client-library-Now-available/m-p/149753#M5</guid>
      <dc:creator>yuvaraju</dc:creator>
      <dc:date>2025-06-04T12:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: ONTAP 9.6 REST API Python client library - Now available !!!</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/ONTAP-9-6-REST-API-Python-client-library-Now-available/m-p/149955#M10</link>
      <description>&lt;PRE&gt;&lt;CODE class="python"&gt;from netapp_ontap.resources import Volume

# Example 1 - keyword arguments
volume = Volume(name='vol1', svm={'name': 'vs1'}, aggregates=[{'name': 'aggr1'}])
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If somebody can write a Python program code, and to achieve what as said above, that'd be very helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2019 20:42:29 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/ONTAP-9-6-REST-API-Python-client-library-Now-available/m-p/149955#M10</guid>
      <dc:creator>netappmagic</dc:creator>
      <dc:date>2019-07-31T20:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: ONTAP 9.6 REST API Python client library - Now available !!!</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/ONTAP-9-6-REST-API-Python-client-library-Now-available/m-p/152063#M20</link>
      <description>&lt;P class="p1"&gt;Hi All,&lt;/P&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;I tried to acomplish simple task use the Python package, the code as follow.&lt;/P&gt;
&lt;P class="p1"&gt;Intend to put volume offline, and use volume uuid as a query. I run the program, it did not error, but, it does nothing.&lt;/P&gt;
&lt;P class="p1"&gt;The volume still online. Code and output as follow.&lt;/P&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;volume.patch(&lt;/P&gt;
&lt;P class="p1"&gt;{"state":"offline"},&lt;/P&gt;
&lt;P class="p1"&gt;uuid = 'b2c020e5-f9c7-11e9-ac22-005056b76245'&lt;/P&gt;
&lt;P class="p1"&gt;)&lt;/P&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;--------------------------------------------------------------------------------------------------&lt;/P&gt;
&lt;P class="p1"&gt;import netapp_ontap&lt;/P&gt;
&lt;P class="p1"&gt;from netapp_ontap import config&lt;/P&gt;
&lt;P class="p1"&gt;from netapp_ontap.host_connection import HostConnection&lt;/P&gt;
&lt;P class="p1"&gt;from netapp_ontap.resources import Volume, Snapshot,Svm&lt;/P&gt;
&lt;P class="p1"&gt;import urllib3&lt;/P&gt;
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)&lt;/P&gt;
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;config.CONNECTION = HostConnection('cluster2.demo.netapp.com',username="admin",password="Netapp1!",verify=False)&lt;/P&gt;
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;volume = Volume.find(name='volm2_1')&lt;/P&gt;
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;print (volume.to_dict())&lt;/P&gt;
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;volume.patch(&lt;/P&gt;
&lt;P class="p1"&gt;{"state":"offline"},&lt;/P&gt;
&lt;P class="p1"&gt;uuid = 'b2c020e5-f9c7-11e9-ac22-005056b76245'&lt;/P&gt;
&lt;P class="p1"&gt;)&lt;/P&gt;
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;[root@rhel2 ~]# python3.7 volpatch.py&lt;/P&gt;
&lt;P class="p1"&gt;{'tiering': {'policy': 'none'}, 'type': 'rw', 'space': {'used': 851968, 'available': 19070976, 'size': 20971520}, 'clone': {'is_flexclone': False}, 'metric': {'throughput': {'other': 0, 'read': 0, 'total': 0, 'write': 0}, 'duration': 'PT15S', 'iops': {'other': 0, 'read': 0, 'total': 0, 'write': 0}, 'latency': {'other': 0, 'read': 0, 'total': 0, 'write': 0}, 'timestamp': '2019-10-30T01:51:45+00:00', 'status': 'ok'}, 'size': 20971520, 'aggregates': [{'uuid': 'e329b91b-0633-4186-8c8d-aa4c7191da16', 'name': 'aggr1_cluster2_01'}], 'snapshot_policy': {'name': 'default'}, 'uuid': 'b2c020e5-f9c7-11e9-ac22-005056b76245', 'state': 'online', 'comment': '', 'svm': {'uuid': '503ac2b8-acfe-11e9-8271-005056b03109', 'name': 'svm21'}, 'name': 'volm2_1', 'language': 'c.utf_8', 'nas': {'export_policy': {'name': 'default'}}, 'style': 'flexvol', 'create_time': '2019-10-28T21:12:50+00:00'}&lt;/P&gt;
&lt;P class="p1"&gt;[root@rhel2 ~]#&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 02:06:54 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/ONTAP-9-6-REST-API-Python-client-library-Now-available/m-p/152063#M20</guid>
      <dc:creator>mhe</dc:creator>
      <dc:date>2019-10-30T02:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: ONTAP 9.6 REST API Python client library - Now available !!!</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/ONTAP-9-6-REST-API-Python-client-library-Now-available/m-p/152069#M21</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The patch() method, when used on an object instance, computes the diff of the object's properties since it was last fetched from the server (with a GET call). It then sends that diff as the body of the patch request. Any name/value pairs passed to the patch() method call itself are treated as query parameters I suspect that your code example should look like this instead:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;import netapp_ontap&lt;/P&gt;
&lt;P&gt;from netapp_ontap import config&lt;/P&gt;
&lt;P&gt;from netapp_ontap.host_connection import HostConnection&lt;/P&gt;
&lt;P&gt;from netapp_ontap.resources import Volume, Snapshot,Svm&lt;/P&gt;
&lt;P&gt;import urllib3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;# set up a connection to the server&lt;/P&gt;
&lt;P&gt;urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)&lt;/P&gt;
&lt;P&gt;config.CONNECTION = HostConnection('cluster2.demo.netapp.com',username="admin",password="Netapp1!",verify=False)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;# retrieve the volume object from the server by name&lt;/P&gt;
&lt;P&gt;volume = Volume.find(name='volm2_1')&lt;/P&gt;
&lt;P&gt;print(volume)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;# set the volume's state to offline&lt;/P&gt;
&lt;P&gt;volume.state = "offline"&lt;/P&gt;
&lt;P&gt;volume.patch()&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's another example of using patch from the online documentation. It uses an Svm object, but the concept is the same: &lt;A href="https://library.netapp.com/ecmdocs/ECMLP2858435/html/resources/index.html#patch" target="_blank"&gt;https://library.netapp.com/ecmdocs/ECMLP2858435/html/resources/index.html#patch&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 12:32:43 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/ONTAP-9-6-REST-API-Python-client-library-Now-available/m-p/152069#M21</guid>
      <dc:creator>yuvaraju</dc:creator>
      <dc:date>2019-10-30T12:32:43Z</dc:date>
    </item>
  </channel>
</rss>

