cURL as the REST API Client
To test communication to the array using cURL as the Linux-based REST API client:
- Use any web browser to export the array CA certificate to the API client machine.
-
Obtain array API version.
$ curl -i –cacert ‘<array_cert_filename> -X 'GET' https://10.18.240.146:5392/versions
Expected output (formatted):
-
Authenticate with the array for a session token.
curl -i --cacert './ca.crt' -X 'POST' -d '{"data":{"password":<my_password>,"username":<my_user>}}' https://<array_name>:5392/<version_number>/tokens
Expected output (formatted):
-
Test the API by using "GET" to retrieve the array name.
curl -i --cacert './ca.crt' -X 'GET' -H "X-Auth-Token:<token_string>" https://<array_name>:5392/<version_number>/arrays
Expected output (formatted):
