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

Fix incorrect response body of infra recommendation #74

Merged
merged 1 commit into from
Mar 12, 2024
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
3 changes: 2 additions & 1 deletion pkg/api/rest/controller/recommendation.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package controller
import (
"net/http"

"github.com/cloud-barista/cm-beetle/pkg/api/rest/model"
"github.com/cloud-barista/cm-beetle/pkg/api/rest/model/source/infra"
"github.com/cloud-barista/cm-beetle/pkg/core/common"
"github.com/cloud-barista/cm-beetle/pkg/core/recommendation"
Expand All @@ -40,7 +41,7 @@ type RecommendInfraRequest struct {
}

type RecommendInfraResponse struct {
Infrastructure
model.TbMcisDynamicReq
}

// RecommendInfra godoc
Expand Down
43 changes: 33 additions & 10 deletions pkg/api/rest/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1523,21 +1523,44 @@ const docTemplate = `{
},
"controller.RecommendInfraResponse": {
"type": "object",
"required": [
"name",
"vm"
],
"properties": {
"compute": {
"type": "string"
"description": {
"type": "string",
"example": "Made in CB-TB"
},
"disk": {
"type": "string"
"installMonAgent": {
"description": "InstallMonAgent Option for CB-Dragonfly agent installation ([yes/no] default:yes)",
"type": "string",
"default": "yes",
"enum": [
"yes",
"no"
],
"example": "no"
},
"network": {
"type": "string"
"label": {
"description": "Label is for describing the mcis in a keyword (any string can be used)",
"type": "string",
"example": "DynamicVM"
},
"securityGroup": {
"type": "string"
"name": {
"type": "string",
"example": "mcis01"
},
"virtualMachine": {
"type": "string"
"systemLabel": {
"description": "SystemLabel is for describing the mcis in a keyword (any string can be used) for special System purpose",
"type": "string",
"example": ""
},
"vm": {
"type": "array",
"items": {
"$ref": "#/definitions/model.TbVmDynamicReq"
}
}
}
},
Expand Down
43 changes: 33 additions & 10 deletions pkg/api/rest/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1516,21 +1516,44 @@
},
"controller.RecommendInfraResponse": {
"type": "object",
"required": [
"name",
"vm"
],
"properties": {
"compute": {
"type": "string"
"description": {
"type": "string",
"example": "Made in CB-TB"
},
"disk": {
"type": "string"
"installMonAgent": {
"description": "InstallMonAgent Option for CB-Dragonfly agent installation ([yes/no] default:yes)",
"type": "string",
"default": "yes",
"enum": [
"yes",
"no"
],
"example": "no"
},
"network": {
"type": "string"
"label": {
"description": "Label is for describing the mcis in a keyword (any string can be used)",
"type": "string",
"example": "DynamicVM"
},
"securityGroup": {
"type": "string"
"name": {
"type": "string",
"example": "mcis01"
},
"virtualMachine": {
"type": "string"
"systemLabel": {
"description": "SystemLabel is for describing the mcis in a keyword (any string can be used) for special System purpose",
"type": "string",
"example": ""
},
"vm": {
"type": "array",
"items": {
"$ref": "#/definitions/model.TbVmDynamicReq"
}
}
}
},
Expand Down
32 changes: 27 additions & 5 deletions pkg/api/rest/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -345,16 +345,38 @@ definitions:
type: object
controller.RecommendInfraResponse:
properties:
compute:
description:
example: Made in CB-TB
type: string
disk:
installMonAgent:
default: "yes"
description: InstallMonAgent Option for CB-Dragonfly agent installation ([yes/no]
default:yes)
enum:
- "yes"
- "no"
example: "no"
type: string
network:
label:
description: Label is for describing the mcis in a keyword (any string can
be used)
example: DynamicVM
type: string
securityGroup:
name:
example: mcis01
type: string
virtualMachine:
systemLabel:
description: SystemLabel is for describing the mcis in a keyword (any string
can be used) for special System purpose
example: ""
type: string
vm:
items:
$ref: '#/definitions/model.TbVmDynamicReq'
type: array
required:
- name
- vm
type: object
controller.UpdateUserRequest:
properties:
Expand Down