From 4e4e77ed15f72a9ac166fea48a69ecba57611f08 Mon Sep 17 00:00:00 2001 From: Seokho Son Date: Fri, 23 Aug 2024 15:19:32 +0900 Subject: [PATCH] Fix api validation warnning --- src/api/rest/docs/docs.go | 9 ++++++++- src/api/rest/docs/swagger.json | 9 ++++++++- src/api/rest/docs/swagger.yaml | 7 ++++++- src/api/rest/server/infra/nlb.go | 2 +- src/api/rest/server/resource/firewallrule.go | 1 + 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/api/rest/docs/docs.go b/src/api/rest/docs/docs.go index ed522c847..3a5068001 100644 --- a/src/api/rest/docs/docs.go +++ b/src/api/rest/docs/docs.go @@ -3625,7 +3625,7 @@ const docTemplate = `{ "required": true }, { - "description": "VMs to add to NLB", + "description": "Select VMs to remove from NLB", "name": "nlbAddRemoveVMReq", "in": "body", "required": true, @@ -6834,6 +6834,13 @@ const docTemplate = `{ "in": "path", "required": true }, + { + "type": "string", + "description": "Security Group ID", + "name": "securityGroupId", + "in": "path", + "required": true + }, { "description": "FirewallRules to create", "name": "firewallRuleReq", diff --git a/src/api/rest/docs/swagger.json b/src/api/rest/docs/swagger.json index 8ccf96da2..90e2bbcb6 100644 --- a/src/api/rest/docs/swagger.json +++ b/src/api/rest/docs/swagger.json @@ -3618,7 +3618,7 @@ "required": true }, { - "description": "VMs to add to NLB", + "description": "Select VMs to remove from NLB", "name": "nlbAddRemoveVMReq", "in": "body", "required": true, @@ -6827,6 +6827,13 @@ "in": "path", "required": true }, + { + "type": "string", + "description": "Security Group ID", + "name": "securityGroupId", + "in": "path", + "required": true + }, { "description": "FirewallRules to create", "name": "firewallRuleReq", diff --git a/src/api/rest/docs/swagger.yaml b/src/api/rest/docs/swagger.yaml index 3809cc469..ba668cf7f 100644 --- a/src/api/rest/docs/swagger.yaml +++ b/src/api/rest/docs/swagger.yaml @@ -5641,7 +5641,7 @@ paths: name: nlbId required: true type: string - - description: VMs to add to NLB + - description: Select VMs to remove from NLB in: body name: nlbAddRemoveVMReq required: true @@ -7913,6 +7913,11 @@ paths: name: nsId required: true type: string + - description: Security Group ID + in: path + name: securityGroupId + required: true + type: string - description: FirewallRules to create in: body name: firewallRuleReq diff --git a/src/api/rest/server/infra/nlb.go b/src/api/rest/server/infra/nlb.go index 9290b3f32..6f075de52 100644 --- a/src/api/rest/server/infra/nlb.go +++ b/src/api/rest/server/infra/nlb.go @@ -322,7 +322,7 @@ func RestAddNLBVMs(c echo.Context) error { // @Param nsId path string true "Namespace ID" default(default) // @Param mciId path string true "MCI ID" default(mci01) // @Param nlbId path string true "NLB ID" default(g1) -// @Param nlbAddRemoveVMReq body infra.TbNLBAddRemoveVMReq true "VMs to add to NLB" +// @Param nlbAddRemoveVMReq body infra.TbNLBAddRemoveVMReq true "Select VMs to remove from NLB" // @Success 200 {object} common.SimpleMsg // @Failure 404 {object} common.SimpleMsg // @Router /ns/{nsId}/mci/{mciId}/nlb/{nlbId}/vm [delete] diff --git a/src/api/rest/server/resource/firewallrule.go b/src/api/rest/server/resource/firewallrule.go index 896dc8b16..4c3f5a07d 100644 --- a/src/api/rest/server/resource/firewallrule.go +++ b/src/api/rest/server/resource/firewallrule.go @@ -34,6 +34,7 @@ type TbFirewallRulesWrapper struct { // @Accept json // @Produce json // @Param nsId path string true "Namespace ID" default(default) +// @Param securityGroupId path string true "Security Group ID" // @Param firewallRuleReq body TbFirewallRulesWrapper true "FirewallRules to create" // @Success 200 {object} resource.TbSecurityGroupInfo // @Failure 404 {object} common.SimpleMsg