Using Cloud APIs
This page describes how to automate creating, modifying, and deleting clusters programmatically in Aerospike Cloud.
Prerequisites
- You have an active Aerospike Cloud account
Create a Cloud user and key
-
Create key.
In the Aerospike Cloud UI, navigate to Team Settings > API Keys and click New API Key. Give this key a nickname and save the generated value somewhere secret.
-
Use key as an authenticator.
Use the key in the password field to communicate with the Aerospike Cloud APIs.
Calling Cloud APIs
The OpenAPI specification for the Aerospike Cloud APIs is available: Public APIs
The following example uses the API key to generate a bearer token for Aerospike Cloud APIs:
curl --request POST \ --url https://auth.control.aerospike.cloud/oauth/token \ --header 'content-type: application/json' \ --data '{"client_id":"<KEY_ID>>","client_secret":"<KEY_SECRET>","grant_type":"client_credentials"}'
That bearer token can then be used to communicate with the Aerospike Cloud APIs. e.g.
curl -X GET "https://api.aerospike.cloud/v2/databases/{databaseId}/vpc-peering" \ -H "Authorization: Bearer <YOUR_TOKEN>"