<?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 C# Syntax for  adding Useradmin Role and Group (7-mode) in Software Development Kit (SDK) and API Discussions</title>
    <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/C-Syntax-for-adding-Useradmin-Role-and-Group-7-mode/m-p/143203#M2735</link>
    <description>&lt;P&gt;Hello, Everyone.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm still a beginner with C# and programming in general, so excuse my ignorance. I have created a C-mode application that scans the NetApp devices, verifies if certain pre-reqs are met, and if not met will assist the user in&amp;nbsp;meeting those pre-reqs. I need to do the same for 7-mode (1.20) but I'm getting stuck on 'useradmin-role-add' and 'useradmin-group-add' (which did not give me trouble in c-mode).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I created the query via Zedi and copied it straight from the developer tab with minor adjustments (role variable being a role name the user desires and 'comments' child removed). Here's my code below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;try
		 {
			NaServer s = new NaServer("&amp;lt;server name or IP address&amp;gt;", 1 , 20);
			s.ServerType = NaServer.SERVER_TYPE.FILER;
			s.TransportType = NaServer.TRANSPORT_TYPE.HTTPS;
			s.Port = 443;
			s.Style = NaServer.AUTH_STYLE.LOGIN_PASSWORD;
			s.SetAdminUser("&amp;lt;user name&amp;gt;", "&amp;lt;password&amp;gt;");


			NaElement api = new NaElement("useradmin-role-add");

			NaElement xi = new NaElement("useradmin-role");
			api.AddNewChild(xi);

			NaElement xi1 = new NaElement("useradmin-role-info");
			xi.AddNewChild(xi1);

			NaElement xi2 = new NaElement("allowed-capabilities");
			xi1.AddNewChild(xi2);

			NaElement xi3 = new NaElement("useradmin-capability-info");
			xi2.AddNewChild(xi3);
			xi3.AddNewChild("name","login-* api-*");
			xi1.AddNewChild("name", role);

			NaElement xo = s.InvokeElem(api);
			Console.WriteLine(xo.ToPrettyString(""));


		} catch blah blah blah....
&lt;/PRE&gt;
&lt;P&gt;The error in Visual Studio is "xi#.AddNewChild(xi#)"&amp;nbsp; fails due to, "&lt;FONT color="#FF0000"&gt;There is no arguement given that corresponds to the required formal parameter 'content' of NaElement.AddNewChild(string,string)&lt;/FONT&gt;." This appears to be the same when attempting to create a new group as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can give the AddNewChild("&amp;lt;ElementName&amp;gt;", "&amp;lt;ElemContent&amp;gt;")&amp;nbsp; which allows my solution to build, but does not produce any results.&amp;nbsp; As you can see I am also invoking using InvokeElem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Again, pardon my ignorance if this is a simple solution, this is the first 'real' application I have been building so any help is appreciated. Thanks!!!&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jun 2025 13:15:16 GMT</pubDate>
    <dc:creator>JahRiddim</dc:creator>
    <dc:date>2025-06-04T13:15:16Z</dc:date>
    <item>
      <title>C# Syntax for  adding Useradmin Role and Group (7-mode)</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/C-Syntax-for-adding-Useradmin-Role-and-Group-7-mode/m-p/143203#M2735</link>
      <description>&lt;P&gt;Hello, Everyone.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm still a beginner with C# and programming in general, so excuse my ignorance. I have created a C-mode application that scans the NetApp devices, verifies if certain pre-reqs are met, and if not met will assist the user in&amp;nbsp;meeting those pre-reqs. I need to do the same for 7-mode (1.20) but I'm getting stuck on 'useradmin-role-add' and 'useradmin-group-add' (which did not give me trouble in c-mode).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I created the query via Zedi and copied it straight from the developer tab with minor adjustments (role variable being a role name the user desires and 'comments' child removed). Here's my code below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;try
		 {
			NaServer s = new NaServer("&amp;lt;server name or IP address&amp;gt;", 1 , 20);
			s.ServerType = NaServer.SERVER_TYPE.FILER;
			s.TransportType = NaServer.TRANSPORT_TYPE.HTTPS;
			s.Port = 443;
			s.Style = NaServer.AUTH_STYLE.LOGIN_PASSWORD;
			s.SetAdminUser("&amp;lt;user name&amp;gt;", "&amp;lt;password&amp;gt;");


			NaElement api = new NaElement("useradmin-role-add");

			NaElement xi = new NaElement("useradmin-role");
			api.AddNewChild(xi);

			NaElement xi1 = new NaElement("useradmin-role-info");
			xi.AddNewChild(xi1);

			NaElement xi2 = new NaElement("allowed-capabilities");
			xi1.AddNewChild(xi2);

			NaElement xi3 = new NaElement("useradmin-capability-info");
			xi2.AddNewChild(xi3);
			xi3.AddNewChild("name","login-* api-*");
			xi1.AddNewChild("name", role);

			NaElement xo = s.InvokeElem(api);
			Console.WriteLine(xo.ToPrettyString(""));


		} catch blah blah blah....
&lt;/PRE&gt;
&lt;P&gt;The error in Visual Studio is "xi#.AddNewChild(xi#)"&amp;nbsp; fails due to, "&lt;FONT color="#FF0000"&gt;There is no arguement given that corresponds to the required formal parameter 'content' of NaElement.AddNewChild(string,string)&lt;/FONT&gt;." This appears to be the same when attempting to create a new group as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can give the AddNewChild("&amp;lt;ElementName&amp;gt;", "&amp;lt;ElemContent&amp;gt;")&amp;nbsp; which allows my solution to build, but does not produce any results.&amp;nbsp; As you can see I am also invoking using InvokeElem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Again, pardon my ignorance if this is a simple solution, this is the first 'real' application I have been building so any help is appreciated. Thanks!!!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 13:15:16 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/C-Syntax-for-adding-Useradmin-Role-and-Group-7-mode/m-p/143203#M2735</guid>
      <dc:creator>JahRiddim</dc:creator>
      <dc:date>2025-06-04T13:15:16Z</dc:date>
    </item>
  </channel>
</rss>

