From bb4e004ecd0d3f277514dccefac17102aa2d9820 Mon Sep 17 00:00:00 2001 From: seokho-son Date: Tue, 5 Apr 2022 08:05:21 +0000 Subject: [PATCH] Update Swagger REST API doc --- src/api/rest/docs/docs.go | 99 +++++++++++++++++++++++++++++++++- src/api/rest/docs/swagger.json | 97 +++++++++++++++++++++++++++++++++ src/api/rest/docs/swagger.yaml | 69 ++++++++++++++++++++++++ 3 files changed, 264 insertions(+), 1 deletion(-) diff --git a/src/api/rest/docs/docs.go b/src/api/rest/docs/docs.go index dcbf23fc..ac7c0d6f 100644 --- a/src/api/rest/docs/docs.go +++ b/src/api/rest/docs/docs.go @@ -1,4 +1,4 @@ -// Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT +// Package docs GENERATED BY SWAG; DO NOT EDIT // This file was generated by swaggo/swag package docs @@ -2198,6 +2198,68 @@ const docTemplate = `{ } } }, + "/ns/{nsId}/network/mcis/{mcisId}": { + "post": { + "description": "Configure Cloud Adaptive Network (cb-network agent) to MCIS", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "[Infra service] MCIS Cloud Adaptive Network (for developer)" + ], + "summary": "Configure Cloud Adaptive Network (cb-network agent) to MCIS", + "parameters": [ + { + "type": "string", + "default": "ns01", + "description": "Namespace ID", + "name": "nsId", + "in": "path", + "required": true + }, + { + "type": "string", + "default": "mcis01", + "description": "MCIS ID", + "name": "mcisId", + "in": "path", + "required": true + }, + { + "description": "Details for the network request body", + "name": "networkReq", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/mcis.NetworkReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/mcis.AgentInstallContentWrapper" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/common.SimpleMsg" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/common.SimpleMsg" + } + } + } + } + }, "/ns/{nsId}/policy/mcis": { "get": { "description": "List all MCIS policies", @@ -6103,6 +6165,26 @@ const docTemplate = `{ } } }, + "mcis.NetworkReq": { + "type": "object", + "properties": { + "etcdEndpoints": { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "PUBLIC_IP_1:2379", + "PUBLIC_IP_2:2379", + "..." + ] + }, + "serviceEndpoint": { + "type": "string", + "example": "localhost:8053" + } + } + }, "mcis.Operation": { "type": "object", "properties": { @@ -6543,6 +6625,16 @@ const docTemplate = `{ "mcis.TbMcisInfo": { "type": "object", "properties": { + "configureCloudAdaptiveNetwork": { + "description": "ConfigureCloudAdaptiveNetwork is an option to configure Cloud Adaptive Network (CLADNet) ([yes/no] default:yes)", + "type": "string", + "default": "no", + "enum": [ + "yes", + "no" + ], + "example": "yes" + }, "description": { "type": "string" }, @@ -6724,6 +6816,11 @@ const docTemplate = `{ "name": { "type": "string" }, + "networkAgentStatus": { + "description": "NetworkAgent status", + "type": "string", + "example": "[notInstalled, installing, installed, failed]" + }, "privateDNS": { "type": "string" }, diff --git a/src/api/rest/docs/swagger.json b/src/api/rest/docs/swagger.json index 3f66bf2e..e0be194e 100644 --- a/src/api/rest/docs/swagger.json +++ b/src/api/rest/docs/swagger.json @@ -2190,6 +2190,68 @@ } } }, + "/ns/{nsId}/network/mcis/{mcisId}": { + "post": { + "description": "Configure Cloud Adaptive Network (cb-network agent) to MCIS", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "[Infra service] MCIS Cloud Adaptive Network (for developer)" + ], + "summary": "Configure Cloud Adaptive Network (cb-network agent) to MCIS", + "parameters": [ + { + "type": "string", + "default": "ns01", + "description": "Namespace ID", + "name": "nsId", + "in": "path", + "required": true + }, + { + "type": "string", + "default": "mcis01", + "description": "MCIS ID", + "name": "mcisId", + "in": "path", + "required": true + }, + { + "description": "Details for the network request body", + "name": "networkReq", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/mcis.NetworkReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/mcis.AgentInstallContentWrapper" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/common.SimpleMsg" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/common.SimpleMsg" + } + } + } + } + }, "/ns/{nsId}/policy/mcis": { "get": { "description": "List all MCIS policies", @@ -6095,6 +6157,26 @@ } } }, + "mcis.NetworkReq": { + "type": "object", + "properties": { + "etcdEndpoints": { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "PUBLIC_IP_1:2379", + "PUBLIC_IP_2:2379", + "..." + ] + }, + "serviceEndpoint": { + "type": "string", + "example": "localhost:8053" + } + } + }, "mcis.Operation": { "type": "object", "properties": { @@ -6535,6 +6617,16 @@ "mcis.TbMcisInfo": { "type": "object", "properties": { + "configureCloudAdaptiveNetwork": { + "description": "ConfigureCloudAdaptiveNetwork is an option to configure Cloud Adaptive Network (CLADNet) ([yes/no] default:yes)", + "type": "string", + "default": "no", + "enum": [ + "yes", + "no" + ], + "example": "yes" + }, "description": { "type": "string" }, @@ -6716,6 +6808,11 @@ "name": { "type": "string" }, + "networkAgentStatus": { + "description": "NetworkAgent status", + "type": "string", + "example": "[notInstalled, installing, installed, failed]" + }, "privateDNS": { "type": "string" }, diff --git a/src/api/rest/docs/swagger.yaml b/src/api/rest/docs/swagger.yaml index a6c28e23..dcf4973a 100644 --- a/src/api/rest/docs/swagger.yaml +++ b/src/api/rest/docs/swagger.yaml @@ -963,6 +963,20 @@ definitions: nsId: type: string type: object + mcis.NetworkReq: + properties: + etcdEndpoints: + example: + - PUBLIC_IP_1:2379 + - PUBLIC_IP_2:2379 + - '...' + items: + type: string + type: array + serviceEndpoint: + example: localhost:8053 + type: string + type: object mcis.Operation: properties: operand: @@ -1276,6 +1290,15 @@ definitions: type: object mcis.TbMcisInfo: properties: + configureCloudAdaptiveNetwork: + default: "no" + description: ConfigureCloudAdaptiveNetwork is an option to configure Cloud + Adaptive Network (CLADNet) ([yes/no] default:yes) + enum: + - "yes" + - "no" + example: "yes" + type: string description: type: string id: @@ -1416,6 +1439,10 @@ definitions: type: string name: type: string + networkAgentStatus: + description: NetworkAgent status + example: '[notInstalled, installing, installed, failed]' + type: string privateDNS: type: string privateIP: @@ -3102,6 +3129,48 @@ paths: (cpu, memory, disk, network) tags: - '[Infra service] MCIS Resource monitor (for developer)' + /ns/{nsId}/network/mcis/{mcisId}: + post: + consumes: + - application/json + description: Configure Cloud Adaptive Network (cb-network agent) to MCIS + parameters: + - default: ns01 + description: Namespace ID + in: path + name: nsId + required: true + type: string + - default: mcis01 + description: MCIS ID + in: path + name: mcisId + required: true + type: string + - description: Details for the network request body + in: body + name: networkReq + required: true + schema: + $ref: '#/definitions/mcis.NetworkReq' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/mcis.AgentInstallContentWrapper' + "404": + description: Not Found + schema: + $ref: '#/definitions/common.SimpleMsg' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/common.SimpleMsg' + summary: Configure Cloud Adaptive Network (cb-network agent) to MCIS + tags: + - '[Infra service] MCIS Cloud Adaptive Network (for developer)' /ns/{nsId}/policy/mcis: delete: consumes: