Software Development Kit (SDK) and API Discussions

NMSDK 4.1 and C# basics

m_floerl
6,833 Views

hi,

i am new in the sdk world. with the "old" manageontap.dll i was able to connect to the filer, but with the new manage-ontap.dll i cant.

we are running ontap 7.3.4P3, but i can only find dll's for 7.3.1, 7.3, 7.3.1, 7.3.3, 7.3.5, 8.0 in the 4.1 SDK

old: (works)

            NaServer mycontroller;

            NaElement xin, xout; 

            mycontroller = new NaServer(storageController, 1, 0);
            mycontroller.Style = NaServer.AUTH_STYLE.LOGIN_PASSWORD;
            mycontroller.SetAdminUser(user, pass);

new:

            NaFiler server = null;
            server = new NaFiler(txthost.Text);

            server.Credentials = new NetworkCredential(txtuser.Text, txtpw.Text);
            server.ForceUseUnsecure = true;


            VolumeListInfo input = new VolumeListInfo();

i get the error: The type initializer for 'NetApp.NaServer' threw an exception.

sorry but i searched a long time in the web but i cant find a answer...

thx

regards

markus

1 ACCEPTED SOLUTION

rle
NetApp Alumni
6,833 Views

Try this:

xi = new NaElement("system-get-info");

xo = s.InvokeElem(xi);

systemInfo = xo.GetChildByName("system-info");

systemID = systemInfo.GetChildContent("system-id");


GetChildren() is used for getting arrays within an element.

Regards,

   - Rick -

View solution in original post

6 REPLIES 6

kunalm
6,833 Views

Hi Markus

I guess you have downloaded the.NET API bindings package from NOW. If you plan to use the same you can use 7.3.5 dll to work with 7.3.4

If you plan to use any other programming language download the NetApp Manageability SDK 4.1 package.

m_floerl
6,833 Views

hi kunalm,

thanks for your response! i downloaded the sdk 4.1 today and there i find all what i searched for...

thanks!!!

regards

m_floerl
6,833 Views

now all works great... i only get no Value from the system-id or other elements from system-get-info

xi = new NaElement("system-get-info");
                xo = s.InvokeElem(xi);
                System.Collections.IList
                volList = xo.GetChildByName("system-info").GetChildren();
                System.Collections.IEnumerator
                volIter = volList.GetEnumerator();
                while (volIter.MoveNext())
                {
                    NaElement volInfo = (NaElement)volIter.Current;
                    sysid = volInfo.GetChildContent("system-id");
                                       //listBox1.Items.Add("---------------------------------");
                    //listBox1.Items.Add("Volume Name\t\t: ");
                    listBox1.Items.Add("System-ID     " + sysid);
                }
            }

kunalm
6,833 Views

Markus

There is a utility called ZExplore within the package. You can try using it to execute the system-get-info API

-Kunal

rle
NetApp Alumni
6,834 Views

Try this:

xi = new NaElement("system-get-info");

xo = s.InvokeElem(xi);

systemInfo = xo.GetChildByName("system-info");

systemID = systemInfo.GetChildContent("system-id");


GetChildren() is used for getting arrays within an element.

Regards,

   - Rick -

m_floerl
6,833 Views

hi Rick, kunalm

thank you! rick's version works great. ZExplorer is a nice tool i searched for!

regards

markus

Public