This quick start guide aims to get you on the Road to Rest API with the Pure FlashArray.
Prerequisites
- FlashArray with Purity version 3.4+ (this example uses a beta version of 3.4).
- Resolvable TCP IP address of FlashArray or FQDN of FlashArray that is resolvable from test host (this example uses the IP of the FlashArray).
- Internet Browser with REST API plugin or a REST API client (this example uses Firefox with the REST API Add-on).
Optional
- Directory Services configured and working.
- Directory Services AD admin user account (this example uses the built-in local pureuser account instead).
Setup
-
Download and install a REST API browser plugin. The one used in this KB is "RestClient", which is available for Firefox, but you can use any Rest API browser plugin.
-
Log into the FlashArray's GUI (no CLI commands available as of this writing). Verify that the certificate of the FlashArray web interface is imported and an exception is in place, if needed. Each browser has a different method for this procedure. With IE11, there is no available option for certificate exceptions.
-
Create and get an API token from the FlashArray: Settings > Users > Pureuser > more options > Create API Token. For Purity 4.x and below: System > Configuration > Users > Me > Pureuser > gear icon > Create API Token.
-
To set an expiry date for the API token, specify the validity period of the API token in Expires In. When an API token expires and is therefore no longer valid, the user cannot access the REST API until the token is recreated. To create the API token without an expiry date, leave the Expires In field blank.
-
Copy the API Token for Step 9 Below.
-
If you need to go back and get the API Token again, go to:
-
Purity 5.x and above: Settings > Users > Pureuser > more options > Show API Token
-
Purity 4.x and below: System > Configuration > API Tokens > Pureuser > ear Icon > Show API Token
-
Go to the REST API client and select Method and complete the URL field.
-
URL = https://array/api/version/auth/session
-
From Headers > Custom Header, create the required content-type header.
-
Fill in Name and Value and click Okay.
- Name = Content-Type
- Value = application/JSON
-
Fill in the body with the required "payload" using the token you copied during Step 4. i.e. {"api_token":"db277355-4b60-a268-f901-72f940483586:}
-
The completed fields should be:
- Method
- URL
- Header Name
- Header Value
- Body
-
Click Send when you are ready to send your request to create a Session.
-
If you configured everything correctly, you will receive a response like the following with status code 200.
-
When you receive a status code of 200, you are ready to test out commands and debug.
Possible codes: