Skip to content

API

Getting Started

Swagger

NAbox provides several REST endpoints to automate everything you can do in the web interface

There is one endpoint on /api/1.0/ for NAbox confguraton itself, and one on /harvest2/1.0/ to manage ONTAP systems. (there is also /harvest/1.0/ if you are using Harvest 1.x)

For each of these enpoints, there's a Swagger documentation available on /ui.

For example, to use the Swagger interface and test APIs for NAbox administration, point your browser to https://<nabox ip>/api/1.0/ui/ URL.

Likewise, to manage your ONTAP system and browse the APIs for NetApp Harvest, point your browser to https://<nabox ip>/harvest2/1.0/ui/.

Authentication

Authentication for NAbox API is based on standard HTTP authentication mechanism, using the admin user and password.

For NetApp Harvest API autentication, you need to get the authentication token for your deployment before using the API.

Today, the only way to get that token is to log in NAbox with ssh and grab the content of the /opt/secrets/harvest-api file :

❯ ssh root@nabox3.fr.netapp.com cat /opt/secrets/harvest-api
root@nabox3.fr.netapp.com's password: 
da84ecf148ad410e8da0a465894d7330

Testing the API

You can perform a quick test to see if the API is working using curl on a linux PC for example :

❯ curl -u admin:Netapp01 https://<nabox ip>/api/1.0/system/version
{
"alpine-release": "3.15.1",
"date": "2022-03-17",
"version": "3.0.4"
}
❯ curl -H 'api_key: da84ecf148ad410e8da0a465894d7330' https://nabox3.fr.netapp.com/harvest2/1.0/systems
{
    "AFF": {
        "autostart": "1",
        "group": "LAB",
        "hostname": "aff8040.fr.netapp.com",
        "loglevel": 0,
        "prometheus_port": 12990,
        "status": "started",
        "use_insecure_tls": true,
        "username": "admin"
    }
}