Skip to content

Commit

Permalink
Enhance api description and example
Browse files Browse the repository at this point in the history
  • Loading branch information
cb-github-robot authored Apr 30, 2024
2 parents aeeec95 + 2c036b5 commit 8c0a066
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 443 deletions.
194 changes: 26 additions & 168 deletions src/api/rest/docs/docs.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Package docs Code generated by swaggo/swag. DO NOT EDIT
// Package docs GENERATED BY SWAG; DO NOT EDIT
// This file was generated by swaggo/swag
package docs

import "github.com/swaggo/swag"
Expand Down Expand Up @@ -4207,7 +4208,7 @@ const docTemplate = `{
"required": true
},
{
"description": "Details for MCIS object",
"description": "Request body to provision MCIS dynamically",
"name": "mcisReq",
"in": "body",
"required": true,
Expand Down Expand Up @@ -8461,11 +8462,7 @@ const docTemplate = `{
},
"requestInfo": {
"description": "Extracted information about the request.",
"allOf": [
{
"$ref": "#/definitions/common.RequestInfo"
}
]
"$ref": "#/definitions/common.RequestInfo"
},
"responseData": {
"description": "The data sent back in response to the request."
Expand Down Expand Up @@ -8630,34 +8627,6 @@ const docTemplate = `{
}
}
},
"mcir.CustomImageStatus": {
"type": "string",
"enum": [
"Available",
"Unavailable"
],
"x-enum-varnames": [
"MyImageAvailable",
"MyImageUnavailable"
]
},
"mcir.DiskStatus": {
"type": "string",
"enum": [
"Creating",
"Available",
"Attached",
"Deleting",
"Error"
],
"x-enum-varnames": [
"DiskCreating",
"DiskAvailable",
"DiskAttached",
"DiskDeleting",
"DiskError"
]
},
"mcir.FilterSpecsByRangeRequest": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -8923,11 +8892,7 @@ const docTemplate = `{
},
"iid": {
"description": "Fields for response",
"allOf": [
{
"$ref": "#/definitions/common.IID"
}
]
"$ref": "#/definitions/common.IID"
},
"keyValueList": {
"type": "array",
Expand Down Expand Up @@ -9078,11 +9043,7 @@ const docTemplate = `{
"example": "aws-ap-southeast-1-1"
},
"status": {
"allOf": [
{
"$ref": "#/definitions/mcir.CustomImageStatus"
}
],
"type": "string",
"example": "Available"
},
"systemLabel": {
Expand Down Expand Up @@ -9172,11 +9133,7 @@ const docTemplate = `{
},
"status": {
"description": "Available, Unavailable, Attached, ...",
"allOf": [
{
"$ref": "#/definitions/mcir.DiskStatus"
}
],
"type": "string",
"example": "Available"
},
"systemLabel": {
Expand Down Expand Up @@ -9908,11 +9865,7 @@ const docTemplate = `{
},
"postCommand": {
"description": "PostCommand is field for providing command to VMs after its creation. example:\"wget https://raw.githubusercontent.com/cloud-barista/cb-tumblebug/main/scripts/setweb.sh -O ~/setweb.sh; chmod +x ~/setweb.sh; sudo ~/setweb.sh\"",
"allOf": [
{
"$ref": "#/definitions/mcis.McisCmdReq"
}
]
"$ref": "#/definitions/mcis.McisCmdReq"
},
"vmDynamicReq": {
"$ref": "#/definitions/mcis.TbVmDynamicReq"
Expand Down Expand Up @@ -10030,23 +9983,6 @@ const docTemplate = `{
}
}
},
"mcis.ClusterStatus": {
"type": "string",
"enum": [
"Creating",
"Active",
"Inactive",
"Updating",
"Deleting"
],
"x-enum-varnames": [
"ClusterCreating",
"ClusterActive",
"ClusterInactive",
"ClusterUpdating",
"ClusterDeleting"
]
},
"mcis.DeploymentPlan": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -10232,8 +10168,8 @@ const docTemplate = `{
"type": "string"
},
"example": [
"aws-ap-northeast-2-t2-small",
"gcp-us-west1-g1-small"
"aws+ap-northeast-2+t2.small",
"gcp+us-west1+g1.small"
]
}
}
Expand Down Expand Up @@ -10440,23 +10376,6 @@ const docTemplate = `{
}
}
},
"mcis.NodeGroupStatus": {
"type": "string",
"enum": [
"Creating",
"Active",
"Inactive",
"Updating",
"Deleting"
],
"x-enum-varnames": [
"NodeGroupCreating",
"NodeGroupActive",
"NodeGroupInactive",
"NodeGroupUpdating",
"NodeGroupDeleting"
]
},
"mcis.Operation": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -10688,17 +10607,6 @@ const docTemplate = `{
}
}
},
"mcis.SpiderImageType": {
"type": "string",
"enum": [
"PublicImage",
"MyImage"
],
"x-enum-varnames": [
"PublicImage",
"MyImage"
]
},
"mcis.SpiderVMInfo": {
"type": "object",
"properties": {
Expand All @@ -10720,11 +10628,7 @@ const docTemplate = `{
},
"iid": {
"description": "Fields for response",
"allOf": [
{
"$ref": "#/definitions/common.IID"
}
]
"$ref": "#/definitions/common.IID"
},
"imageIId": {
"$ref": "#/definitions/common.IID"
Expand All @@ -10733,7 +10637,7 @@ const docTemplate = `{
"type": "string"
},
"imageType": {
"$ref": "#/definitions/mcis.SpiderImageType"
"type": "string"
},
"keyPairIId": {
"$ref": "#/definitions/common.IID"
Expand Down Expand Up @@ -10769,11 +10673,7 @@ const docTemplate = `{
},
"region": {
"description": "ex) {us-east1, us-east1-c} or {ap-northeast-2}",
"allOf": [
{
"$ref": "#/definitions/mcis.RegionInfo"
}
]
"$ref": "#/definitions/mcis.RegionInfo"
},
"rootDeviceName": {
"description": "\"/dev/sda1\", ...",
Expand Down Expand Up @@ -10808,11 +10708,7 @@ const docTemplate = `{
},
"subnetIID": {
"description": "AWS, ex) subnet-8c4a53e4",
"allOf": [
{
"$ref": "#/definitions/common.IID"
}
]
"$ref": "#/definitions/common.IID"
},
"subnetName": {
"type": "string"
Expand Down Expand Up @@ -10989,11 +10885,7 @@ const docTemplate = `{
},
"status": {
"description": "Creating, Active, Inactive, Updating, Deleting",
"allOf": [
{
"$ref": "#/definitions/mcis.ClusterStatus"
}
],
"type": "string",
"example": "Creating"
},
"systemLabel": {
Expand Down Expand Up @@ -11089,11 +10981,7 @@ const docTemplate = `{
},
"status": {
"description": "---",
"allOf": [
{
"$ref": "#/definitions/mcis.NodeGroupStatus"
}
],
"type": "string",
"example": "Creating"
}
}
Expand Down Expand Up @@ -11185,7 +11073,7 @@ const docTemplate = `{
"installMonAgent": {
"description": "InstallMonAgent Option for CB-Dragonfly agent installation ([yes/no] default:yes)",
"type": "string",
"default": "yes",
"default": "no",
"enum": [
"yes",
"no"
Expand Down Expand Up @@ -11520,19 +11408,11 @@ const docTemplate = `{
},
"healthChecker": {
"description": "HealthChecker",
"allOf": [
{
"$ref": "#/definitions/mcis.TbNLBHealthCheckerReq"
}
]
"$ref": "#/definitions/mcis.TbNLBHealthCheckerReq"
},
"listener": {
"description": "Frontend",
"allOf": [
{
"$ref": "#/definitions/mcis.NLBListenerReq"
}
]
"$ref": "#/definitions/mcis.NLBListenerReq"
},
"scope": {
"description": "REGION(V) | GLOBAL",
Expand All @@ -11545,11 +11425,7 @@ const docTemplate = `{
},
"targetGroup": {
"description": "Backend",
"allOf": [
{
"$ref": "#/definitions/mcis.TbNLBTargetGroupReq"
}
]
"$ref": "#/definitions/mcis.TbNLBTargetGroupReq"
},
"type": {
"description": "PUBLIC(V) | INTERNAL",
Expand Down Expand Up @@ -11680,7 +11556,7 @@ const docTemplate = `{
"commonSpec": {
"description": "CommonSpec is field for id of a spec in common namespace",
"type": "string",
"example": "aws-ap-northeast-2-t2-small"
"example": "aws+ap-northeast-2+t2.small"
},
"connectionName": {
"description": "if ConnectionName is given, the VM tries to use associtated credential.\nif not, it will use predefined ConnectionName in Spec objects",
Expand All @@ -11702,16 +11578,19 @@ const docTemplate = `{
"rootDiskSize": {
"description": "\"default\", Integer (GB): [\"50\", ..., \"1000\"]",
"type": "string",
"default": "default",
"example": "default, 30, 42, ..."
},
"rootDiskType": {
"description": "\"\", \"default\", \"TYPE1\", AWS: [\"standard\", \"gp2\", \"gp3\"], Azure: [\"PremiumSSD\", \"StandardSSD\", \"StandardHDD\"], GCP: [\"pd-standard\", \"pd-balanced\", \"pd-ssd\", \"pd-extreme\"], ALIBABA: [\"cloud_efficiency\", \"cloud\", \"cloud_essd\"], TENCENT: [\"CLOUD_PREMIUM\", \"CLOUD_SSD\"]",
"type": "string",
"default": "default",
"example": "default, TYPE1, ..."
},
"subGroupSize": {
"description": "if subGroupSize is (not empty) \u0026\u0026 (\u003e 0), subGroup will be gernetad. VMs will be created accordingly.",
"type": "string",
"default": "1",
"example": "3"
},
"vmUserPassword": {
Expand Down Expand Up @@ -11788,11 +11667,7 @@ const docTemplate = `{
},
"region": {
"description": "AWS, ex) {us-east1, us-east1-c} or {ap-northeast-2}",
"allOf": [
{
"$ref": "#/definitions/mcis.RegionInfo"
}
]
"$ref": "#/definitions/mcis.RegionInfo"
},
"rootDeviceName": {
"type": "string"
Expand Down Expand Up @@ -12232,29 +12107,14 @@ const docTemplate = `{
"type": "object",
"properties": {
"type": {
"allOf": [
{
"$ref": "#/definitions/netutil.SubnettingRuleType"
}
],
"type": "string",
"example": "minSubnets"
},
"value": {
"type": "integer",
"example": 2
}
}
},
"netutil.SubnettingRuleType": {
"type": "string",
"enum": [
"minSubnets",
"minHosts"
],
"x-enum-varnames": [
"SubnettingRuleTypeMinSubnets",
"SubnettingRuleTypeMinHosts"
]
}
},
"securityDefinitions": {
Expand All @@ -12274,8 +12134,6 @@ var SwaggerInfo = &swag.Spec{
Description: "CB-Tumblebug REST API",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}

func init() {
Expand Down
Loading

0 comments on commit 8c0a066

Please sign in to comment.