Skip to main content
ONTAP Automation

Your first API call

Contributors dmp-netapp

You can issue a simple curl command to get started using the ONTAP REST API and confirm its availability.

Before you begin

In addition to having the curl utility available on your workstation, you need the following:

  • IP address or FQDN of the ONTAP cluster management LIF

  • ONTAP credentials for an account with authority to access the ONTAP REST API

Note If your credentials include special characters, you need to format them in a way that is acceptable to curl based on the shell you are using. For example, you can insert a backslash before each special character or wrap the entire credentials string in double quotes.
Steps
  1. At the command line interface of your local workstation, issue the following command:

    curl --request GET \
    "https://$FQDN_IP/api/cluster?fields=version" \
    --user username:password

    Example

    curl --request GET "https://10.29.186.132/api/cluster?fields=version" --user admin:david123

After you finish

The ONTAP version information is displayed in a JSON format.