kloudbuster/kb_server/kloudbuster-swagger.yaml
Yichen Wang 988a99e7a1 Add support to upload official image from OpenStack
1. Add support to upload official image from OpenStack;
2. Move dib and kb_server to upper level directory;
3. Fix the issue of dumping pecan server logs using Rest API;

Change-Id: I636fe4a1a2213d72c37fc09f37e1f70b2ca8c394
2015-09-02 10:32:38 -07:00

248 lines
8.0 KiB
YAML

swagger: '2.0'
info:
title: KloudBuster Rest API Specification
description: |
A tool to load OpenStack clouds end to end in both control plane and
data plane.
version: "0.1.0"
host: 127.0.0.1:8080
basePath: /api
schemes:
- http
- https
consumes:
- application/json
produces:
- application/json
paths:
/config/default_config:
get:
description: |
Get the default KloudBuster configuration from server
tags:
- config
responses:
200:
description: The default configuration
schema:
type: string
format: json
/config/running_config:
post:
description: |
Create a new KloudBuster session with provided configuration
parameters:
- name: arg
in: body
description: The configuration for KloudBuster
required: true
schema:
$ref: '#/definitions/Configuration_New'
tags:
- config
responses:
200:
description: Session is created successfully
schema:
type: string
format: md5sum
description: The newly created session ID
400:
description: Error while parsing the configuration file
schema:
type: string
description: Errors in details
403:
description: Session is already existed
/config/running_config/{session_id}:
get:
description: |
Get the running configuration of a KloudBuster session
parameters:
- name: session_id
type: string
format: md5sum
in: path
description: The session to be queried
required: true
tags:
- config
responses:
200:
description: The running configuration
schema:
type: string
format: json
404:
description: The session_id is not found or invalid
put:
description: |
(NOT IMPLEMENTED)
Update KloudBuster configuration for an existing session
parameters:
- name: session_id
type: string
format: md5sum
in: path
description: |
The session to be updated
required: true
- name: arg
in: body
description: The configuration to be updated
required: true
schema:
# @TODO: Adding Configuration_Update
$ref: '#/definitions/Configuration_New'
tags:
- config
responses:
200:
description: |
Configuration of given session is updated successfully
405:
description: |
Cannot change configuration while KloudBuster is running
delete:
description: |
Terminate the given session in KloudBuster server
parameters:
- name: session_id
type: string
in: path
description: |
The session to be terminated
required: true
tags:
- config
responses:
200:
description: The session is terminated successfully
404:
description: The session_id is not found or invalid
/kloudbuster/version:
get:
description: Get KloudBuster server version
tags:
- kloudbuster
responses:
200:
description: OK
schema:
type: string
description: The version of the KloudBuster server
/kloudbuster/status/{session_id}:
get:
description: |
Get KloudBuster server status for a given session
parameters:
- name: session_id
type: string
format: md5sum
in: path
description: The session to be queried
required: true
tags:
- kloudbuster
responses:
200:
description: OK
schema:
type: string
description: The status of the given session
404:
description: The session_id is not found or invalid
/kloudbuster/console_log/{session_id}:
get:
description: |
Get KloudBuster console log for a given session
parameters:
- name: session_id
type: string
format: md5sum
in: path
description: The session to be queried
required: true
tags:
- kloudbuster
responses:
200:
description: OK
schema:
type: string
description: The console log of the given session
404:
description: The session_id is not found or invalid
/kloudbuster/report/{session_id}:
get:
description: |
Get KloudBuster periodical report for a given session. Only
last report will be returned.
parameters:
- name: session_id
type: string
format: md5sum
in: path
description: The session to be queried
required: true
tags:
- kloudbuster
responses:
200:
description: OK
schema:
type: string
description: The periodical report of the given session
404:
description: The session_id is not found or invalid
/kloudbuster/run/{session_id}:
post:
description: |
Run KloudBuster for a given session
parameters:
- name: session_id
type: string
format: md5sum
in: path
description: |
The session to be run
required: true
tags:
- kloudbuster
responses:
200:
description: Successfully start the given session
403:
description: |
KloudBuster is already running on the given session
404:
description: The session_id is not found or invalid
definitions:
Configuration_New:
properties:
credentials:
type: string
format: json
description: Credentials for the clouds
kb_cfg:
type: string
format: json
description: User overrided configs
topo_cfg:
type: string
format: json
description: Topology config
tenants_cfg:
type: string
format: json
description: Tenant and User list for reusing