<?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: PCL REST API : How to create cifs share in ONTAP Rest API Discussions</title>
    <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/PCL-REST-API-How-to-create-cifs-share/m-p/430333#M264</link>
    <description>&lt;P&gt;The docs are a little misleading here. Newer versions of the docs will address this issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since svm is an object, you can't access its fields before it is created. There are two ways you could change your code. Here's the simplest one:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;resource=CifsShare()
resource.name="vol1"
resource.path="/vol1"
resource.svm={"uuid": "47604f0f-59a4-11ec-be69-00a0985c5d5b"}
resource.post(hydrate=True)&lt;/LI-CODE&gt;&lt;P&gt;Only slightly more complicated, this will also work:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;from netapp_ontap.resources import Svm

resource=CifsShare()
resource.name="vol1"
resource.path="/vol1"
resource.svm=Svm(uuid="47604f0f-59a4-11ec-be69-00a0985c5d5b")
resource.post(hydrate=True)&lt;/LI-CODE&gt;&lt;P&gt;In the second example, I imported the Svm object so that I can construct it. In the first, I just used the dictionary representation so no imports needed. Both will send equal requests and behave the same afterwards.&lt;/P&gt;</description>
    <pubDate>Tue, 21 Dec 2021 12:45:35 GMT</pubDate>
    <dc:creator>RobertBlackhart</dc:creator>
    <dc:date>2021-12-21T12:45:35Z</dc:date>
    <item>
      <title>PCL REST API : How to create cifs share</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/PCL-REST-API-How-to-create-cifs-share/m-p/430326#M261</link>
      <description>&lt;P&gt;I redad&amp;nbsp;&lt;A href="https://library.netapp.com/ecmdocs/ECMLP2874673/html/resources/cifs_share.html" target="_blank" rel="noopener"&gt;https://library.netapp.com/ecmdocs/ECMLP2874673/html/resources/cifs_share.html&lt;/A&gt;&amp;nbsp;and according to sample, I tired to creae cifs sahre as bellow:&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;resource=CifsShare()&lt;BR /&gt;resource.name="vol1"&lt;BR /&gt;resource.path="/vol1"&lt;BR /&gt;resource.svm.uuid="47604f0f-59a4-11ec-be69-00a0985c5d5b"&lt;BR /&gt;resource.post(hydrate=True)&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;AttributeError&lt;/SPAN&gt;: The 'svm' field has not been set on the CifsShare. Try refreshing the object by calling get().&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I treied with "key":"values" but failed.. How is correct way setting "svm.uuid"?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 10:06:55 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/PCL-REST-API-How-to-create-cifs-share/m-p/430326#M261</guid>
      <dc:creator>ogatat</dc:creator>
      <dc:date>2025-06-04T10:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: PCL REST API : How to create cifs share</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/PCL-REST-API-How-to-create-cifs-share/m-p/430330#M262</link>
      <description>&lt;P&gt;Are you using all the parameters as in the example?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you set&amp;nbsp;&lt;SPAN&gt;resource.svm.name?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 11:59:58 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/PCL-REST-API-How-to-create-cifs-share/m-p/430330#M262</guid>
      <dc:creator>pedro_rocha</dc:creator>
      <dc:date>2021-12-21T11:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: PCL REST API : How to create cifs share</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/PCL-REST-API-How-to-create-cifs-share/m-p/430331#M263</link>
      <description>&lt;P&gt;According to exmaple, following is the all parameters but the result is the same as before.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;from netapp_ontap import HostConnection&lt;BR /&gt;from netapp_ontap.resources import Svm, CifsShare&lt;BR /&gt;with HostConnection("10.x.x.x", username="admin", password="xxxxxxx", verify=False):&lt;BR /&gt;resource=CifsShare()&lt;BR /&gt;resource.name="vol1"&lt;BR /&gt;resource.path="/vol1"&lt;BR /&gt;resource.svm.uuid="47604f0f-59a4-11ec-be69-00a0985c5d5b"&lt;BR /&gt;resource.svm.uuid="demo"&lt;BR /&gt;resource.access_based_enumeration = False&lt;BR /&gt;resource.acls = [&lt;BR /&gt;{"permission": "no_access", "type": "unix_user", "user_or_group": "root"}&lt;BR /&gt;]&lt;BR /&gt;resource.change_notify = True&lt;BR /&gt;resource.comment = "vol1"&lt;BR /&gt;resource.encryption = False&lt;BR /&gt;resource.home_directory = False&lt;BR /&gt;resource.oplocks = True&lt;BR /&gt;resource.unix_symlink = "local"&lt;BR /&gt;resource.post(hydrate=True)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 12:19:45 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/PCL-REST-API-How-to-create-cifs-share/m-p/430331#M263</guid>
      <dc:creator>ogatat</dc:creator>
      <dc:date>2021-12-21T12:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: PCL REST API : How to create cifs share</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/PCL-REST-API-How-to-create-cifs-share/m-p/430333#M264</link>
      <description>&lt;P&gt;The docs are a little misleading here. Newer versions of the docs will address this issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since svm is an object, you can't access its fields before it is created. There are two ways you could change your code. Here's the simplest one:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;resource=CifsShare()
resource.name="vol1"
resource.path="/vol1"
resource.svm={"uuid": "47604f0f-59a4-11ec-be69-00a0985c5d5b"}
resource.post(hydrate=True)&lt;/LI-CODE&gt;&lt;P&gt;Only slightly more complicated, this will also work:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;from netapp_ontap.resources import Svm

resource=CifsShare()
resource.name="vol1"
resource.path="/vol1"
resource.svm=Svm(uuid="47604f0f-59a4-11ec-be69-00a0985c5d5b")
resource.post(hydrate=True)&lt;/LI-CODE&gt;&lt;P&gt;In the second example, I imported the Svm object so that I can construct it. In the first, I just used the dictionary representation so no imports needed. Both will send equal requests and behave the same afterwards.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 12:45:35 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/PCL-REST-API-How-to-create-cifs-share/m-p/430333#M264</guid>
      <dc:creator>RobertBlackhart</dc:creator>
      <dc:date>2021-12-21T12:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: PCL REST API : How to create cifs share</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/PCL-REST-API-How-to-create-cifs-share/m-p/430335#M265</link>
      <description>&lt;P&gt;Both codes successfullly worked with "name" though documentation says "or" as bellow:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;svm.uuid&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;or&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;svm.name&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;- Existing SVM in which to create the CIFS share.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#failed: uuid only
resource.svm={"uuid": "47604f0f-59a4-11ec-be69-00a0985c5d5b"}

#Success: name only
resource.svm={"name": "demo"}

#Success: name and uuid
resource.svm={"uuid": "47604f0f-59a4-11ec-be69-00a0985c5d5b"}
resource.svm={"name": "demo")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 13:13:57 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/PCL-REST-API-How-to-create-cifs-share/m-p/430335#M265</guid>
      <dc:creator>ogatat</dc:creator>
      <dc:date>2021-12-21T13:13:57Z</dc:date>
    </item>
  </channel>
</rss>

