<?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: invalid properties error when creating cifs share via manageability sdk in Software Development Kit (SDK) and API Discussions</title>
    <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/invalid-properties-error-when-creating-cifs-share-via-manageability-sdk/m-p/124094#M2120</link>
    <description>&lt;P&gt;The cifs-share-properties property is meant to be an array of strings. &amp;nbsp;What is the variable "shareproperties"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;</description>
    <pubDate>Wed, 12 Oct 2016 20:57:13 GMT</pubDate>
    <dc:creator>asulliva</dc:creator>
    <dc:date>2016-10-12T20:57:13Z</dc:date>
    <item>
      <title>invalid properties error when creating cifs share via manageability sdk</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/invalid-properties-error-when-creating-cifs-share-via-manageability-sdk/m-p/124077#M2119</link>
      <description>&lt;P&gt;We recently upgraded from ontap 8.2.2p2 to 8.3.2p3. Afterward, we can no longer add shares programmatically. Here's a snippet from our python script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;api = NaElement("cifs-share-create")
api.child_add_string("path",linuxdir)
api.child_add_string("share-name", username + '$')

xi = NaElement("share-properties")
api.child_add(xi)

xi.child_add_string("cifs-share-properties",shareproperties)

output = netapp.invoke_elem(api)
if (output.results_status() == "failed"):
    print("ERROR: Unable to add CIFS share (" + output.results_reason() + ")")&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error we receive is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: Unable to add CIFS share (Invalid value specified for "share-properties" element within "cifs-share-create": "oplocks browsable showsnapshot changenotify".)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The share properties (&lt;SPAN&gt; "oplocks browsable showsnapshot changenotify") seem to be valid per the documentation, and they worked in 8.2.2p2. Any thoughts?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2016 17:30:11 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/invalid-properties-error-when-creating-cifs-share-via-manageability-sdk/m-p/124077#M2119</guid>
      <dc:creator>jdreese</dc:creator>
      <dc:date>2016-10-12T17:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: invalid properties error when creating cifs share via manageability sdk</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/invalid-properties-error-when-creating-cifs-share-via-manageability-sdk/m-p/124094#M2120</link>
      <description>&lt;P&gt;The cifs-share-properties property is meant to be an array of strings. &amp;nbsp;What is the variable "shareproperties"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2016 20:57:13 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/invalid-properties-error-when-creating-cifs-share-via-manageability-sdk/m-p/124094#M2120</guid>
      <dc:creator>asulliva</dc:creator>
      <dc:date>2016-10-12T20:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: invalid properties error when creating cifs share via manageability sdk</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/invalid-properties-error-when-creating-cifs-share-via-manageability-sdk/m-p/124102#M2121</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you make your NaServer connection, what API version do you specify? was it 1.31? Just wondering if there is an issue with the ZAPI call with 8.3.2. I tried it invoking the "cifs-share-create" ZAPI using multiple different ONTAPI versions and changing the syntax of the "cifs-share-properties" to use spaces, commas, quotes etc and it failed every time more than one property was used in the "cifs-share-properties" attribute. EG:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.netapp.com/t5/image/serverpage/image-id/6188i7D3EFECD4484ACE5/image-size/original?v=v2&amp;amp;px=-1" alt="temp1.png" title="temp1.png" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure what the correct syntax is to pass mutliple values to the share-properties parameter using ZAPI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I check the data type of the "share-properties"&amp;nbsp; attribute is definately a string and the documentation indicates it should be comma delimited. Also checked the source code for the "Add-NcCifsShare" PowerShell CmdLet, the "-ShareProperties" parameter is definately a string.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;// DataONTAP.C.PowerShell.SDK.Cmdlets.Cifs.AddNcCifsShare
[Parameter(HelpMessage = "The list of properties for this CIFS share. Possible values: \"oplocks\", \"browsable\", \"showsnapshot\", \"changenotify\", \"homedirectory\", \"attributecache\"")]
public string[] ShareProperties
{
	get;
	set;
}&lt;/PRE&gt;&lt;P&gt;Not sure about Python but in PowerShell I can pass an array of strings to the ShareProperties parameter. EG:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PS C:\&amp;gt; $credentials = Get-Credential -Credential admin
PS C:\&amp;gt; Connect-NcController -Name cluster1 -HTTPS -Credential $credentials

Name                 Address           Vserver              Version
----                 -------           -------              -------
cluster1             192.168.100.2                          NetApp Release 8.3.1: Mon Aug 31 08:49:20 UTC 2015

PS C:\&amp;gt; Add-NcCifsShare -Name test$ -Path "/volume_001" -ShareProperties @("oplocks","browsable","showsnapshot","changenotify") -VserverContext vserver1

CifsServer                ShareName       Path                                Comment
----------                ---------       ----                                -------
VSERVER1                  test$           /volume_001&lt;/PRE&gt;&lt;P&gt;Id suspect it's a syntax issue but I haven't tried it with an 8.3.2P2 system. Anyone else have the same issue post ONTAP upgrade?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Matt&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 04:42:53 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/invalid-properties-error-when-creating-cifs-share-via-manageability-sdk/m-p/124102#M2121</guid>
      <dc:creator>mbeattie</dc:creator>
      <dc:date>2016-10-13T04:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: invalid properties error when creating cifs share via manageability sdk</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/invalid-properties-error-when-creating-cifs-share-via-manageability-sdk/m-p/124121#M2122</link>
      <description>&lt;P&gt;Just add share properties in this way&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;api = NaElement(&lt;SPAN&gt;"cifs-share-create"&lt;/SPAN&gt;)&lt;BR /&gt;api.child_add_string(&lt;SPAN&gt;"path"&lt;/SPAN&gt;,&lt;SPAN&gt;"/volumetest"&lt;/SPAN&gt;)&lt;BR /&gt;api.child_add_string(&lt;SPAN&gt;"share-name"&lt;/SPAN&gt;, &lt;SPAN&gt;'test'&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;xi = NaElement(&lt;SPAN&gt;"share-properties"&lt;/SPAN&gt;)&lt;BR /&gt;api.child_add(xi)&lt;BR /&gt;&lt;BR /&gt;xi.child_add_string(&lt;SPAN&gt;"cifs-share-properties"&lt;/SPAN&gt;,&lt;SPAN&gt;"oplocks"&lt;/SPAN&gt;)&lt;BR /&gt;xi.child_add_string(&lt;SPAN&gt;"cifs-share-properties"&lt;/SPAN&gt;,&lt;SPAN&gt;"browsable"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;# print input parameters&lt;BR /&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;(api.sprintf())&lt;BR /&gt;&lt;BR /&gt;output = s.invoke_elem(api)&lt;BR /&gt;&lt;SPAN&gt;if &lt;/SPAN&gt;(output.results_status() == &lt;SPAN&gt;"failed"&lt;/SPAN&gt;):&lt;BR /&gt;    &lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;"ERROR: Unable to add CIFS share (" &lt;/SPAN&gt;+ output.results_reason() + &lt;SPAN&gt;")"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 14:48:38 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/invalid-properties-error-when-creating-cifs-share-via-manageability-sdk/m-p/124121#M2122</guid>
      <dc:creator>francoisbnc</dc:creator>
      <dc:date>2016-10-13T14:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: invalid properties error when creating cifs share via manageability sdk</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/invalid-properties-error-when-creating-cifs-share-via-manageability-sdk/m-p/124122#M2123</link>
      <description>&lt;P&gt;That's the ticket francoisbnc! Based on your comment, I just created a simple loop to add the properties I had set:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;for property in shareproperties.split(' '):
    xi.child_add_string("cifs-share-properties",property)&lt;/PRE&gt;&lt;P&gt;where shareproperties is&amp;nbsp;something like "oplocks browsable showsnapshot changenotify".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks to all those who took time to respond.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.netapp.com/t5/user/viewprofilepage/user-id/8030"&gt;@francoisbnc&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;Juste add share properties in this way&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;api = NaElement(&lt;SPAN&gt;"cifs-share-create"&lt;/SPAN&gt;)&lt;BR /&gt;api.child_add_string(&lt;SPAN&gt;"path"&lt;/SPAN&gt;,&lt;SPAN&gt;"/volumetest"&lt;/SPAN&gt;)&lt;BR /&gt;api.child_add_string(&lt;SPAN&gt;"share-name"&lt;/SPAN&gt;, &lt;SPAN&gt;'test'&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;xi = NaElement(&lt;SPAN&gt;"share-properties"&lt;/SPAN&gt;)&lt;BR /&gt;api.child_add(xi)&lt;BR /&gt;&lt;BR /&gt;xi.child_add_string(&lt;SPAN&gt;"cifs-share-properties"&lt;/SPAN&gt;,&lt;SPAN&gt;"oplocks"&lt;/SPAN&gt;)&lt;BR /&gt;xi.child_add_string(&lt;SPAN&gt;"cifs-share-properties"&lt;/SPAN&gt;,&lt;SPAN&gt;"browsable"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;# print input parameters&lt;BR /&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;(api.sprintf())&lt;BR /&gt;&lt;BR /&gt;output = s.invoke_elem(api)&lt;BR /&gt;&lt;SPAN&gt;if &lt;/SPAN&gt;(output.results_status() == &lt;SPAN&gt;"failed"&lt;/SPAN&gt;):&lt;BR /&gt;    &lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;"ERROR: Unable to add CIFS share (" &lt;/SPAN&gt;+ output.results_reason() + &lt;SPAN&gt;")"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 13:50:30 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/invalid-properties-error-when-creating-cifs-share-via-manageability-sdk/m-p/124122#M2123</guid>
      <dc:creator>jdreese</dc:creator>
      <dc:date>2016-10-13T13:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: invalid properties error when creating cifs share via manageability sdk</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/invalid-properties-error-when-creating-cifs-share-via-manageability-sdk/m-p/126106#M2178</link>
      <description>&lt;P&gt;I just wanted to add that it is possible to make this work with Export-CSV and Import-CSV too. &amp;nbsp;You just have to put the ShareProperities into an array like $Properties below. &amp;nbsp;Hopefully this example will help. &amp;nbsp;I know this is not directly related&amp;nbsp;to your post but I stumbled across this thread while searching on the error and thought it might help someone.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$SRCshares = Get-NcCifsShare -VserverContext $SourceSVM | select Vserver,Volume,ShareName,Path,@{Name=’ShareProperties’;Expression={[string]::join(“;”,($_.ShareProperties))}} | Export-Csv ($PathtoFiles + "DRPsrcshares.csv")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$SRCshares = Import-Csv ($PathtoFiles + "DRPsrcshares.csv")&lt;/P&gt;&lt;P&gt;Foreach ($SRCShare in $SRCShares) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;$Properties = $SRCShare.ShareProperties -split ";"&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Get-NcVserver $DestinationSVM | Add-NcCifsShare -Name $SRCShare.ShareName -Path $DSTNPath -ShareProperties $Properties&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2016 21:39:16 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/invalid-properties-error-when-creating-cifs-share-via-manageability-sdk/m-p/126106#M2178</guid>
      <dc:creator>wafl_scan</dc:creator>
      <dc:date>2016-12-09T21:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: invalid properties error when creating cifs share via manageability sdk</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/invalid-properties-error-when-creating-cifs-share-via-manageability-sdk/m-p/129509#M2319</link>
      <description>&lt;P&gt;Or if you want something that is easy to follow just do something like this. &amp;nbsp;Put the share properties into an array and use that array when you manipulate the CIFS share.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$ShareProps = @("oplocks","browsable","changenotify","homedirectory")&lt;BR /&gt;Get-NcVserver $HomedirSVM | Add-NcCifsShare -Name "%w" -Path "%w" -ShareProperties $ShareProps | Out-Null&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 15:19:00 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/invalid-properties-error-when-creating-cifs-share-via-manageability-sdk/m-p/129509#M2319</guid>
      <dc:creator>wafl_scan</dc:creator>
      <dc:date>2017-03-28T15:19:00Z</dc:date>
    </item>
  </channel>
</rss>

