Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example values for NLB request #1194

Merged
merged 1 commit into from
Oct 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions src/api/rest/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
},
Expand Down Expand Up @@ -8860,7 +8865,7 @@ const docTemplate = `{
},
"vmGroupId": {
"type": "string",
"example": "group"
"example": "group-1"
},
"vms": {
"type": "array",
Expand Down Expand Up @@ -9123,6 +9128,7 @@ const docTemplate = `{
"listener",
"name",
"scope",
"targetGroup",
"type",
"vNetId"
],
Expand Down
18 changes: 12 additions & 6 deletions src/api/rest/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
},
Expand Down Expand Up @@ -8852,7 +8857,7 @@
},
"vmGroupId": {
"type": "string",
"example": "group"
"example": "group-1"
},
"vms": {
"type": "array",
Expand Down Expand Up @@ -9115,6 +9120,7 @@
"listener",
"name",
"scope",
"targetGroup",
"type",
"vNetId"
],
Expand Down
8 changes: 7 additions & 1 deletion src/api/rest/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -1636,7 +1641,7 @@ definitions:
example: TCP
type: string
vmGroupId:
example: group
example: group-1
type: string
vms:
items:
Expand Down Expand Up @@ -1869,6 +1874,7 @@ definitions:
- listener
- name
- scope
- targetGroup
- type
- vNetId
type: object
Expand Down
14 changes: 7 additions & 7 deletions src/core/mcis/nlb.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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.
Expand All @@ -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"`
}

Expand Down