NetApp OnTap SDK 3.5 released with .net support(AKA PowerShell Support)!

Late last night I stumbled upon this post in the NetApp Technology Network (NTN) announcing version 3.5 of the Manage OnTap SDK… My first reaction was that OnTap 7.3.1 might be getting closer to GA, seeing as they finalized the API.  I downloaded the new bits, and was reading through the documentation when I noticed the following:

Supports multiple language interfaces –  C/C++, C#, VB.NET, Java, and Perl

Well that pretty much made my whole PoshOnTap module irrelevant… but it’s still a great source for examples using the SDK.   Speaking of, how about quick intro to the SDK… First we need to download and extract the SDK (you’ll need to register to download the SDK).  Once download you’ll need to import the NetApp.Manage assembly from the ManageOntap.dll

Note: of the seven classes within NetApp.Manage only two are of interest NetApp.Manage.NaServer, and NetApp.Manage.NaElement. The remainders are exception classes, MSDN style documentation can be found at <path>manage-ontap-sdk-3.5 docDotNetDotNet6.chm First things first you’ll need a NaServer, and NaElement object to do anything so we’ll start with the NaServer. Unfortunately, we have to make a couple decisions when we create this object. First we need the Filer name (IP/FQDN ), and the version of the SDK we want to use. If you don’t know the version your filer supports just enter 1,0 (Major, minor). In my case I’m connecting to “TOASTER1”, and specifying ZAPI version 1.0.

As you can see there are several defaults to the NaServer connection object for now we’ll just keep the defaults. We do need to provide some credentials for our destination filer to do so just call the SetAdminUser method. Now that we have our connection object it’s time to generate a request. To do this we’ll create a new NaElement, again we have to specify at least one parameter the API class…. Hmmm let’s see what version of OnTap I’m running.

So that’s the basic gist of what the process looks like. Now if your familiar with the Perl OnTap SDK the next part will look all too familiar. The output from InvokeElem() is a NaElement type, and out-default doesn’t know what to display. From here we have two choices and realy it’s up to you which you chose I use, and like both. We can either call the toString() and cast the output as [XML], or use the built in methods. XML

NaElement Methods

After I get a little more familiar with the classes and their methods I’ll post more details but in the meantime… I leave you with a Function to get all the NFS Exports off a Filer! Any requests what do you want to do from PowerShell? ~Glenn

3 thoughts on “NetApp OnTap SDK 3.5 released with .net support(AKA PowerShell Support)!”

  1. Hadn’t seen that post yet. Looks promising.
    We already run 7.3.1 on our filers. But that’s because we had a problem that was fixed in that release.

    As a suggestion, list all the CIFS shares and the permissions on them.
    Or list all mixed volumes with their NFS & CIFS shares.

    If you need more, just let me know 😉

    Reply
  2. I would like to be able to look at local drives on my system and figure out if any of them are iSCSI LUNs on a particular filer. If so, what is the LUN’s containing Volume. I am in server 2008 and the drives do not have drive letters associated with them.

    😉 Now that will be a fun one to work out…

    Reply

Leave a Reply