Jump to: navigation, search

Difference between revisions of "Cloudpulse/APIDocs"

 
Line 35: Line 35:
 
The following are a list of API’s and the corresponding functions the API performs. The cloudpulse API’s should always be accessed with the “X-Auth-Token” which contains the token which is received from the keystone token generation API mentioned above.
 
The following are a list of API’s and the corresponding functions the API performs. The cloudpulse API’s should always be accessed with the “X-Auth-Token” which contains the token which is received from the keystone token generation API mentioned above.
  
=== List of cloudpulse tests ===
+
=== List of cloudpulse tests: ===
 
To get the list of cloudpulse tests
 
To get the list of cloudpulse tests
 
+
 
* Resource URI:   
 
* Resource URI:   
 
{| class="wikitable"
 
{| class="wikitable"
Line 46: Line 46:
 
|}
 
|}
  
* Example:<br><br>
+
* Example:<br>
 
  JSON Request
 
  JSON Request
 
  GET /cpulse
 
  GET /cpulse
Line 66: Line 66:
 
  }
 
  }
  
=== Get detailed result of a test ===
+
=== Get detailed result of a test: ===
 
To get detailed result of a particular test.
 
To get detailed result of a particular test.
  
Line 78: Line 78:
 
Uuid : uuid of the test
 
Uuid : uuid of the test
  
* Example:<br><br>
+
* Example:<br>
 
  JSON Request
 
  JSON Request
 
  GET /cpulse/e6d4de91-8311-4343-973b-c507d8806e94
 
  GET /cpulse/e6d4de91-8311-4343-973b-c507d8806e94
 
  Accept: application/json
 
  Accept: application/json
 
+
 
  JSON Response
 
  JSON Response
 
  200 OK
 
  200 OK
Line 94: Line 94:
 
       "uuid": " e6d4de91-8311-4343-973b-c507d8806e94"
 
       "uuid": " e6d4de91-8311-4343-973b-c507d8806e94"
 
  }
 
  }
 +
 +
=== Get list of tests available: ===
 +
To get a list of available cloudpulse tests.
 +
 +
* Resource URI: 
 +
{| class="wikitable"
 +
|-
 +
! Verb !! URI
 +
|-
 +
|  GET  ||  http://<controller_ip>:9999/cpulse/list_tests
 +
|}
 +
 +
* Example:<br>
 +
JSON Request
 +
GET /cpulse/list_tests
 +
Accept: application/json
 +
 
 +
JSON Response
 +
200 OK
 +
Content-Type: application/json
 +
{
 +
  "endpoint_scenario": "all_endpoint_tests\ncinder_endpoint\nglance_endpoint\nkeystone_endpoint\nneutron_endpoint\nnova_endpoint",
 +
  "operator_scenario": "all_operator_tests\nceph_check\ndocker_check\ngalera_check\nnode_check\nrabbitmq_check"
 +
}
 +
 +
=== Schedule a manual cloudpulse Test: ===
 +
To schedule a manual test of cloudpulse.
 +
 +
* Resource URI: 
 +
{| class="wikitable"
 +
|-
 +
! Verb !! URI
 +
|-
 +
|  POST  ||  http://<controller_ip>:9999/cpulse
 +
|}
 +
 +
* Example:<br>
 +
JSON Request
 +
POST /cpulse
 +
Accept: application/json
 +
{
 +
"name": "galera_check"
 +
}
 +
 
 +
JSON Response
 +
200 OK
 +
Content-Type: application/json
 +
 +
{
 +
      "name": "galera_check",
 +
      "state": "scheduled",
 +
      "result":"NotYetRun",
 +
      "testtype": "manual",
 +
      "id": 4122,
 +
      "uuid": " e6d4de91-8311-4343-973b-c507d8806e94"
 +
}
 +
 +
=== Remove the results of a test: ===
 +
To remove the results of a test.
 +
 +
* Resource URI: 
 +
{| class="wikitable"
 +
|-
 +
! Verb !! URI
 +
|-
 +
|  DELETE  || http://<controller_ip>:9999/cpulse/<uuid>
 +
|}
 +
Uuid : uuid of the test
 +
 +
* Example:<br>
 +
JSON Request
 +
DELETE /cpulse/68ffaae3-9274-46fd-b52f-ba2d039c8654
 +
Accept: application/json
 +
 +
JSON Response
 +
204 No Content

Latest revision as of 17:14, 6 July 2017

API Documentation

The cloudpulse project has a RESTful Http service called the Openstack Health API. Through this API cloudpulse allows the user to list the cloudpulse tests, create new cloudpulse tests and see the results of the cloudpulse results. All api calls described In this documentation require keystone authentication. One can use keystone v2 or v3 version for the authentication. The corresponding configuration should be configured properly in the cloudpulse config in order that the cloudpulse can reach the v2 or the v3 keystone API. The Identity service generates authentication tokens that permits access to the Cloudpulse REST APIs. Clients can obtain this token and the URL endpoints for other service APIs by supplying their valid credentials to the authentication service. Each time one makes a REST API request to Cloudpulse, the authentication token needs to be provided in the X-Auth-Token request header.

Service catalog URL

The OpenStack Keystone service catalog allows API clients to dynamically discover and navigate to cloud services. Cloudpulse has its own service URL which is added to the keystone service catalog. We can discover the service URL of cloudpulse by sending a token request to keystone which will reply with the catalog of services available.

Get token from Keystone

To get the token from keystone we have to use the following request:

  • Resource URI:
Verb URI
POST http://<controller_lb_ip>:5000/v2.0/tokens
  • Example:
JSON Request
GET /v2.0/endpoints
Accept: application/json
 
JSON Response
200 OK
Content-Type: application/json
{"endpoints": [
    {"internalurl": "http://<controller>:9999",
     "adminurl": "http://<controller>:9999",
     "publicurl":"http://<controller>:9999"
}]}

Cloudpulse API’s

The following are a list of API’s and the corresponding functions the API performs. The cloudpulse API’s should always be accessed with the “X-Auth-Token” which contains the token which is received from the keystone token generation API mentioned above.

List of cloudpulse tests:

To get the list of cloudpulse tests

  • Resource URI:
Verb URI
GET http://<controller_ip>:9999/cpulse
  • Example:
JSON Request
GET /cpulse
Accept: application/json
 
JSON Response
200 OK
Content-Type: application/json
{
 "cpulses": [
   {
     "name": "galera_check",
     "state": "success",
     "result":"ActiveNodes:16.0.0.37,16.0.0.17,16.0.0.27",
     "testtype": "periodic",
     "id": 4122,
     "uuid": "a1b52d0a-ca72-448a-8cc0-5bf210438d89"
   }]
}

Get detailed result of a test:

To get detailed result of a particular test.

  • Resource URI:
Verb URI
GET http://<controller_ip>:9999/cpulse/<uuid>

Uuid : uuid of the test

  • Example:
JSON Request
GET /cpulse/e6d4de91-8311-4343-973b-c507d8806e94
Accept: application/json

JSON Response
200 OK
Content-Type: application/json
{
     "name": "galera_check",
     "state": "success",
     "result":"ActiveNodes:16.0.0.37,16.0.0.17,16.0.0.27",
     "testtype": "periodic",
     "id": 4122,
     "uuid": " e6d4de91-8311-4343-973b-c507d8806e94"
}

Get list of tests available:

To get a list of available cloudpulse tests.

  • Resource URI:
Verb URI
GET http://<controller_ip>:9999/cpulse/list_tests
  • Example:
JSON Request
GET /cpulse/list_tests
Accept: application/json
 
JSON Response
200 OK
Content-Type: application/json
{
 "endpoint_scenario": "all_endpoint_tests\ncinder_endpoint\nglance_endpoint\nkeystone_endpoint\nneutron_endpoint\nnova_endpoint",
 "operator_scenario": "all_operator_tests\nceph_check\ndocker_check\ngalera_check\nnode_check\nrabbitmq_check"
}

Schedule a manual cloudpulse Test:

To schedule a manual test of cloudpulse.

  • Resource URI:
Verb URI
POST http://<controller_ip>:9999/cpulse
  • Example:
JSON Request
POST /cpulse
Accept: application/json
{
"name": "galera_check"
}
 
JSON Response
200 OK
Content-Type: application/json

{
      "name": "galera_check",
      "state": "scheduled",
      "result":"NotYetRun",
      "testtype": "manual",
      "id": 4122,
      "uuid": " e6d4de91-8311-4343-973b-c507d8806e94"
}

Remove the results of a test:

To remove the results of a test.

  • Resource URI:
Verb URI
DELETE http://<controller_ip>:9999/cpulse/<uuid>

Uuid : uuid of the test

  • Example:
JSON Request
DELETE /cpulse/68ffaae3-9274-46fd-b52f-ba2d039c8654
Accept: application/json

JSON Response
204 No Content