<?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: Is this (powershell) possible in c# with the ManageOntap API? in Software Development Kit (SDK) and API Discussions</title>
    <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Is-this-powershell-possible-in-c-with-the-ManageOntap-API/m-p/100604#M1351</link>
    <description>&lt;P&gt;think i have found the longest way possible to do it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;            try
            {

                s = new NaServer(Server, 1, 3);
                s.Style = NaServer.AUTH_STYLE.LOGIN_PASSWORD;
                s.SetAdminUser(user, pwd);

                xi = new NaElement("volume-list-info");

                xo = s.InvokeElem(xi);

                ArrayList vols = new ArrayList();

                System.Collections.IList volList = xo.GetChildByName("volumes").GetChildren();
                System.Collections.IEnumerator volIter = volList.GetEnumerator();
                while (volIter.MoveNext())
                {
                    NaElement volInfo = (NaElement)volIter.Current;
                    vols.Add(volInfo.GetChildContent("name"));
                }

                foreach (string i in vols)
                {
                    xi = new NaElement("volume-options-list-info");

                    xi.AddNewChild("volume", i);

                    xo = s.InvokeElem(xi);

                    System.Collections.IList optionList = xo.GetChildByName("options").GetChildren();
                    System.Collections.IEnumerator optionIter = optionList.GetEnumerator();
                    while (optionIter.MoveNext())
                    {
                        NaElement volInfo = (NaElement)optionIter.Current;

                        if (volInfo.GetChildContent("name") == "nosnapdir")
                        {
                            Console.WriteLine("---------------------------------");
                            Console.Write("Volume\t\t: ");
                            Console.WriteLine(i);
                            Console.Write("Name\t\t: ");
                            Console.WriteLine(volInfo.GetChildContent("name"));
                            Console.Write("Value\t\t: ");
                            Console.WriteLine(volInfo.GetChildContent("value"));
                            Console.WriteLine("---------------------------------");
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.Message);
            }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Thanks&lt;/P&gt;</description>
    <pubDate>Fri, 13 Feb 2015 11:08:30 GMT</pubDate>
    <dc:creator>DwayneDibbley</dc:creator>
    <dc:date>2015-02-13T11:08:30Z</dc:date>
    <item>
      <title>Is this (powershell) possible in c# with the ManageOntap API?</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Is-this-powershell-possible-in-c-with-the-ManageOntap-API/m-p/100541#M1346</link>
      <description>&lt;PRE&gt;foreach ($controller in $controllers){
	$FAS=connect-nacontroller $controller -credential $cred -HTTPS
	$vols = get-navol | where {($_.Name -like "*_VOL_D01") -and ($_.Dedupe -eq "True")}
	foreach ($vol in $vols){
		$options=get-navoloption -Name $vol.Name |where {$_.Name -eq "nosnapdir"}
		"$($vol) $($options.Value)"
	}
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I have the above working in Powershell to check if the snapshot directory is hidden or visable, is this possible do do with the api sdk? ie looking for equivilents for get-navoloption in c#?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 05:05:54 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Is-this-powershell-possible-in-c-with-the-ManageOntap-API/m-p/100541#M1346</guid>
      <dc:creator>DwayneDibbley</dc:creator>
      <dc:date>2025-06-05T05:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: Is this (powershell) possible in c# with the ManageOntap API?</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Is-this-powershell-possible-in-c-with-the-ManageOntap-API/m-p/100604#M1351</link>
      <description>&lt;P&gt;think i have found the longest way possible to do it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;            try
            {

                s = new NaServer(Server, 1, 3);
                s.Style = NaServer.AUTH_STYLE.LOGIN_PASSWORD;
                s.SetAdminUser(user, pwd);

                xi = new NaElement("volume-list-info");

                xo = s.InvokeElem(xi);

                ArrayList vols = new ArrayList();

                System.Collections.IList volList = xo.GetChildByName("volumes").GetChildren();
                System.Collections.IEnumerator volIter = volList.GetEnumerator();
                while (volIter.MoveNext())
                {
                    NaElement volInfo = (NaElement)volIter.Current;
                    vols.Add(volInfo.GetChildContent("name"));
                }

                foreach (string i in vols)
                {
                    xi = new NaElement("volume-options-list-info");

                    xi.AddNewChild("volume", i);

                    xo = s.InvokeElem(xi);

                    System.Collections.IList optionList = xo.GetChildByName("options").GetChildren();
                    System.Collections.IEnumerator optionIter = optionList.GetEnumerator();
                    while (optionIter.MoveNext())
                    {
                        NaElement volInfo = (NaElement)optionIter.Current;

                        if (volInfo.GetChildContent("name") == "nosnapdir")
                        {
                            Console.WriteLine("---------------------------------");
                            Console.Write("Volume\t\t: ");
                            Console.WriteLine(i);
                            Console.Write("Name\t\t: ");
                            Console.WriteLine(volInfo.GetChildContent("name"));
                            Console.Write("Value\t\t: ");
                            Console.WriteLine(volInfo.GetChildContent("value"));
                            Console.WriteLine("---------------------------------");
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.Message);
            }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 13 Feb 2015 11:08:30 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Is-this-powershell-possible-in-c-with-the-ManageOntap-API/m-p/100604#M1351</guid>
      <dc:creator>DwayneDibbley</dc:creator>
      <dc:date>2015-02-13T11:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: Is this (powershell) possible in c# with the ManageOntap API?</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Is-this-powershell-possible-in-c-with-the-ManageOntap-API/m-p/100699#M1373</link>
      <description>&lt;P&gt;How would you set the volume option ( nosnapdir ) via the SDK?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 10:13:29 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Is-this-powershell-possible-in-c-with-the-ManageOntap-API/m-p/100699#M1373</guid>
      <dc:creator>DwayneDibbley</dc:creator>
      <dc:date>2015-02-17T10:13:29Z</dc:date>
    </item>
  </channel>
</rss>

