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
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