Saturday, November 24, 2018

NetApp WFA REST API Configuration

WFA supports XML and JSON content types for all REST APIs.
WFA allows external services to access various resource collections, such as workflows, users, filters, and finders, through URI paths. The external services can use HTTP methods, such as GET, PUT, POST, and DELETE, on these URIs to perform CRUD operations on the resources.
You can perform several actions through the WFA REST APIs, including the following:
  • Access workflow definitions and metadata.
  • Execute workflows and monitor their execution.
  • View users and roles, and change passwords.
  • Execute and test resource selection filters.
  • Execute and test resource finders.
  • Manage credentials of storage or other data center objects.
  • View data sources and data source types.

Step By Step Configuration for REST API with OnCommand WFA:


In this example I am using a workflow to create a flexvol.

Login to the cluster and Listing an existing volume information.




I have create a workflow for creating a flexvol.(name - flexvol workflow).



Postman API Tool:


Postman allows you create collections of integration tests to ensure your API is working as expected. Tests are run in a specific order with each test being executed after the last is finished. For each test, an HTTP request is made and assertions written in javascript are then used to verify the integrity of your code. Since the tests and test assertions are written in JavaScript, we have freedom to manipulate the received data in different ways, such as creating local variables or even creating loops to repeatably run a test.

Specify the GET Method and URL (Https://IP.Addr of WFA/rest/workflows/name=workflowname)

Select the basic Authentication and provide the admin username and password of WFA.







Select the Headers Tab and provide Content-Type as Application/xml.

Then click the send button.





THis will generate a xml code and you will see the execute url.




Click this execute URL.
It will opens a new Tab.




Select the POST method and select the body and type the user input variables.
Then click send.






Now the POST method call is executing the flexvol workflow through REST API.







Now workflow successfully executed through REST API.




List the volumes.



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.







2 comments: