Using the REST APIs

Introduction

CloudByte ElastiStor REST APIs provide a bundle of functions that encompasses all the features in the CloudByte ElastiStor Administrator Console (CloudByte ElastiCenter). You do not need ElastiCenter to configure and manage CloudByte ElastiStor. Rather you can use your own portal.

The CloudByte ElastiStor REST APIs provide powerful, convenient, and simple REST-based APIs which can interact with CloudByte ElastiStor.

Click one of the following links to get a complete list of CloudByte ElastiStor REST APIs and documentation relevant to your administrative privileges:

The following sections explain the implementation.

How to use CloudByte ElastiStor REST APIs

  1. Install CloudByte ElastiCenter. For details, see Installing CloudByte ElastiStor.
  2. Authenticate as Administrator. For details, see Launching CloudByte ElastiCenter.
  3. Obtain the CloudByte REST API authorization token. This token is passed in each request using the API Key request parameter. For details, see the section Obtaining the REST API key.
  4. Form the request URL. For details, see the section Forming the API request.

Obtaining the REST API key

  1. Log in to ElastiCenter as Super Admin.
  2. In the navigation pane, select Delegated Administrator. The list of administrators appears.
  3. From the list of Accounts, click the specific account for which you want to generate the API key.
  4. In the following page, click Generate Keys.

api_reference_generate_keys

  1. Click Yes to confirm. The API key is generated and displayed as shown in the following screen:

api_reference_api_key

Forming the API request

The following is a sample GET request:

https://<elasticenteripaddress>/client/api?command=listSite&apiKey=Jj6GQNj07iqido49QAngCbLjMj4th_T_OW39J4Wtpa7o1Ext_T8gfXsmVop_noQ6PXVdrp_zajPPImKFts5UVw&response=json

Interpreting the URL

URL Component Description
https://10.36.36.50/client/api? Base URL which includes the IP address to access CloudByte ElastiCenter; the web service API entry point.
command=listSite The web service command you execute. For the complete list of commands, see ElastiStor APIs.
apiKey=UjGmN7gGwzMhFsSese3TNNOWiXHGn53eon_7sHx3aL-9_t3sHAOV_rNqVzwTnrJyCaTAg9FucSBvMp49nbnfEQ The API key that you generated.
response=json Response format. This can be XML or JSON. To get an XML response, replace json with xml in the URL.

Apart from these, the URL also has the additional parameters (required or optional) for the command.

Sample response in JSON

{ “listSiteResponse” : { “count”:2 ,”site” : [  {
  “id”: “66291daa-4c40-4462-8747-926ebc488963”,
  “name”: “Bangalore”,
  
“location”: “India”,
  “managedstate”: “Available”,
  “revisionnumber”: 0,
  
“currentUsedSpace”: 29,
  
“currentAvailableSpace”: 9943,
  “currentTotalSpace”: 9972,
  
“currentThroughput”: 605,
  “currentIOPS”: 151,
  “currentLatency”: 163,
  “currentThrottle”: 20,
  “controllers”: [
    {
“nodePools”: “4”,
“id”: “4c6e2246-52c1-3227-b51a-9928cf3b675a”,
“clusterid”: “88bf812b-5142-4780-8ad3-13178bbf30a1”,
“name”: “host1”,
“hostname”: “Both”,
“nodeTsms”: “4”,
“ipaddress”: “10.36.36.50”
}
],
“haclusters”: [
{
“id”: “88bf812b-5142-4780-8ad3-13178bbf30a1”,
“haClusterPools”: “4”,
“haClusterNodes”: “1”,
“name”: “Cluster1”,
“haClusterTsms”: “4”
}
],
“hapools”: [
{
“controllerId”: “4c6e2246-52c1-3227-b51a-9928cf3b675a”,
“id”: “38e66579-bb91-3de3-815a-48c35e2c5943”,
“availiops”: “50”,
“totalthroughput”: “102400”,
“name”: “Pool1”,
“poolTsms”: “1”,
“availthroughput”: “51200”,
“totaliops”: “100”
},
{
“controllerId”: “4c6e2246-52c1-3227-b51a-9928cf3b675a”,
“id”: “226e2e02-a3e5-3609-b70d-aea8ef655f74”,
“availiops”: “75”,
“totalthroughput”: “153600”,
“name”: “Pool2”,
“poolTsms”: “1”,
“availthroughput”: “76800”,
“totaliops”: “150”
},
{
“controllerId”: “4c6e2246-52c1-3227-b51a-9928cf3b675a”,
“id”: “810f428d-9c26-3d91-8675-62cc3ca56da0”,
“availiops”: “100”,
“totalthroughput”: “153600”,
“name”: “pool3”,
“poolTsms”: “1”,
“availthroughput”: “102400”,
“totaliops”: “150”
},
{
“controllerId”: “4c6e2246-52c1-3227-b51a-9928cf3b675a”,
“id”: “11d6fd85-5782-39fe-b85d-079d73742757”,
“availiops”: “175”,
“totalthroughput”: “384000”,
“name”: “P4”,
“poolTsms”: “1”,
“availthroughput”: “179200”,
“totaliops”: “375”
}
],
“tsms”: [
{
“controllerId”: “4c6e2246-52c1-3227-b51a-9928cf3b675a”,
“id”: “1cb805fe-dd22-357e-b198-121fa08d0971”,
“availiops”: “25”,
“totalthroughput”: “51200”,
“name”: “T1”,
“ipaddress”: “10.37.37.51”,
“availthroughput”: “25600”,
“totaliops”: “50”
},
{
“controllerId”: “4c6e2246-52c1-3227-b51a-9928cf3b675a”,
“id”: “90a4e6f8-cb3c-317f-8cdf-3986e8759747”,
“availiops”: “50”,
“totalthroughput”: “76800”,
“name”: “T2”,
“ipaddress”: “10.37.37.52”,
“availthroughput”: “51200”,
“totaliops”: “75”
},
{
“controllerId”: “4c6e2246-52c1-3227-b51a-9928cf3b675a”,
“id”: “cab14af0-84b6-3761-900b-9675b32b6ba5”,
“availiops”: “25”,
“totalthroughput”: “51200”,
“name”: “T3”,
“ipaddress”: “10.37.37.53”,
“availthroughput”: “25600”,
“totaliops”: “50”
},
{
“controllerId”: “4c6e2246-52c1-3227-b51a-9928cf3b675a”,
“id”: “17b17719-137d-3f95-9f4f-468a17a45957”,
“availiops”: “100”,
“totalthroughput”: “204800”,
“name”: “T4”,
“ipaddress”: “10.37.37.54”,
“availthroughput”: “102400”,
“totaliops”: “200”
}
]
}, {
“id”: “74692191-75a9-4294-9b1e-402127c9e327”,
“name”: “test”,
“managedstate”: “Available”,
“revisionnumber”: 0,
“currentUsedSpace”: 0,
“currentAvailableSpace”: 0,
“currentTotalSpace”: 0,
“currentThroughput”: 0,
“currentIOPS”: 0,
“currentLatency”: 0,
“currentThrottle”: 0
} ] } }

Sample response in XML

<listSiteResponse cloud-stack-version=“1.1.0.4.2013-02-06T10:19:20Z”>
  <count>1</count>
  <site>
    
<id>ad63d28a-9de9-443f-8260-4309337f40c3</id>
    <name>site</name>
    
<managedstate>Available</managedstate>
    <revisionnumber>0</revisionnumber>
    
<currentUsedSpace>0</currentUsedSpace>
    <currentAvailableSpace>1996</currentAvailableSpace>
    <currentTotalSpace>1996</currentTotalSpace>
    
<currentThroughput>0</currentThroughput>
    <currentIOPS>0</currentIOPS>
    <currentLatency>0</currentLatency>
    <currentThrottle>0</currentThrottle>
  </site>
</listSiteResponse>