diff --git a/src/api/rest/docs/docs.go b/src/api/rest/docs/docs.go index 50a8ac6fa..a8b0c2a99 100644 --- a/src/api/rest/docs/docs.go +++ b/src/api/rest/docs/docs.go @@ -8330,23 +8330,28 @@ const docTemplate = `{ "properties": { "interval": { "description": "secs, Interval time between health checks.", - "type": "string" + "type": "string", + "example": "default" }, "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": "string" + "type": "string", + "example": "default" }, "timeout": { "description": "secs, Waiting time to decide an unhealthy VM when no response.", - "type": "string" + "type": "string", + "example": "default" } } }, @@ -8860,7 +8865,7 @@ const docTemplate = `{ }, "vmGroupId": { "type": "string", - "example": "group" + "example": "group-1" }, "vms": { "type": "array", @@ -9123,6 +9128,7 @@ const docTemplate = `{ "listener", "name", "scope", + "targetGroup", "type", "vNetId" ], diff --git a/src/api/rest/docs/swagger.json b/src/api/rest/docs/swagger.json index c00e6d2de..69c108ac7 100644 --- a/src/api/rest/docs/swagger.json +++ b/src/api/rest/docs/swagger.json @@ -8322,23 +8322,28 @@ "properties": { "interval": { "description": "secs, Interval time between health checks.", - "type": "string" + "type": "string", + "example": "default" }, "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": "string" + "type": "string", + "example": "default" }, "timeout": { "description": "secs, Waiting time to decide an unhealthy VM when no response.", - "type": "string" + "type": "string", + "example": "default" } } }, @@ -8852,7 +8857,7 @@ }, "vmGroupId": { "type": "string", - "example": "group" + "example": "group-1" }, "vms": { "type": "array", @@ -9115,6 +9120,7 @@ "listener", "name", "scope", + "targetGroup", "type", "vNetId" ], diff --git a/src/api/rest/docs/swagger.yaml b/src/api/rest/docs/swagger.yaml index 223ca9c84..3edb975a8 100644 --- a/src/api/rest/docs/swagger.yaml +++ b/src/api/rest/docs/swagger.yaml @@ -1268,19 +1268,24 @@ definitions: properties: interval: description: secs, Interval time between health checks. + example: default type: string 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: default type: string timeout: description: secs, Waiting time to decide an unhealthy VM when no response. + example: default type: string type: object mcis.NLBListenerInfo: @@ -1636,7 +1641,7 @@ definitions: example: TCP type: string vmGroupId: - example: group + example: group-1 type: string vms: items: @@ -1869,6 +1874,7 @@ definitions: - listener - name - scope + - targetGroup - type - vNetId type: object diff --git a/src/core/mcis/nlb.go b/src/core/mcis/nlb.go index d410b66bb..34752bb3f 100644 --- a/src/core/mcis/nlb.go +++ b/src/core/mcis/nlb.go @@ -57,11 +57,11 @@ type SpiderNLBReqInfo struct { } type NLBHealthCheckerReq struct { - Protocol string // TCP|HTTP|HTTPS - Port string // Listener Port or 1-65535 - Interval string // secs, Interval time between health checks. - Timeout string // secs, Waiting time to decide an unhealthy VM when no response. - Threshold string // num, The number of continuous health checks to change the VM status. + Protocol string `json:"protocol" example:"TCP"` // TCP|HTTP|HTTPS + Port string `json:"port" example:"22"` // Listener Port or 1-65535 + Interval string `json:"interval" example:"default"` // secs, Interval time between health checks. + Timeout string `json:"timeout" example:"default"` // secs, Waiting time to decide an unhealthy VM when no response. + Threshold string `json:"threshold" example:"default"` // num, The number of continuous health checks to change the VM status. } type SpiderNLBVMGroupReq struct { @@ -140,7 +140,7 @@ type TBNLBTargetGroup struct { Protocol string `json:"protocol" example:"TCP"` // TCP|HTTP|HTTPS Port string `json:"port" example:"22"` // Listener Port or 1-65535 - VmGroupId string `json:"vmGroupId" example:"group"` + VmGroupId string `json:"vmGroupId" example:"group-1"` VMs []string `json:"vms"` CspID string // Optional, May be Used by Driver. @@ -164,7 +164,7 @@ type TbNLBReq struct { // Tumblebug //------ Backend - TargetGroup TBNLBTargetGroup `json:"targetGroup"` + TargetGroup TBNLBTargetGroup `json:"targetGroup" validate:"required"` HealthChecker NLBHealthCheckerReq `json:"healthChecker" validate:"required"` }