Wednesday, November 28, 2018

Interacting with NetApp API's using NetApp Manageability (NM) SDK



NetApp Manageability (NM) SDK :


For API Programming you can use the NMSDK also (NetApp Management SDK).

The NetApp Manageability SDK provides resources to develop applications that monitor and manage NetApp storage systems. SDK Help provides information about core APIs, which provide infrastructure to invoke Data ONTAP® APIs, OnCommand Unified Manager [DataFabric Manager] APIs .



The NetApp Manageability SDK 5.4 supports API Bindings for both Data ONTAP® APIs and OnCommand® Unified Manager APIs. The API Bindings libraries contain interfaces to establish a connection with either the Data ONTAP server or the Unified Manager [DataFabric Manager] server. By using these libraries, you can create applications to access and manage clustered Data ONTAP or OnCommand Unified Manager.



ZExplore Development Interface (ZEDI):


ZEDI is a utility with graphical user interface bundled with NetApp Manageability SDK (NMSDK). This utility enables you to test DATA ONTAP APIs and OnCommand Unified Manager APIs. This utility allows you to generate raw XML request for any given API.
You can supply necessary arguments in the XML request before invoking the API through HTTP or HTTPS and you can view the response in raw XML format or tree format. Additionally, for a given API, the utility can generate sample codes in Java, Perl, C, C#, Python and Ruby to demonstrate how the said API can be invoked using NMSDK Core APIs.

Converting Code

ZExplore outputs your queries into the “Execute” tab in XML. However, you can also have it convert the queries to any one of the following languages:
  • C#
  • C
  • Java
  • Perl
  • Python
  • Ruby
You do this by navigating to “Preferences -> Languages”. Once you’ve selected a language the converted code is available in the “Develop” tab.
ONTAP API Example:
1. Aggregate Rename:
First check the aggregates in System Manager.
In this example, we are going to change an existing aggregate aggr_new to aggr1.


2. Using NMSDK ZEDI Interface, select the aggr-rename API, this will generate the XML code.
Provide the required parameters to rename an aggregate.

Old_aggr_name= aggr_new
New_aggr_name=aggr1




3. Execute this XML code to the connected Data ONTAP Clusters or OCUM.




Now the execute status is passed.



ZExplore outputs your queries into the “Execute” tab in XML. However, you can also have it convert the queries to any one of the following languages:
  • C#
  • C
  • Java
  • Perl
  • Python
  • Ruby
You do this by navigating to “Preferences -> Languages”. Once you’ve selected a language the converted code is available in the “Develop” tab.



Check in System Manager, aggregate renamed as aggr1.




Even you can check, the event is updated in OCUM also.



Example 2: Adding disks to an existing aggregate.

aggr1 aggregate has 5 disks.

Now we are going to add 2 more disks to this aggregate.




Select the aggr-add API and generate the code.

Specify the required parameters.

Aggregate Name=aggr1
diskcount=2


Execute this to the connected Ontap Cluster.

Command run successfully.



Then check in System Manager, aggr1 aggregate has 7 disks now.



2 comments: