Setup micro-service of multivim broker
[multicloud/framework.git] / multivimbroker / multivimbroker / swagger / multivim.volume.swagger.json
diff --git a/multivimbroker/multivimbroker/swagger/multivim.volume.swagger.json b/multivimbroker/multivimbroker/swagger/multivim.volume.swagger.json
new file mode 100644 (file)
index 0000000..5b26d8c
--- /dev/null
@@ -0,0 +1,379 @@
+{
+    "swagger": "2.0",
+    "info": {
+        "version": "1.0.0",
+        "title": "MultiVIM Service rest API"
+    },
+    "basePath": "/openoapi/multivim/v1/",
+    "tags": [
+        {
+            "name": "MultiVIM broker"
+        }
+    ],
+    "paths": {
+        "/{vimid}/{tenantid}/volumes": {
+            "post": {
+                "tags": [
+                    "vim volumes"
+                ],
+                "summary": "create a volume",
+                "description": "create a volume",
+                "operationId": "create_vim_volume",
+                "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 volume request param",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/CreateVimVolume"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "successful operation",
+                        "schema": {
+                            "$ref": "#/definitions/VimVolumeInfo"
+                        }
+                    },
+                    "404": {
+                        "description": "the vim id or tenant UUID is wrong"
+                    },
+                    "500": {
+                        "description": "the vim volume is not accessable"
+                    }
+                }
+            },
+            "get": {
+                "tags": [
+                    "vim volumes"
+                ],
+                "summary": "query vim volumes list",
+                "description": "query vim volumes list",
+                "operationId": "query_vim_volumes",
+                "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": "get a list of vim volumes request param",
+                        "required": false,
+                        "schema": {
+                            "$ref": "#/definitions/ListVimVolumes"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "successful operation",
+                        "schema": {
+                            "$ref": "#/definitions/VimVolumesInfo"
+                        }
+                    },
+                    "404": {
+                        "description": "the vim id or tenant UUID is wrong"
+                    },
+                    "500": {
+                        "description": "the vim volume is not accessable"
+                    }
+                }
+            }
+        },
+        "/{vimid}/{tenantid}/volumes/{volumeid}": {
+            "delete": {
+                "tags": [
+                    "vim volumes"
+                 ],
+                 "summary": "delete specific vim volume",
+                "description": "delete specific vim volume",
+                "operationId": "delete_vim_volume",
+                "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": "volumeid",
+                        "in": "path",
+                        "description": "vim volume id",
+                        "required": true,
+                        "type": "string"
+                    }
+                ],
+                "responses": {
+                    "204": {
+                        "description": "successful operation"
+                    },
+                    "404": {
+                        "description": "the vim id or tenant UUID is wrong"
+                    },
+                    "500": {
+                        "description": "the vim volume is not accessable"
+                    }
+                }
+            },
+            "get": {
+                "tags": [
+                    "vim volumes"
+                ],
+                "summary": "query specific vim volume",
+                "description": "query specific vim volume",
+                "operationId": "query_vim_volume",
+                "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": "volumeid",
+                        "in": "path",
+                        "description": "vim volume id",
+                        "required": true,
+                        "type": "string"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "successful operation",
+                        "schema": {
+                            "$ref": "#/definitions/VimVolumeInfo"
+                        }
+                    },
+                    "404": {
+                        "description": "the vim id or tenant UUID is wrong"
+                    },
+                    "500": {
+                        "description": "the vim volume is not accessable"
+                    }
+                }
+            }
+        }
+    },
+    "definitions": {
+        "CreateVimVolume": {
+            "type": "object",
+            "required": [
+                "name",
+                "volumeSize"
+            ],
+            "properties": {
+                "name": {
+                    "type": "string",
+                    "description": "volume name"
+                },
+                "volumeSize": {
+                    "type": "integer",
+                    "description": "volume size"
+                },
+                "imageName": {
+                    "type": "string",
+                    "description": "image name to create volume"
+                },
+                "volumeType": {
+                    "type": "string",
+                    "description": "volume type"
+                },
+                "availabilityZone": {
+                    "type": "integer",
+                    "description": "available zone for volume"
+                }
+            }
+        },
+        "ListVimVolumes": {
+            "type": "object",
+            "properties": {
+                "name": {
+                    "type": "string",
+                    "description": "volume name to filter volume list"
+                },
+                "limit": {
+                    "type": "integer",
+                    "description": "Requests a page size of items"
+                },
+                "marker": {
+                    "type": "string",
+                    "description": "volume ID of the last-seen item"
+                }
+            }
+        },
+        "VimVolumesInfo": {
+            "type": "object",
+            "required": [
+                "vimId",
+                "tenantId",
+                "volumes"
+            ],
+            "properties": {
+                "vimId": {
+                    "type": "string"
+                },
+                "vimName": {
+                    "type": "string"
+                },
+                "tenantId": {
+                    "type": "string",
+                    "description": "tenant UUID"
+                },
+                "volumes": {
+                    "type": "array",
+                    "description": "volume list information",
+                    "items": {
+                       "$ref": "#/definitions/VimVolumeInfo"
+                    }
+                }
+            }
+        },
+        "VimVolumeInfo": {
+            "type": "object",
+            "required": [
+                "name",
+                "id",
+                "status"
+            ],
+            "properties": {
+                "name": {
+                    "type": "string",
+                    "description": "volume name"
+                },
+                "id": {
+                    "type": "string",
+                    "description": "volume UUID"
+                },
+                "createTime": {
+                    "type": "string",
+                    "description": "created time"
+                },
+                "volumeSize": {
+                    "type": "integer",
+                    "description": "volume size"
+                },
+                "volumeType": {
+                    "type": "string",
+                    "description": "volume type"
+                },
+                "availabilityZone": {
+                    "type": "integer",
+                    "description": "available zone for volume"
+                },
+                "attachments": {
+                    "type": "array",
+                    "description": "attachment list information",
+                    "items": {
+                       "$ref": "#/definitions/VimVolumeAttachmentInfo"
+                    }
+                },
+                "vimId": {
+                    "type": "string"
+                },
+                "vimName": {
+                    "type": "string"
+                },
+                "tenantId": {
+                    "type": "string",
+                    "description": "tenant UUID"
+                },
+                "returnCode": {
+                    "type": "integer",
+                    "description": "return code: 0: Already exist 1: Newly created"
+                }
+            }
+        },
+        "VimVolumeAttachmentInfo": {
+            "type": "object",
+            "properties": {
+                "id": {
+                    "type": "string",
+                    "description": "attachment UUID"
+                },
+                "serverId": {
+                    "type": "string",
+                    "description": "server UUID"
+                },
+                "volumeId": {
+                    "type": "string",
+                    "description": "volume UUID"
+                },
+                "deviceId": {
+                    "type": "string",
+                    "description": "device UUID"
+                },
+                "hostName": {
+                    "type": "string",
+                    "description": "host name"
+                }
+            }
+        }
+    }
+}