ScaleArc can be administered, configured, and monitored using an external RESTful API.
The APIs allow a programmatic way of communication between applications and the ScaleArc system to use, configure, and monitor the system. The APIs are based on a fully RESTful HTTP service that uses all aspects of the HTTP protocol, including methods (for example, GET, PUT, POST, or DELETE) and URIs.
It uses JSON (JavaScript Object Notation) for serializing the data in request and response formats.
Follow these steps to set up API communication with ScaleArc:
- Click on the SETTINGS menu > API on the ScaleArc dashboard.
-
This screen displays the various APIs, their request and response parameters, and how to use them.
The API features appear in the top portion of the API screen and are described further in the table below:
API Feature Description API Key Used with calls for this particular ScaleArc node and user. API Call dropdown Used for selecting a specific call GET, ADD, UPDATE, and DELETE Request methods ID Populates the unique ids of entities (like clusters, servers, cache patterns, and so on) from Scalearc's internal database EXECUTE The execute button -
The bottom section of the screen displays these API features:
API Feature Description CURL CALL Tab with text-editing capabilities FORM Tab to generate a "fill in the blanks" form for all command parameters POWERSHELL Displays API calls that can be copied and executed verbatim in PowerShell, version 3.x and above RESULT Displays the JSON result returned from executing an API command - Click Get Apikey and enter your username and password on the prompt. Submitting the correct credentials will result in a confirmation notification.
- Use the screen to generate a cURL-formatted, REST command as follows:
- Select a desired command from the Select an API call drop-down.
- Choose an appropriate request method (for example, GET).
- Identify the specific cluster, server, or both to be included in the command execution. The entity for executing the command depends on the API; for example:
- Cache-related APIs may require cache pattern ids
- User-related APIs, like adding logical databases, require user ids
- System-level APIs like load balancer or Start/Stop do not require cluster or server ids
- Populate command parameters with a verb form.
- Run the command by clicking on EXECUTE and examine the result.
- Edit the command result (if necessary).
- Copy the final result and paste it into a cURL command-line script.
- Select a desired command from the Select an API call drop-down.
- Refer to the DOCs tab for some documentation and examples on how to use the APIs.
Examples:
For additional information on the various APIs, their request and response parameters, and examples on how to use them, check out the ScaleArc 3.x API Pocket Reference Guides included as attachments at the bottom of this article.