Using ScaleArc RESTful APIs

ScaleArc can be configured 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 APIare 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:

  1. Click on the SETTINGS menu > API on the ScaleArc dashboard.

    API.png
     
  2. This screen displays the various APIs, their request and response parameters, and how to use them. 


    APIs.png

    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 drop down 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

     

  3. 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

     

  4. Click Get Apikey and enter your username and password on the prompt. Submitting the correct credentials will result in a confirmation notification.
    Get_API_key.png
    API_key_fetched.png
  5. Use the screen to generate a cURL-formatted, REST command as follows:
    1. Select a desired command from the Select an API call drop-down.
      API_-_system_uptime.png
    2. Choose an appropriate request method (for example, GET).
    3. 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: 
      1. Cache-related APIs may require cache pattern ids
      2. User-related APIs, like adding logical databases, require user ids
      3. System-level APIs like load balancer or Start/Stop do not require cluster or server ids 
    4. Populate command parameters with a verb form.
    5. Run the command by clicking on EXECUTE and examine the result.
      API_-_execute.png
    6. Edit the command result (if necessary).
    7. Copy the final result and paste it into a cURL command-line script. 

  6. Refer to the DOCs tab for some documentation and examples on how to use the APIs. 

    API_DOCs.png

Examples:
API_DOCs_Examples.png

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.

Attachments

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request