From ec6574daf067ae7ad98e7fb6e3ddf4c88d899e36 Mon Sep 17 00:00:00 2001 From: Huang Haibin Date: Tue, 27 Feb 2018 22:43:10 +0800 Subject: Move swagger from newton to newton_base Change-Id: I35ed7b54d89d9c9eb6df94c7aae261eba7cc236d Issue-ID: MULTICLOUD-138 Signed-off-by: Huang Haibin --- .../swagger/multivim.image.swagger.json | 359 +++++++++++++++++++++ 1 file changed, 359 insertions(+) create mode 100644 share/newton_base/swagger/multivim.image.swagger.json (limited to 'share/newton_base/swagger/multivim.image.swagger.json') diff --git a/share/newton_base/swagger/multivim.image.swagger.json b/share/newton_base/swagger/multivim.image.swagger.json new file mode 100644 index 00000000..1ff3741a --- /dev/null +++ b/share/newton_base/swagger/multivim.image.swagger.json @@ -0,0 +1,359 @@ +{ + "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}/images": { + "post": { + "tags": [ + "vim images" + ], + "summary": "create a image", + "description": "create a image", + "operationId": "create_vim_image", + "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 image request param", + "required": true, + "schema": { + "$ref": "#/definitions/CreateVimImage" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/VimImageInfo" + } + }, + "404": { + "description": "the vim id or tenant UUID is wrong" + }, + "500": { + "description": "the vim image is not accessable" + } + } + }, + "get": { + "tags": [ + "vim images" + ], + "summary": "query vim images list", + "description": "query vim images list", + "operationId": "query_vim_images", + "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": "images 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/VimImagesInfo" + } + }, + "404": { + "description": "the vim id or tenant UUID is wrong" + }, + "500": { + "description": "the vim image is not accessable" + } + } + } + }, + "/{vimid}/{tenantid}/images/{imageid}": { + "delete": { + "tags": [ + "vim images" + ], + "summary": "delete specific vim image", + "description": "delete specific vim image", + "operationId": "delete_vim_image", + "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": "imageid", + "in": "path", + "description": "vim image id", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "successful operation" + }, + "404": { + "description": "the vim id or tenant UUID is wrong" + }, + "500": { + "description": "the vim image is not accessable" + } + } + }, + "get": { + "tags": [ + "vim images" + ], + "summary": "query specific vim image", + "description": "query specific vim image", + "operationId": "query_vim_image", + "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": "imageid", + "in": "path", + "description": "vim image id", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/VimImageInfo" + } + }, + "404": { + "description": "the vim id or tenant UUID is wrong" + }, + "500": { + "description": "the vim image is not accessable" + } + } + } + } + }, + "definitions": { + "CreateVimImage": { + "type": "object", + "required": [ + "imagePath", + "name", + "imageType", + "containerFormat" + ], + "properties": { + "name": { + "type": "string", + "description": "image name" + }, + "imageType": { + "type": "string", + "description": "image type: ami, ari, aki, vhd, vhdx, vmdk, raw, qcow2, vdi, iso" + }, + "imagePath": { + "type": "string", + "description": "image url to catalog" + }, + "containerFormat": { + "type": "string", + "description": "image container format: ami, ari, aki, bare, ovf, ova, docker" + }, + "visibility": { + "type": "string", + "description": "public, private, shared, or community" + } + } + }, + "VimImagesInfo": { + "type": "object", + "required": [ + "vimId", + "tenantId", + "images" + ], + "properties": { + "vimId": { + "type": "string" + }, + "vimName": { + "type": "string" + }, + "tenantId": { + "type": "string", + "description": "tenant UUID" + }, + "images": { + "type": "array", + "description": "image list information", + "items": { + "$ref": "#/definitions/VimImageInfo" + } + } + } + }, + "VimImageInfo": { + "type": "object", + "required": [ + "name", + "status", + "id" + ], + "properties": { + "name": { + "type": "string", + "description": "image name" + }, + "id": { + "type": "string", + "description": "image UUID" + }, + "imageType": { + "type": "string", + "description": "image type: ami, ari, aki, vhd, vhdx, vmdk, raw, qcow2, vdi, iso" + }, + "imagePath": { + "type": "string", + "description": "image url to catalog" + }, + "containerFormat": { + "type": "string", + "description": "image container format: ami, ari, aki, bare, ovf, ova, docker" + }, + "visibility": { + "type": "string", + "description": "public, private, shared, or community" + }, + "properties": { + "type": "array", + "description": "list of properties", + "items": { + "$ref": "#/definitions/VimImagePropertyInfo" + } + }, + "status": { + "type": "string", + "description": "image status" + }, + "size": { + "type": "string", + "description": "image size" + }, + "vimId": { + "type": "string" + }, + "vimName": { + "type": "string" + }, + "tenantId": { + "type": "string", + "description": "tenant UUID" + }, + "returnCode": { + "type": "integer", + "description": "0: Already exist 1: Newly created" + } + } + } + } +} -- cgit 1.2.3-korg