<?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: Getting 400 error code while trying to create volume using REST APIs in ONTAP Rest API Discussions</title>
    <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Getting-400-error-code-while-trying-to-create-volume-using-REST-APIs/m-p/158896#M114</link>
    <description>&lt;P&gt;Hi Srini,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to specify the aggregates.name field as a list. So, the body would look like:&lt;/P&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;data = {&lt;/SPAN&gt;&lt;SPAN&gt;"svm.name": svmname,&amp;nbsp; "name": volname,&amp;nbsp; "aggregates.name": [aggrname]}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Also, I would recommend taking a look at the netapp_ontap module. It is really nice and easy to use for scripting. You can find all the relevant links here:&amp;nbsp;&lt;A href="https://pypi.org/project/netapp-ontap/" target="_blank" rel="noopener"&gt;https://pypi.org/project/netapp-ontap/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;-Twesha&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 23 Aug 2020 16:26:28 GMT</pubDate>
    <dc:creator>Twesha</dc:creator>
    <dc:date>2020-08-23T16:26:28Z</dc:date>
    <item>
      <title>Getting 400 error code while trying to create volume using REST APIs</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Getting-400-error-code-while-trying-to-create-volume-using-REST-APIs/m-p/158894#M113</link>
      <description>&lt;P&gt;I am trying to create volume&amp;nbsp; using REST APIs however its failing with 400 error code.&lt;/P&gt;
&lt;P&gt;Here is the syntax I have used&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data = {svm.name: svmname,&amp;nbsp; name: volname,&amp;nbsp; aggregates.name: aggrname}&lt;BR /&gt;newHeaders = {'accept': 'application/json', 'Content-type': 'application/json'}&lt;BR /&gt;response1 = requests.post("https://&amp;lt;clus-lif&amp;gt;/api/storage/volumes",&amp;nbsp; json=data,&amp;nbsp; auth=('xxxx', 'xxxx'), verify=False, headers=newHeaders)&lt;BR /&gt;print(response1.status_code)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;svmname,aggrname,volname are parameters passed through script.&lt;/P&gt;
&lt;P&gt;All the mandatory values are passed for volume creation not sure why its giving 400 error code.&lt;/P&gt;
&lt;P&gt;Could you advise if any additional values or any modification needed to this code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;-Srini&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 10:56:30 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Getting-400-error-code-while-trying-to-create-volume-using-REST-APIs/m-p/158894#M113</guid>
      <dc:creator>Juluri</dc:creator>
      <dc:date>2025-06-04T10:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: Getting 400 error code while trying to create volume using REST APIs</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Getting-400-error-code-while-trying-to-create-volume-using-REST-APIs/m-p/158896#M114</link>
      <description>&lt;P&gt;Hi Srini,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to specify the aggregates.name field as a list. So, the body would look like:&lt;/P&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;data = {&lt;/SPAN&gt;&lt;SPAN&gt;"svm.name": svmname,&amp;nbsp; "name": volname,&amp;nbsp; "aggregates.name": [aggrname]}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Also, I would recommend taking a look at the netapp_ontap module. It is really nice and easy to use for scripting. You can find all the relevant links here:&amp;nbsp;&lt;A href="https://pypi.org/project/netapp-ontap/" target="_blank" rel="noopener"&gt;https://pypi.org/project/netapp-ontap/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;-Twesha&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Aug 2020 16:26:28 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Getting-400-error-code-while-trying-to-create-volume-using-REST-APIs/m-p/158896#M114</guid>
      <dc:creator>Twesha</dc:creator>
      <dc:date>2020-08-23T16:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: Getting 400 error code while trying to create volume using REST APIs</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Getting-400-error-code-while-trying-to-create-volume-using-REST-APIs/m-p/158912#M115</link>
      <description>&lt;P&gt;Hi Twesha,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much for correcting the usage syntax, it worked fine&lt;/P&gt;
&lt;P&gt;Also thanks for sharing info on netapp ontap package.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Aug 2020 12:16:58 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Getting-400-error-code-while-trying-to-create-volume-using-REST-APIs/m-p/158912#M115</guid>
      <dc:creator>Juluri</dc:creator>
      <dc:date>2020-08-24T12:16:58Z</dc:date>
    </item>
  </channel>
</rss>

