Cue/api

Requirements
API Requirements for Cue - Kilo timeframe.


 * Keystone integration
 * CRUD on Cluster
 * Cluster Management – Scale up/down
 * Devstack integration
 * Gate Tests

REST API
General requirement, REST API must respond within 500ms.

List Clusters
GET /v1/clusters

This operation synchronously returns all clusters provisioned within the associated project id.

Request Parameters N/A

Response Parameters

JSON Request

N/A

JSON Response

{   "clusters": [ {           "cluster_id": "b51948c9-1ac5-4c28-a580-6f7c500d82f8", "network_id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", "name": "Message Cluster 1", "status": "ACTIVE", "created": "2014-11-11T01:02:03Z", "updated": "2014-11-11T01:02:03Z" },       {            "cluster_id": "13c456c9-bbfc-4c31-b26d-3ae5c3cd7a77", "network_id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", "name": "Message Cluster 2", "status": "ACTIVE", "created": "2014-11-12T13:23:54Z", "updated": "2014-11-13T19:55:01Z" }   ] }

Create Cluster
POST /v1/clusters

This operation asynchronously creates a new cluster of Nova instances provisioned with the required message brokers in a central project id.

Request Parameters

Response Codes

Response Parameters

JSON Request

{   "network_id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", "name": "MessageCluster1", "volume_size": "100", "nodes": [ {           "flavor": "large" },       {            "flavor": "large" },       {            "flavor": "large" }   ] }

JSON Response

{   "cluster": { "cluster_id": "dd745f4a-9333-417e-bb89-9c989c84c068", "network_id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", "name": "Message Cluster 1", "status": "BUILDING", "created": "2014-11-11T01:02:03Z", "updated": "2014-11-11T01:02:03Z", "nodes": [ {               "node_id": "616fb98f-46ca-475e-917e-2563e5a8cd19", "status": "BUILDING", "flavor": "large" },           {                "node_id": "e90c9d13-c4b8-4a08-992a-dad6109b8ac2", "status": "BUILDING", "flavor": "large" },           {                "node_id": "372f8f47-6818-4d83-aa42-8744c0e689b8", "status": "BUILDING", "flavor": "large" }       ]    } }

Show Cluster
GET /v1/clusters/{cluster_id}

This operation synchronously returns the status and information on the specified cluster within the provided project id.

Request Parameters

Response Codes

Response Parameters

JSON Request

N/A

JSON Response

{   "cluster": { "cluster_id": "dd745f4a-9333-417e-bb89-9c989c84c068", "network_id": "d32019d3-bc6e-4319-9c1d-6722fc136a22", "name": "Message Cluster 1", "status": "ACTIVE", "created": "2014-11-11T01:02:03Z", "updated": "2014-11-11T01:02:03Z", "nodes": [ {               "node_id": "616fb98f-46ca-475e-917e-2563e5a8cd19", "status": "ACTIVE", "flavor": "large", "endpoints": [ {                       "type": "AMQP", "value": "amqp://10.20.30.40:10000" },                   {                        "type": "console", "value": "http://10.20.30.40:5672" }               ],                "created": "2014-11-11T01:06:03Z", "updated": "2014-11-11T01:06:03Z" },           {                "node_id": "e90c9d13-c4b8-4a08-992a-dad6109b8ac2", "status": "ACTIVE", "flavor": "large", "endpoints": [ {                       "type": "AMQP", "value": "amqp://10.20.30.41:10000" },                   {                        "type": "console", "value": "http://10.20.30.41:5672" }               ],                "created": "2014-11-11T01:08:03Z", "updated": "2014-11-11T01:08:03Z" },           {                "node_id": "372f8f47-6818-4d83-aa42-8744c0e689b8", "status": "ACTIVE", "flavor": "large", "endpoints": [ {                       "type": "AMQP", "value": "amqp://10.20.30.42:10000" },                   {                        "type": "console", "value": "http://10.20.30.42:5672" }               ],                "created": "2014-11-11T01:12:03Z", "updated": "2014-11-11T01:12:03Z" }       ]    } }

Delete Cluster
DELETE /v1/clusters/{cluster_id}''

This operation will asynchronously delete the indicated cluster within the provided project id.

Request Parameters

Response Codes

Response Parameters

N/A

JSON Request

N/A

JSON Response

N/A

Testing
Cue API testing will verify the expected functionality of the Cue user interface with both positive/negative tests. The overall scope will cover testing from the HTTP REST request to required database interactions and work-flow task submission for RPC workers.

Unit Tests
Unit tests will verify the resulting function calls for each REST-ful URI and action(s). The Python Mock library will be used to replace external system dependencies with placeholder objects.

Functional Tests
The functional tests will verify the HTTP REST URI request lifecycle from controller routing to HTTP response. These tests will make use of Pecan's testing utility; pecan.testing module.

Integration Tests
The integration tests will cover API functionality from HTTP request to database access and task submission for RPC workers. The Pecan test utility will be used to route test request URI to appropriate controllers, then database record(s) will be verified for applicable change. Finally the creation of task objections will be verified to ensure valid task flows.