Skip to content

Commit

Permalink
Merge pull request #1194 from seokho-son/main
Browse files Browse the repository at this point in the history
Add example values for NLB request
  • Loading branch information
jihoon-seo authored Oct 12, 2022
2 parents 0a4e996 + ec4a4c2 commit abe3d71
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 20 deletions.
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

0 comments on commit abe3d71

Please sign in to comment.