From 6528be3db2f2a1133381ebbcfaf65493238401ea Mon Sep 17 00:00:00 2001 From: seokho-son Date: Tue, 13 Sep 2022 11:13:52 +0000 Subject: [PATCH] Update Swagger REST API doc --- src/api/rest/docs/docs.go | 53 ++++++++++++++++++++++------------ src/api/rest/docs/swagger.json | 53 ++++++++++++++++++++++------------ src/api/rest/docs/swagger.yaml | 19 +++++++++++- 3 files changed, 88 insertions(+), 37 deletions(-) diff --git a/src/api/rest/docs/docs.go b/src/api/rest/docs/docs.go index 64e39fae0..0c50c9e07 100644 --- a/src/api/rest/docs/docs.go +++ b/src/api/rest/docs/docs.go @@ -7112,7 +7112,8 @@ const docTemplate = `{ }, "interval": { "description": "secs, Interval time between health checks.", - "type": "integer" + "type": "integer", + "example": 10 }, "keyValueList": { "type": "array", @@ -7122,19 +7123,23 @@ const docTemplate = `{ }, "port": { "description": "Listener Port or 1-65535", - "type": "string" + "type": "string", + "example": "22" }, "protocol": { "description": "TCP|HTTP|HTTPS", - "type": "string" + "type": "string", + "example": "TCP" }, "threshold": { "description": "num, The number of continuous health checks to change the VM status.", - "type": "integer" + "type": "integer", + "example": 3 }, "timeout": { "description": "secs, Waiting time to decide an unhealthy VM when no response.", - "type": "integer" + "type": "integer", + "example": 10 } } }, @@ -7170,13 +7175,15 @@ const docTemplate = `{ "description": "Optional, May be Used by Driver.", "type": "string" }, - "dnsname": { + "dnsName": { "description": "Optional, Auto Generated and attached", - "type": "string" + "type": "string", + "example": "" }, "ip": { "description": "Auto Generated and attached", - "type": "string" + "type": "string", + "example": "" }, "keyValueList": { "type": "array", @@ -7186,11 +7193,13 @@ const docTemplate = `{ }, "port": { "description": "1-65535", - "type": "string" + "type": "string", + "example": "22" }, "protocol": { "description": "TCP|UDP", - "type": "string" + "type": "string", + "example": "TCP" } } }, @@ -7652,15 +7661,18 @@ const docTemplate = `{ } }, "mcis": { - "type": "string" + "type": "string", + "example": "mc" }, "port": { "description": "Listener Port or 1-65535", - "type": "string" + "type": "string", + "example": "22" }, "protocol": { "description": "TCP|HTTP|HTTPS", - "type": "string" + "type": "string", + "example": "TCP" }, "vms": { "type": "array", @@ -7903,7 +7915,8 @@ const docTemplate = `{ ], "properties": { "connectionName": { - "type": "string" + "type": "string", + "example": "aws-ap-northeast-2" }, "cspNLBId": { "type": "string" @@ -7918,7 +7931,8 @@ const docTemplate = `{ "$ref": "#/definitions/mcis.NLBListenerInfo" }, "name": { - "type": "string" + "type": "string", + "example": "mc" }, "scope": { "description": "REGION(V) | GLOBAL", @@ -7926,7 +7940,8 @@ const docTemplate = `{ "enum": [ "REGION", "GLOBAL" - ] + ], + "example": "REGION" }, "type": { "description": "PUBLIC(V) | INTERNAL", @@ -7934,10 +7949,12 @@ const docTemplate = `{ "enum": [ "PUBLIC", "INTERNAL" - ] + ], + "example": "PUBLIC" }, "vNetId": { - "type": "string" + "type": "string", + "example": "ns01-systemdefault-aws-ap-northeast-2" }, "vmGroup": { "$ref": "#/definitions/mcis.TBNLBVMGroup" diff --git a/src/api/rest/docs/swagger.json b/src/api/rest/docs/swagger.json index ed89ef6ff..849d22098 100644 --- a/src/api/rest/docs/swagger.json +++ b/src/api/rest/docs/swagger.json @@ -7104,7 +7104,8 @@ }, "interval": { "description": "secs, Interval time between health checks.", - "type": "integer" + "type": "integer", + "example": 10 }, "keyValueList": { "type": "array", @@ -7114,19 +7115,23 @@ }, "port": { "description": "Listener Port or 1-65535", - "type": "string" + "type": "string", + "example": "22" }, "protocol": { "description": "TCP|HTTP|HTTPS", - "type": "string" + "type": "string", + "example": "TCP" }, "threshold": { "description": "num, The number of continuous health checks to change the VM status.", - "type": "integer" + "type": "integer", + "example": 3 }, "timeout": { "description": "secs, Waiting time to decide an unhealthy VM when no response.", - "type": "integer" + "type": "integer", + "example": 10 } } }, @@ -7162,13 +7167,15 @@ "description": "Optional, May be Used by Driver.", "type": "string" }, - "dnsname": { + "dnsName": { "description": "Optional, Auto Generated and attached", - "type": "string" + "type": "string", + "example": "" }, "ip": { "description": "Auto Generated and attached", - "type": "string" + "type": "string", + "example": "" }, "keyValueList": { "type": "array", @@ -7178,11 +7185,13 @@ }, "port": { "description": "1-65535", - "type": "string" + "type": "string", + "example": "22" }, "protocol": { "description": "TCP|UDP", - "type": "string" + "type": "string", + "example": "TCP" } } }, @@ -7644,15 +7653,18 @@ } }, "mcis": { - "type": "string" + "type": "string", + "example": "mc" }, "port": { "description": "Listener Port or 1-65535", - "type": "string" + "type": "string", + "example": "22" }, "protocol": { "description": "TCP|HTTP|HTTPS", - "type": "string" + "type": "string", + "example": "TCP" }, "vms": { "type": "array", @@ -7895,7 +7907,8 @@ ], "properties": { "connectionName": { - "type": "string" + "type": "string", + "example": "aws-ap-northeast-2" }, "cspNLBId": { "type": "string" @@ -7910,7 +7923,8 @@ "$ref": "#/definitions/mcis.NLBListenerInfo" }, "name": { - "type": "string" + "type": "string", + "example": "mc" }, "scope": { "description": "REGION(V) | GLOBAL", @@ -7918,7 +7932,8 @@ "enum": [ "REGION", "GLOBAL" - ] + ], + "example": "REGION" }, "type": { "description": "PUBLIC(V) | INTERNAL", @@ -7926,10 +7941,12 @@ "enum": [ "PUBLIC", "INTERNAL" - ] + ], + "example": "PUBLIC" }, "vNetId": { - "type": "string" + "type": "string", + "example": "ns01-systemdefault-aws-ap-northeast-2" }, "vmGroup": { "$ref": "#/definitions/mcis.TBNLBVMGroup" diff --git a/src/api/rest/docs/swagger.yaml b/src/api/rest/docs/swagger.yaml index 6b1e2c681..6580c6607 100644 --- a/src/api/rest/docs/swagger.yaml +++ b/src/api/rest/docs/swagger.yaml @@ -1098,6 +1098,7 @@ definitions: type: string interval: description: secs, Interval time between health checks. + example: 10 type: integer keyValueList: items: @@ -1105,16 +1106,20 @@ definitions: type: array port: description: Listener Port or 1-65535 + example: "22" type: string protocol: description: TCP|HTTP|HTTPS + example: TCP type: string threshold: description: num, The number of continuous health checks to change the VM status. + example: 3 type: integer timeout: description: secs, Waiting time to decide an unhealthy VM when no response. + example: 10 type: integer type: object mcis.NLBHealthCheckerReq: @@ -1141,11 +1146,13 @@ definitions: cspID: description: Optional, May be Used by Driver. type: string - dnsname: + dnsName: description: Optional, Auto Generated and attached + example: "" type: string ip: description: Auto Generated and attached + example: "" type: string keyValueList: items: @@ -1153,9 +1160,11 @@ definitions: type: array port: description: 1-65535 + example: "22" type: string protocol: description: TCP|UDP + example: TCP type: string type: object mcis.NetworkReq: @@ -1474,12 +1483,15 @@ definitions: $ref: '#/definitions/common.KeyValue' type: array mcis: + example: mc type: string port: description: Listener Port or 1-65535 + example: "22" type: string protocol: description: TCP|HTTP|HTTPS + example: TCP type: string vms: items: @@ -1658,6 +1670,7 @@ definitions: mcis.TbNLBReq: properties: connectionName: + example: aws-ap-northeast-2 type: string cspNLBId: type: string @@ -1668,20 +1681,24 @@ definitions: listener: $ref: '#/definitions/mcis.NLBListenerInfo' name: + example: mc type: string scope: description: REGION(V) | GLOBAL enum: - REGION - GLOBAL + example: REGION type: string type: description: PUBLIC(V) | INTERNAL enum: - PUBLIC - INTERNAL + example: PUBLIC type: string vNetId: + example: ns01-systemdefault-aws-ap-northeast-2 type: string vmGroup: $ref: '#/definitions/mcis.TBNLBVMGroup'