Enterprises are looking to modernize, simplify, and standardize their automation approach with industry-standard APIs. In response, NetApp is shifting from traditional proprietary APIs to industry-standard REST API, adding support for an expansive REST API, starting with NetApp® ONTAP® 9.6 software release (released in mid-2019).

Starting with the ONTAP 9.7 release at the end of 2019, new features and enhancements are available only through the ONTAP REST API for automation. With the current ONTAP 9.10.1 release (January 2022), ONTAP REST covers most of the use cases in the spectrum of ONTAP management, such as NAS and SAN provisioning, data protection, security, and automatic ONTAP software and firmware upgrades.

We have developed a tool to help our customers and partners transition from ONTAPI (ZAPI) to the ONTAP REST API. This tool consists of three python scripts, covering three different use cases. The following table describes the scripts.

Note: Python 3.7 or higher is required to run the scripts.

Script Description
apache_scraper.py Apache log scraper to find ONTAPIs (ZAPIs) called against ONTAP nodes
session_stats.py Command line script to pull session statistics data from ONTAP
zapi_to_rest.py Script to find equivalent REST details of ZAPI and attributes passed

You can download the ONTAPI Usage Reporting Tool (wheel file) from GitHub.

To install the scripts

  1. Make sure that Python 3.7 or later is installed.
  2. Download the wheel file from GitHub.
  3. pip install netapp_ztools-1.0.0-py3-none-any
  4. The above command installs all the required dependencies. 
  5. Open the command prompt and navigate to python_folder python38\Lib\site-packages\netapp_ztools\ to see the installed scripts.

The following screenshot shows the scripts installed in the Python directory.

Script 1: python apache_scraper.py -h

  • Description: This script is used to find ONTAPIs (ZAPIs) called against an ONTAP cluster. Input the apache_access.log file.

Note: Access the apache_access.log file from https://<<hostname or cluster-mgmt-IP>>/spi.

  • Usage: py [-h] [-unique] [-start START] [-end END] [-date DATE] [-node NODE] [-write-csv] [-verbose] log



Script 2
: python session_stats.py -h

  • Description:This command line script pulls session statistics data from ONTAP. This script uses CLI command as an API call, which is a private CLI passthrough option in REST API. To learn more,  read the blog, Using the private CLI passthrough with the ONTAP REST API.
  • Usage:py [-h] [-username USERNAME] [-password PASSWORD] [-scope SCOPE] [-sort-by SORT_BY] [--verbose] [-write-csv] hosts
  • Users can sort by  {application|location|request|user|vserver} and scope it to cluster/node. There is also an option to download to a CSV  file.

Script 3: python zapi_to_rest.py -h

  • Description: This script helps to find the equivalent REST API call details of ZAPI, attributes, and ONTAP version passed. The output is referred from mapping documents available in the Transition ONTAPI to REST section of the devnet site .
  • Usage: zapi_to_rest.py [-h] [-attrs ATTRS] zapi_name


For more information, visit https://devnet.netapp.com/restapi.php

About Mahalakshmi G

Mahalakshmi works as Subject Matter Expert at NetApp with over 6 years of experience in Data Storage Industry. She is part of ONTAP Manageability Product Management team. She currently focuses on Automation and Tools portfolio such as ONTAP REST APIs, NetApp Manageability SDK and PSTK. She loves solving real-world customer issues and always looks for a way to automate complex storage management operations. Apart from work, Mahalakshmi is keen on music, an opacarophile, avid-book reader and enjoys traveling to historical places.

Pin It on Pinterest