Sign in to my dashboard Create an account
Menu

Simplify ONTAP REST API Consumption with the Python Client Library

Yuvaraju Balaraman
243 views



In the previous blog, I introduced you to RESTful APIs natively available with NetApp® ONTAP® 9.6 software and described how, compared with the NetApp ONTAPI application, the ONTAP REST APIs offer a vastly simplified workflow-driven user experience. The new ONTAP object model establishes REST API categories that clearly identify blocks of common functionality. This approach has resulted in a simplified external representation of ONTAP and its features.



REST APIs are industry standard and can be consumed directly with any of the popular languages and tools. Enterprises generally standardize on a programming language, and to enable enterprises and partners to automate ONTAP storage management and simplify ONTAP REST API consumption programmatically, NetApp is providing client libraries. The first client library, which is now available for download, is the Python client library.



Features of the Python Client Library

The major features and components of the library are:



  • Host connections. You can configure a connection to an ONTAP system one time and reuse it for subsequent operations. There are three connection scopes available, and you can create multiple connections to different hosts as needed.
  • Asynchronous processing and jobs. Asynchronous requests are processed in the ONTAP system as background jobs. By default, the library makes these requests appear synchronous and polls the job on behalf of the client.
  • Responses. All responses, including errors and jobs, are handled in a consistent way. You can retrieve the raw HTTP response data as needed.
  • Exception handling. An HTTP status code of 400 or greater can be raised as an exception or returned as an error response.


Accessing and Installing the ONTAP REST API Python Client Library

To make it easier for enterprises, automation engineers, and architects to access the ONTAP REST API Python client library, we are hosting the Python client library on the Python Package Index website, PYPi.org.





This page provides information on software requirements, prerequisites to installing the Python client library, and links to the Python client library documentation. To help you begin, a video, Getting Started with the NetApp ONTAP Python Client Library, is available on YouTube.



You can install the library in two ways: use a pip utility to directly download from the PYPi.org website and deploy on your workstation or download the wheel file and compile the library.



Additional Resources

DevNet, the NetApp Developer Network website, is a central location for developer resources for NetApp products and solutions. Links to the Python client library, the Getting Started video, and Python client library documentation, in addition to other ONTAP REST API resources, are available on DevNet.

Yuvaraju Balaraman

Yuvaraju Balaraman is a Senior Technical Marketing Engineer for the manageability products and solutions group at NetApp. He has good understanding of Management and Data Protection Solutions. Prior to NetApp, Yuvaraju has worked at Hewlett Packard and a partner as a backup and storage solutions consultant.

View all Posts by Yuvaraju Balaraman

Next Steps

Drift chat loading