REST API
Exasol SaaS offer a rich set of REST APIs that enable performing nearly all the operations available in the web console, such as:
- Managing databases and clusters
- Managing network security allowed list
- Managing users, including inviting new users
For security reasons, you can only create a Personal Access Token from the web console.
API Definition
The REST API is documented in the OpenAPI specification (formerly called Swagger specification) using the Swagger UI.
The Swagger UI generates an interactive API console for you to:
- Read the complete API definition
- Download the Open API Definition JSON file which is available in the Swagger UI
- Use the API directly from the Swagger UI
How to Use the REST API
You can access and interact with the REST API using the command line, or you can use the Swagger UI. To use the REST API, you need to generate a Personal Access Token first. Personal access tokens function like regular OAuth access tokens. You can use them to authenticate to the REST API as a bearer token in the header.
It is recommended to create personal access token only with the required scopes. For example, select database-operate if you only want to manage the database. See Scope of personal access tokens for more details.
Command Line
Once you have a personal access token, you can access the REST APIs. You can interact with the REST API directly from the command line using the curl command.
Example
The following command will return the databases from account sd1Eks1bSY22B6eNL2T0jw.
$ curl -X GET "https://cloud.exasol.com/api/v1/accounts/sd1Eks1bSY22B6eNL2T0jw/databases" -H "accept: application/json" -H "Authorization: Bearer <your-personal-access-token>"
[
{
"id": "5df0HVAcTuWY4xkoBvgzcA",
"name": "Database01",
"clusters": {
"total": 1,
"running": 0
},
"provider": "AWS",
"region": "eu-central-1",
"usedStorage": 0,
"createdAt": "2021-05-21T10:18:54",
"createdBy": "00umiyjw8OXBtXQ2O416",
"status": "tocreate"
}
]
Swagger UI
The Swagger UI offers built-in functionality to use the API. Refer to the Swagger UI to view all the APIs. You must authenticate before you are able to use the Swagger UI.
To authenticate with a personal access token, follow these steps:
- Open the Swagger UI.
- The Swagger UI loads with the ./swagger/doc.json file.
- Click the Authorize button available on the right side of the screen.
- In the Value field on the authorization dialog, enter your personal access key.
- Click Authorize to set the authorization and then click Close.
Once you are authenticated, you can use the Try it out buttons next to each API call to see the responses.