summaryrefslogtreecommitdiffstats
path: root/newton/newton/swagger
diff options
context:
space:
mode:
authorBin Yang <bin.yang@windriver.com>2017-09-15 17:32:41 +0800
committerBin Yang <bin.yang@windriver.com>2017-09-15 17:32:41 +0800
commit2d2d9bed8b1990da7e0e763578684b0c1084c036 (patch)
treee8162cecf0531ccb0474293f41e68cd568345e68 /newton/newton/swagger
parent8d0fd7d9733ab8c1072aa728d46f08674f7194d5 (diff)
Add swagger for identity proxy
Change-Id: Ia77b99c9ffc68f897948e2ab7d6e68ca3affba82 Issue-Id: MULTICLOUD-89 Signed-off-by: Bin Yang <bin.yang@windriver.com>
Diffstat (limited to 'newton/newton/swagger')
-rw-r--r--newton/newton/swagger/multicloud.identity.swagger.json59
-rw-r--r--newton/newton/swagger/views.py9
2 files changed, 67 insertions, 1 deletions
diff --git a/newton/newton/swagger/multicloud.identity.swagger.json b/newton/newton/swagger/multicloud.identity.swagger.json
new file mode 100644
index 00000000..b8020648
--- /dev/null
+++ b/newton/newton/swagger/multicloud.identity.swagger.json
@@ -0,0 +1,59 @@
+{
+ "swagger": "2.0",
+ "info": {
+ "version": "1.0.0",
+ "title": "MultiCloud Identity Proxy rest API"
+ },
+ "basePath": "/api/multicloud-newton/v0/",
+ "tags": [
+ {
+ "name": "MultiCloud services"
+ }
+ ],
+ "paths": {
+ "/{vimid}/identity/v3/auth/tokens": {
+ "post": {
+ "tags": [
+ "MultiCloud Identity Proxy"
+ ],
+ "summary": "Authenticate and get Catalog of endpoints",
+ "description": "Authenticate to get token and catalog of service endpoints",
+ "operationId": "authenticate",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "name": "vimid",
+ "in": "path",
+ "description": "vim instance id, composed by {cloud-owner}_{cloud-region-id}",
+ "required": true,
+ "type": "string"
+ },
+ {
+ "name": "tenant_name",
+ "in": "body",
+ "description": "tenant name",
+ "required": false,
+ "type": "string"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "successful operation",
+ "type": "string"
+ },
+ "404": {
+ "description": "the vim id or tenant name is wrong"
+ },
+ "500": {
+ "description": "the vim instance is not accessable"
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/newton/newton/swagger/views.py b/newton/newton/swagger/views.py
index 00d5f3ed..10f3c0cc 100644
--- a/newton/newton/swagger/views.py
+++ b/newton/newton/swagger/views.py
@@ -83,7 +83,14 @@ class SwaggerJsonView(APIView):
f.close()
json_data["paths"].update(json_data_temp["paths"])
json_data["definitions"].update(json_data_temp["definitions"])
+
+ json_file = os.path.join(os.path.dirname(__file__), 'multicloud.identity.swagger.json')
+ f = open(json_file)
+ json_data_temp = json.JSONDecoder().decode(f.read())
+ f.close()
+ json_data["paths"].update(json_data_temp["paths"])
+
json_data["basePath"] = "/api/multicloud-newton/v0/"
- json_data["info"]["title"] = "MultiVIM driver of OpenStack Newton Service NBI"
+ json_data["info"]["title"] = "Service NBI of MultiCloud plugin for OpenStack Newton"
return Response(json_data)