summaryrefslogtreecommitdiffstats
path: root/share/newton_base/swagger/multivim.host.swagger.json
diff options
context:
space:
mode:
authorHuang Haibin <haibin.huang@intel.com>2018-02-27 22:43:10 +0800
committerHuang Haibin <haibin.huang@intel.com>2018-02-28 16:50:51 +0800
commitec6574daf067ae7ad98e7fb6e3ddf4c88d899e36 (patch)
tree8fb063e38bbef0bf380f2b39358d8167ad7b2f46 /share/newton_base/swagger/multivim.host.swagger.json
parentb8cf1e980b211c21174a1eaa61c51512106efb7d (diff)
Move swagger from newton to newton_base
Change-Id: I35ed7b54d89d9c9eb6df94c7aae261eba7cc236d Issue-ID: MULTICLOUD-138 Signed-off-by: Huang Haibin <haibin.huang@intel.com>
Diffstat (limited to 'share/newton_base/swagger/multivim.host.swagger.json')
-rw-r--r--share/newton_base/swagger/multivim.host.swagger.json233
1 files changed, 233 insertions, 0 deletions
diff --git a/share/newton_base/swagger/multivim.host.swagger.json b/share/newton_base/swagger/multivim.host.swagger.json
new file mode 100644
index 00000000..1ea4603e
--- /dev/null
+++ b/share/newton_base/swagger/multivim.host.swagger.json
@@ -0,0 +1,233 @@
+{
+ "swagger": "2.0",
+ "info": {
+ "version": "1.0.0",
+ "title": "MultiVIM Service rest API"
+ },
+ "basePath": "/api/multicloud-newton/v0/",
+ "tags": [
+ {
+ "name": "MultiVIM services"
+ }
+ ],
+ "paths": {
+ "/{vimid}/{tenantid}/hosts": {
+ "get": {
+ "tags": [
+ "vim hosts"
+ ],
+ "summary": "query vim hosts list",
+ "description": "query vim hosts list",
+ "operationId": "query_vim_hosts",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "name": "vimid",
+ "in": "path",
+ "description": "vim instance id",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "name": "tenantid",
+ "in": "path",
+ "description": "tenant UUID",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "schema": {
+ "$ref": "#/definitions/VimHostsInfo"
+ }
+ },
+ "404": {
+ "description": "the vim id or tenant UUID is wrong"
+ },
+ "500": {
+ "description": "the vim host is not accessable"
+ }
+ }
+ }
+ },
+ "/{vimid}/{tenantid}/hosts/{hostname}": {
+ "get": {
+ "tags": [
+ "vim hosts"
+ ],
+ "summary": "query specific vim host",
+ "description": "query specific vim host",
+ "operationId": "query_vim_host",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "name": "vimid",
+ "in": "path",
+ "description": "vim instance id",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "name": "tenantid",
+ "in": "path",
+ "description": "tenant UUID",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "name": "hostname",
+ "in": "path",
+ "description": "vim host name",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "schema": {
+ "$ref": "#/definitions/VimHostDetail"
+ }
+ },
+ "404": {
+ "description": "the vim id or tenant UUID is wrong"
+ },
+ "500": {
+ "description": "the vim host is not accessable"
+ }
+ }
+ }
+ }
+ },
+ "definitions": {
+ "VimHostsInfo": {
+ "type": "object",
+ "required": [
+ "vimId",
+ "tenantId",
+ "hosts"
+ ],
+ "properties": {
+ "vimId": {
+ "type": "string"
+ },
+ "vimName": {
+ "type": "string"
+ },
+ "tenantId": {
+ "type": "string",
+ "description": "tenant UUID"
+ },
+ "hosts": {
+ "type": "array",
+ "description": "list of host information",
+ "items": {
+ "$ref": "#/definitions/VimHostInfo"
+ }
+ }
+ }
+ },
+ "VimHostInfo": {
+ "type": "object",
+ "required": [
+ "name",
+ "service"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "host name"
+ },
+ "service": {
+ "type": "string",
+ "description": "service name running on the host"
+ },
+ "zone": {
+ "type": "string",
+ "description": "available zone name of the host"
+ },
+ "vimId": {
+ "type": "string"
+ },
+ "vimName": {
+ "type": "string"
+ },
+ "tenantId": {
+ "type": "string",
+ "description": "tenant UUID"
+ }
+ }
+ },
+ "VimHostDetail": {
+ "type": "object",
+ "required": [
+ "vimId",
+ "tenantId",
+ "host"
+ ],
+ "properties": {
+ "host": {
+ "type": "array",
+ "description": "list of host information",
+ "items": {
+ "$ref": "#/definitions/VimHostResource"
+ }
+ },
+ "vimId": {
+ "type": "string"
+ },
+ "vimName": {
+ "type": "string"
+ },
+ "tenantId": {
+ "type": "string",
+ "description": "tenant UUID"
+ }
+ }
+ },
+ "VimHostResource": {
+ "type": "object",
+ "required": [
+ "name",
+ "cpu",
+ "memory_mb",
+ "disk_gb",
+ "project"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "host name"
+ },
+ "cpu": {
+ "type": "integer",
+ "description": "The cpu info on the host"
+ },
+ "memory_mb": {
+ "type": "integer",
+ "description": "The memory info on the host (in MB)"
+ },
+ "disk_gb": {
+ "type": "integer",
+ "description": "The disk info on the host (in GB)"
+ },
+ "project": {
+ "type": "string",
+ "description": "The project id (or special name like total, used_now, used_max)."
+ }
+ }
+ }
+ }
+}