Skip to content

Commit

Permalink
Update and test recommendation feature
Browse files Browse the repository at this point in the history
* Align with Tumblebug 0.9.10
* Enhance the response of infra recommendation for API users
  - Check the recommended infra info and set status, which are "none", "partial", and "ok"
  • Loading branch information
yunkon-kim committed Sep 6, 2024
1 parent adb5636 commit f1d3f4c
Show file tree
Hide file tree
Showing 12 changed files with 488 additions and 440 deletions.
188 changes: 101 additions & 87 deletions api/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,13 @@ const docTemplate = `{
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/github_com_cloud-barista_cm-beetle_pkg_core_common.SimpleMsg"
"$ref": "#/definitions/common.SimpleMsg"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/github_com_cloud-barista_cm-beetle_pkg_core_common.SimpleMsg"
"$ref": "#/definitions/common.SimpleMsg"
}
}
}
Expand Down Expand Up @@ -555,6 +555,15 @@ const docTemplate = `{
}
}
},
"common.SimpleMsg": {
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "Any message"
}
}
},
"controller.CreateUserRequest": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -632,7 +641,7 @@ const docTemplate = `{
"vm": {
"type": "array",
"items": {
"$ref": "#/definitions/mci.TbVmDynamicReq"
"$ref": "#/definitions/model.TbVmDynamicReq"
}
}
}
Expand Down Expand Up @@ -675,7 +684,7 @@ const docTemplate = `{
"vm": {
"type": "array",
"items": {
"$ref": "#/definitions/mci.TbVmDynamicReq"
"$ref": "#/definitions/model.TbVmDynamicReq"
}
}
}
Expand Down Expand Up @@ -724,44 +733,15 @@ const docTemplate = `{
},
"controller.RecommendInfraResponse": {
"type": "object",
"required": [
"name",
"vm"
],
"properties": {
"description": {
"type": "string",
"example": "Made in CB-TB"
},
"installMonAgent": {
"description": "InstallMonAgent Option for CB-Dragonfly agent installation ([yes/no] default:yes)",
"type": "string",
"default": "no",
"enum": [
"yes",
"no"
],
"example": "no"
},
"label": {
"description": "Label is for describing the mci in a keyword (any string can be used)",
"type": "string",
"example": "DynamicVM"
},
"name": {
"type": "string",
"example": "mci01"
"type": "string"
},
"systemLabel": {
"description": "SystemLabel is for describing the mci in a keyword (any string can be used) for special System purpose",
"type": "string",
"example": ""
"status": {
"type": "string"
},
"vm": {
"type": "array",
"items": {
"$ref": "#/definitions/mci.TbVmDynamicReq"
}
"targetInfra": {
"$ref": "#/definitions/model.TbMciDynamicReq"
}
}
},
Expand Down Expand Up @@ -793,15 +773,6 @@ const docTemplate = `{
}
}
},
"github_com_cloud-barista_cm-beetle_pkg_core_common.SimpleMsg": {
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "Any message"
}
}
},
"infra.CPU": {
"type": "object",
"required": [
Expand Down Expand Up @@ -1165,7 +1136,89 @@ const docTemplate = `{
}
}
},
"mci.TbVmDynamicReq": {
"model.MyUser": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"id": {
"type": "integer"
},
"name": {
"type": "string"
}
}
},
"model.Response": {
"type": "object",
"properties": {
"details": {
"type": "string",
"example": "Any details"
},
"list": {
"type": "array",
"items": {}
},
"object": {
"type": "object",
"additionalProperties": true
},
"success": {
"type": "boolean",
"example": true
},
"text": {
"type": "string",
"example": "Any text"
}
}
},
"model.TbMciDynamicReq": {
"type": "object",
"required": [
"name",
"vm"
],
"properties": {
"description": {
"type": "string",
"example": "Made in CB-TB"
},
"installMonAgent": {
"description": "InstallMonAgent Option for CB-Dragonfly agent installation ([yes/no] default:yes)",
"type": "string",
"default": "no",
"enum": [
"yes",
"no"
],
"example": "no"
},
"label": {
"description": "Label is for describing the mci in a keyword (any string can be used)",
"type": "string",
"example": "DynamicVM"
},
"name": {
"type": "string",
"example": "mci01"
},
"systemLabel": {
"description": "SystemLabel is for describing the mci in a keyword (any string can be used) for special System purpose",
"type": "string",
"example": ""
},
"vm": {
"type": "array",
"items": {
"$ref": "#/definitions/model.TbVmDynamicReq"
}
}
}
},
"model.TbVmDynamicReq": {
"type": "object",
"required": [
"commonImage",
Expand Down Expand Up @@ -1222,45 +1275,6 @@ const docTemplate = `{
}
}
},
"model.MyUser": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"id": {
"type": "integer"
},
"name": {
"type": "string"
}
}
},
"model.Response": {
"type": "object",
"properties": {
"details": {
"type": "string",
"example": "Any details"
},
"list": {
"type": "array",
"items": {}
},
"object": {
"type": "object",
"additionalProperties": true
},
"success": {
"type": "boolean",
"example": true
},
"text": {
"type": "string",
"example": "Any text"
}
}
},
"network.CSP": {
"type": "object",
"properties": {
Expand Down
Loading

0 comments on commit f1d3f4c

Please sign in to comment.