From 18e555dbd3ff384ff34baa341b2dfa544eaae760 Mon Sep 17 00:00:00 2001 From: Yichen Wang Date: Sun, 13 Mar 2016 22:08:49 -0700 Subject: [PATCH] Document updates for Rest API Change-Id: Ic6d797fad051d6daeb8aca8c0bd6127fc19bbbf7 --- doc/source/_static/kloudbuster-swagger.html | 1505 +++++++++++++++++++ doc/source/usage.rst | 3 + kb_server/kloudbuster-swagger.yaml | 3 + 3 files changed, 1511 insertions(+) create mode 100644 doc/source/_static/kloudbuster-swagger.html diff --git a/doc/source/_static/kloudbuster-swagger.html b/doc/source/_static/kloudbuster-swagger.html new file mode 100644 index 0000000..e20e04e --- /dev/null +++ b/doc/source/_static/kloudbuster-swagger.html @@ -0,0 +1,1505 @@ + + + + + KloudBuster Rest API Specification + + + +

KloudBuster Rest API Specification

+
A tool to load OpenStack clouds end to end in both control plane and\ndata plane.
+
More information: https://helloreverb.com
+
Contact Info: hello@helloreverb.com
+
Version: 0.1.0
+
All rights reserved
+
http://apache.org/licenses/LICENSE-2.0.html
+

Access

+ + +

Methods

+ [ Jump to Models ] + + +

Table of Contents

+
+ +
    + + + +
  1. get /config/az_list/{session_id}
  2. + +
  3. get /config/default_config
  4. + +
  5. get /config/hypervisor_list/{session_id}
  6. + +
  7. post /config/running_config
  8. + +
  9. delete /config/running_config/{session_id}
  10. + +
  11. get /config/running_config/{session_id}
  12. + +
  13. put /config/running_config/{session_id}
  14. + +
  15. get /config/topology_config/{session_id}
  16. + + + + + +
  17. post /kloudbuster/cleanup/{session_id}
  18. + +
  19. get /kloudbuster/log/{session_id}
  20. + +
  21. get /kloudbuster/report/{session_id}
  22. + +
  23. post /kloudbuster/run_test/{session_id}
  24. + +
  25. post /kloudbuster/stage/{session_id}
  26. + +
  27. get /kloudbuster/status/{session_id}
  28. + +
  29. post /kloudbuster/stop_test/{session_id}
  30. + +
  31. get /kloudbuster/version
  32. + + + +
+ + + + + + +
+
+ Up +
get /config/az_list/{session_id}
+
(configAzListSessionIdGet)
+ +
Get the available availability zone list
+ + +

Path parameters

+
+
session_id (required)
+ +
Path Parameter — The session to be queried
+
+ + + +

Consumes

+ This API call consumes the following media types via the Content-Type request header: + + + + + + + + + + + + +

Return type

+
+ AZ_List + +
+ + + + + + + +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. + + + +

Responses

+ +

200

+ The available availability zones for the session + + +

400

+ Cannot get the availability zone list + + +

404

+ The session_id is not found or invalid + + +
+
+ +
+
+ Up +
get /config/default_config
+
(configDefaultConfigGet)
+ +
Get the default KloudBuster configuration from server
+ + + + +

Consumes

+ This API call consumes the following media types via the Content-Type request header: + + + + + + + + + + + + +

Return type

+
+ + String +
+ + + + + + + +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. + + + +

Responses

+ +

200

+ The default configuration + + +
+
+ +
+
+ Up +
get /config/hypervisor_list/{session_id}
+
(configHypervisorListSessionIdGet)
+ +
Get the available hypervisor list
+ + +

Path parameters

+
+
session_id (required)
+ +
Path Parameter — The session to be queried
+
+ + + +

Consumes

+ This API call consumes the following media types via the Content-Type request header: + + + + + + + + + + + + +

Return type

+ + + + + + + + +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. + + + +

Responses

+ +

200

+ The available hypervisors for the session + + +

400

+ Cannot get the hypervisor list + + +

404

+ The session_id is not found or invalid + + +
+
+ +
+
+ Up +
post /config/running_config
+
(configRunningConfigPost)
+ +
Create a new KloudBuster session with provided configuration
+ + + + +

Consumes

+ This API call consumes the following media types via the Content-Type request header: + + + + +

Request body

+
+
arg (required)
+ +
Body Parameter — The configuration for KloudBuster
+
+ + + + + + + + + +

Return type

+
+ + String +
+ + + + + + + +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. + + + +

Responses

+ +

200

+ Session is already existed + + +

201

+ Session is created successfully + + +

400

+ Error while parsing the configuration file + + +
+
+ +
+
+ Up +
delete /config/running_config/{session_id}
+
(configRunningConfigSessionIdDelete)
+ +
Terminate the given session in KloudBuster server
+ + +

Path parameters

+
+
session_id (required)
+ +
Path Parameter — The session to be terminated
+
+ + + +

Consumes

+ This API call consumes the following media types via the Content-Type request header: + + + + + + + + + + + + + + + + + + +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. + + + +

Responses

+ +

200

+ The session is terminated successfully + + +

403

+ Session can be destroyed only if it is at READY + + +

404

+ The session_id is not found or invalid + + +
+
+ +
+
+ Up +
get /config/running_config/{session_id}
+
(configRunningConfigSessionIdGet)
+ +
Get the running configuration of a KloudBuster session
+ + +

Path parameters

+
+
session_id (required)
+ +
Path Parameter — The session to be queried
+
+ + + +

Consumes

+ This API call consumes the following media types via the Content-Type request header: + + + + + + + + + + + + +

Return type

+
+ + String +
+ + + + + + + +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. + + + +

Responses

+ +

200

+ The running configuration + + +

404

+ The session_id is not found or invalid + + +
+
+ +
+
+ Up +
put /config/running_config/{session_id}
+
(configRunningConfigSessionIdPut)
+ +
Update KloudBuster configuration for an existing session
+ + +

Path parameters

+
+
session_id (required)
+ +
Path Parameter — The session to be updated
+
+ + + +

Consumes

+ This API call consumes the following media types via the Content-Type request header: + + + + +

Request body

+
+
arg (required)
+ +
Body Parameter — The configuration to be updated
+
+ + + + + + + + + + + + + + + +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. + + + +

Responses

+ +

200

+ Configuration of given session is updated successfully + + +

400

+ Invalid JSON or error while parsing the configuration file + + +

403

+ Cannot update configuration if KloudBuster is busy or in error state + + +

404

+ The session_id is not found or invalid + + +
+
+ +
+
+ Up +
get /config/topology_config/{session_id}
+
(configTopologyConfigSessionIdGet)
+ +
Get the topology configuration of a KloudBuster session
+ + +

Path parameters

+
+
session_id (required)
+ +
Path Parameter — The session to be queried
+
+ + + +

Consumes

+ This API call consumes the following media types via the Content-Type request header: + + + + + + + + + + + + +

Return type

+ + + + + + + + +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. + + + +

Responses

+ +

200

+ The topology configuration + + +

404

+ The session_id is not found or invalid + + +
+
+ + + + + +
+
+ Up +
post /kloudbuster/cleanup/{session_id}
+
(kloudbusterCleanupSessionIdPost)
+ +
Cleanup KloudBuster for a given session
+ + +

Path parameters

+
+
session_id (required)
+ +
Path Parameter — The session to be run
+
+ + + +

Consumes

+ This API call consumes the following media types via the Content-Type request header: + + + + + + + + + + + + + + + + + + +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. + + + +

Responses

+ +

200

+ Successfully cleaned up the given session + + +

403

+ No resources has been staged, or session is busy + + +

404

+ The session_id is not found or invalid + + +
+
+ +
+
+ Up +
get /kloudbuster/log/{session_id}
+
(kloudbusterLogSessionIdGet)
+ +
Get KloudBuster console log for a given session
+ + +

Path parameters

+
+
session_id (required)
+ +
Path Parameter — The session to be queried
+
+ + + +

Consumes

+ This API call consumes the following media types via the Content-Type request header: + + + + + + + + +

Query parameters

+
+
offset (optional)
+ +
Query Parameter — The offset of the log file to read
+
+ + + + + +

Return type

+
+ + String +
+ + + + + + + +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. + + + +

Responses

+ +

200

+ OK + + +

400

+ Parameter is missing or invalid + + +

404

+ The session_id is not found or invalid + + +
+
+ +
+
+ Up +
get /kloudbuster/report/{session_id}
+
(kloudbusterReportSessionIdGet)
+ +
Get the latest KloudBuster periodical report for a given session.\nSet final to true to retrieve the final report.
+ + +

Path parameters

+
+
session_id (required)
+ +
Path Parameter — The session to be queried
+
+ + + +

Consumes

+ This API call consumes the following media types via the Content-Type request header: + + + + + + + + +

Query parameters

+
+
final (optional)
+ +
Query Parameter — Set to true to retrieve the final report
+
+ + + + + +

Return type

+
+ + String +
+ + + + + + + +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. + + + +

Responses

+ +

200

+ OK + + +

404

+ The session_id is not found or invalid + + +
+
+ +
+
+ Up +
post /kloudbuster/run_test/{session_id}
+
(kloudbusterRunTestSessionIdPost)
+ +
Run KloudBuster for a given session
+ + +

Path parameters

+
+
session_id (required)
+ +
Path Parameter — The session to be run
+
+ + + +

Consumes

+ This API call consumes the following media types via the Content-Type request header: + + + + + + + + + + + + + + + + + + +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. + + + +

Responses

+ +

200

+ Successfully start the given session + + +

403

+ Unable to start the tests when status is not at STAGED + + +

404

+ The session_id is not found or invalid + + +
+
+ +
+
+ Up +
post /kloudbuster/stage/{session_id}
+
(kloudbusterStageSessionIdPost)
+ +
Stage all resources to run KloudBuster for a given session
+ + +

Path parameters

+
+
session_id (required)
+ +
Path Parameter — The session to be staged
+
+ + + +

Consumes

+ This API call consumes the following media types via the Content-Type request header: + + + + + + + + + + + + + + + + + + +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. + + + +

Responses

+ +

200

+ Successfully staged all resources for the given session + + +

403

+ Unable to stage resources when status is not at READY + + +

404

+ The session_id is not found or invalid + + +
+
+ +
+
+ Up +
get /kloudbuster/status/{session_id}
+
(kloudbusterStatusSessionIdGet)
+ +
Get KloudBuster server status for a given session
+ + +

Path parameters

+
+
session_id (required)
+ +
Path Parameter — The session to be queried
+
+ + + +

Consumes

+ This API call consumes the following media types via the Content-Type request header: + + + + + + + + + + + + +

Return type

+
+ + String +
+ + + + + + + +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. + + + +

Responses

+ +

200

+ OK + + +

404

+ The session_id is not found or invalid + + +
+
+ +
+
+ Up +
post /kloudbuster/stop_test/{session_id}
+
(kloudbusterStopTestSessionIdPost)
+ +
Stop the KloudBuster tests for a given session
+ + +

Path parameters

+
+
session_id (required)
+ +
Path Parameter — The session to be stopped
+
+ + + +

Consumes

+ This API call consumes the following media types via the Content-Type request header: + + + + + + + + + + + + + + + + + + +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. + + + +

Responses

+ +

200

+ Scheduled to stop the tests for the given session + + +

403

+ Unable to stop the tests when status is not at RUNNING + + +

404

+ The session_id is not found or invalid + + +
+
+ +
+
+ Up +
get /kloudbuster/version
+
(kloudbusterVersionGet)
+ +
Get KloudBuster server version
+ + + + +

Consumes

+ This API call consumes the following media types via the Content-Type request header: + + + + + + + + + + + + +

Return type

+
+ + String +
+ + + + + + + +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. + + + +

Responses

+ +

200

+ OK + + +
+
+ + + + + +
Up
+

Models

+ [ Jump to Methods ] + +

Table of Contents

+
    + + +
  1. AZ_List
  2. + + + +
  3. Configuration_New
  4. + + + +
  5. Configuration_Update
  6. + + + +
  7. Hypervisor_List
  8. + + + +
  9. Topology_Config
  10. + + +
+ + + +
+

AZ_List Up

+
+
server
array[String] Available availability zones for server cloud
+ +
client
array[String] Available availability zones for client cloud
+ + +
+
+ + + +
+

Configuration_New Up

+
+
credentials
String Credentials for the clouds
+ +
kb_cfg
String User overrided configs
+ +
topo_cfg
String Topology config
+ +
tenants_cfg
String Tenant and User list for reusing
+ +
storage_mode
Boolean Running web UI for storage testing
+ + +
+
+ + + +
+

Configuration_Update Up

+
+
kb_cfg
String User overrided configs
+ +
topo_cfg
String Topology config
+ +
tenants_cfg
String Tenant and User list for reusing
+ + +
+
+ + + +
+

Hypervisor_List Up

+
+
server
array[String] Available hypervisors for server cloud
+ +
client
array[String] Available hypervisors for client cloud
+ + +
+
+ + + +
+

Topology_Config Up

+
+
servers_rack
array[String] Hypervisors to hold server VMs
+ +
clients_rack
array[String] Hypervisors to hold client VMs
+ + +
+
+ + + + diff --git a/doc/source/usage.rst b/doc/source/usage.rst index 26be8af..57c388d 100644 --- a/doc/source/usage.rst +++ b/doc/source/usage.rst @@ -336,6 +336,9 @@ kb_server/kloudbuster-swagger.yaml, and paste into the left panel of http://editor.swagger.io. Then you will see the specification of all Rest APIs in the right panel of the web page. +A static HTML version can be found +`here `_. + .. _start_kloudbuster_server: KloudBuster integrates a Python based web server diff --git a/kb_server/kloudbuster-swagger.yaml b/kb_server/kloudbuster-swagger.yaml index 08b5586..a29a317 100644 --- a/kb_server/kloudbuster-swagger.yaml +++ b/kb_server/kloudbuster-swagger.yaml @@ -411,6 +411,9 @@ definitions: type: string format: json description: Tenant and User list for reusing + storage_mode: + type: boolean + description: Running web UI for storage testing Configuration_Update: properties: kb_cfg: