summaryrefslogtreecommitdiffstats
path: root/share/newton_base/swagger/multivim.server.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.server.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.server.swagger.json')
-rw-r--r--share/newton_base/swagger/multivim.server.swagger.json488
1 files changed, 488 insertions, 0 deletions
diff --git a/share/newton_base/swagger/multivim.server.swagger.json b/share/newton_base/swagger/multivim.server.swagger.json
new file mode 100644
index 00000000..c309a394
--- /dev/null
+++ b/share/newton_base/swagger/multivim.server.swagger.json
@@ -0,0 +1,488 @@
+{
+ "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}/servers": {
+ "post": {
+ "tags": [
+ "vim servers"
+ ],
+ "summary": "create a server",
+ "description": "create a server",
+ "operationId": "create_vim_server",
+ "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"
+ },
+ {
+ "in": "body",
+ "name": "body",
+ "description": "create vim server request param",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/CreateVimServer"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "schema": {
+ "$ref": "#/definitions/VimServerInfo"
+ }
+ },
+ "404": {
+ "description": "the vim id or tenant UUID is wrong"
+ },
+ "500": {
+ "description": "the vim server is not accessable"
+ }
+ }
+ },
+ "get": {
+ "tags": [
+ "vim servers"
+ ],
+ "summary": "query vim servers list",
+ "description": "query vim servers list",
+ "operationId": "query_vim_servers",
+ "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": "name",
+ "in": "query",
+ "description": "server name to filter list",
+ "required": false,
+ "type": "string"
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "description": "Requests a page size of items",
+ "required": false,
+ "type": "string"
+ },
+ {
+ "name": "marker",
+ "in": "query",
+ "description": "image ID of the last-seen item",
+ "required": false,
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "schema": {
+ "$ref": "#/definitions/VimServersInfo"
+ }
+ },
+ "404": {
+ "description": "the vim id or tenant UUID is wrong"
+ },
+ "500": {
+ "description": "the vim server is not accessable"
+ }
+ }
+ }
+ },
+ "/{vimid}/{tenantid}/servers/{serverid}": {
+ "delete": {
+ "tags": [
+ "vim servers"
+ ],
+ "summary": "delete specific vim server",
+ "description": "delete specific vim server",
+ "operationId": "delete_vim_server",
+ "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": "serverid",
+ "in": "path",
+ "description": "vim server id",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "successful operation"
+ },
+ "404": {
+ "description": "the vim id or tenant UUID is wrong"
+ },
+ "500": {
+ "description": "the vim server is not accessable"
+ }
+ }
+ },
+ "get": {
+ "tags": [
+ "vim servers"
+ ],
+ "summary": "query specific vim server",
+ "description": "query specific vim server",
+ "operationId": "query_vim_server",
+ "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": "serverid",
+ "in": "path",
+ "description": "vim server id",
+ "required": true,
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "schema": {
+ "$ref": "#/definitions/VimServerInfo"
+ }
+ },
+ "404": {
+ "description": "the vim id or tenant UUID is wrong"
+ },
+ "500": {
+ "description": "the vim server is not accessable"
+ }
+ }
+ }
+ }
+ },
+ "definitions": {
+ "CreateVimServer": {
+ "type": "object",
+ "required": [
+ "name",
+ "boot",
+ "flavorId"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "server name"
+ },
+ "boot": {
+ "type": "object",
+ "description": "Parameters to start a server",
+ "properties": {
+ "type": {
+ "type": "integer",
+ "description": "boot type: 1: boot from volume, 2: boot from image"
+ },
+ "volumeId": {
+ "type": "string",
+ "description": "volume UUID to boot server"
+ },
+ "imageId": {
+ "type": "string",
+ "description": "image UUID to boot server"
+ }
+ }
+ },
+ "flavorId": {
+ "type": "string",
+ "description": "flavor uuid to start server"
+ },
+ "contextArray": {
+ "type": "array",
+ "description": "list of injected files",
+ "items": {
+ "$ref": "#/definitions/VimServerContextInfo"
+ }
+ },
+ "volumeArray": {
+ "type": "array",
+ "description": "list of volumes attached to a server",
+ "items": {
+ "$ref": "#/definitions/VimServerVolumeInfo"
+ }
+ },
+ "nicArray": {
+ "type": "array",
+ "description": "list of volumes attached to a server",
+ "items": {
+ "$ref": "#/definitions/VimServerNicInfo"
+ }
+ },
+ "availabilityZone": {
+ "type": "string",
+ "description": "The availability zone from which to launch the server."
+ },
+ "metadata": {
+ "type": "array",
+ "description": "list of key-value pairs for metadata to start a server",
+ "items": {
+ "$ref": "#/definitions/VimServerKeyValuePair"
+ }
+ },
+ "userdata": {
+ "type": "string",
+ "description": "user data to start a aserver"
+ },
+ "securityGroups": {
+ "type": "array",
+ "description": "list of security groups for a server",
+ "items": {
+ "type": "string",
+ "description": "name of security group"
+ }
+ },
+ "serverGroup": {
+ "type": "string",
+ "description": "server group"
+ }
+ }
+ },
+ "VimServerKeyValuePair": {
+ "type": "object",
+ "properties": {
+ "keyName": {
+ "type": "string",
+ "description": "key name"
+ },
+ "value": {
+ "type": "string",
+ "description": "value "
+ }
+ }
+ },
+ "VimServerContextInfo": {
+ "type": "object",
+ "properties": {
+ "fileName": {
+ "type": "string",
+ "description": "Injected file name"
+ },
+ "fileData": {
+ "type": "string",
+ "description": "Injected file content "
+ }
+ }
+ },
+ "VimServerVolumeInfo": {
+ "type": "object",
+ "properties": {
+ "volumeId": {
+ "type": "string",
+ "description": "volume UUID"
+ }
+ }
+ },
+ "VimServerNicInfo": {
+ "type": "object",
+ "properties": {
+ "portId": {
+ "type": "string",
+ "description": "virtual port UUID to boot a server"
+ }
+ }
+ },
+ "VimServersInfo": {
+ "type": "object",
+ "required": [
+ "vimId",
+ "tenantId",
+ "servers"
+ ],
+ "properties": {
+ "vimId": {
+ "type": "string"
+ },
+ "vimName": {
+ "type": "string"
+ },
+ "tenantId": {
+ "type": "string",
+ "description": "tenant UUID"
+ },
+ "servers": {
+ "type": "array",
+ "description": "server list information",
+ "items": {
+ "$ref": "#/definitions/VimServerInfo"
+ }
+ }
+ }
+ },
+ "VimServerInfo": {
+ "type": "object",
+ "required": [
+ "name",
+ "status",
+ "id"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "server name"
+ },
+ "id": {
+ "type": "string",
+ "description": "server UUID"
+ },
+ "status": {
+ "type": "string",
+ "description": "server status,0:INACTIVE,1:ACTIVE,2:ERROR"
+ },
+ "boot": {
+ "type": "object",
+ "description": "Parameters to start a server",
+ "properties": {
+ "type": {
+ "type": "integer",
+ "description": "boot type: 1: boot from volume, 2: boot from image"
+ },
+ "volumeId": {
+ "type": "string",
+ "description": "volume UUID to boot server"
+ },
+ "ImageId": {
+ "type": "string",
+ "description": "image UUID to boot server"
+ }
+ }
+ },
+ "flavorId": {
+ "type": "string",
+ "description": "flavor uuid to start server"
+ },
+ "volumeArray": {
+ "type": "array",
+ "description": "list of volumes attached to a server",
+ "items": {
+ "$ref": "#/definitions/VimServerVolumeInfo"
+ }
+ },
+ "nicArray": {
+ "type": "array",
+ "description": "list of volumes attached to a server",
+ "items": {
+ "$ref": "#/definitions/VimServerNicInfo"
+ }
+ },
+ "availabilityZone": {
+ "type": "string",
+ "description": "available zone for a server"
+ },
+ "metadata": {
+ "type": "array",
+ "description": "list of key-value pairs for metadata to start a server",
+ "items": {
+ "$ref": "#/definitions/VimServerKeyValuePair"
+ }
+ },
+ "securityGroups": {
+ "type": "array",
+ "description": "list of security groups for a server",
+ "items": {
+ "type": "string",
+ "description": "name of security group"
+ }
+ },
+ "serverGroup": {
+ "type": "string",
+ "description": "server group"
+ },
+ "vimId": {
+ "type": "string"
+ },
+ "vimName": {
+ "type": "string"
+ },
+ "tenantId": {
+ "type": "string",
+ "description": "tenant UUID"
+ },
+ "returnCode": {
+ "type": "integer",
+ "description": "0: Already exist 1: Newly created"
+ }
+ }
+ }
+ }
+}