From 436ad11d15b73da2219cab852b2a5d30fbe424d2 Mon Sep 17 00:00:00 2001 From: seokho-son Date: Tue, 10 Oct 2023 11:45:48 +0000 Subject: [PATCH] Update Swagger REST API doc --- src/api/rest/docs/docs.go | 112 ++++++++++++++++++++++++++++----- src/api/rest/docs/swagger.json | 107 +++++++++++++++++++++++++++---- src/api/rest/docs/swagger.yaml | 65 +++++++++++++++---- 3 files changed, 246 insertions(+), 38 deletions(-) diff --git a/src/api/rest/docs/docs.go b/src/api/rest/docs/docs.go index 9b9293e92..0cc7d6479 100644 --- a/src/api/rest/docs/docs.go +++ b/src/api/rest/docs/docs.go @@ -1,5 +1,4 @@ -// Package docs GENERATED BY SWAG; DO NOT EDIT -// This file was generated by swaggo/swag +// Package docs Code generated by swaggo/swag. DO NOT EDIT package docs import "github.com/swaggo/swag" @@ -7430,6 +7429,34 @@ 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": { @@ -7695,7 +7722,11 @@ const docTemplate = `{ }, "iid": { "description": "Fields for response", - "$ref": "#/definitions/common.IID" + "allOf": [ + { + "$ref": "#/definitions/common.IID" + } + ] }, "keyValueList": { "type": "array", @@ -7846,7 +7877,11 @@ const docTemplate = `{ "example": "aws-ap-southeast-1-1" }, "status": { - "type": "string", + "allOf": [ + { + "$ref": "#/definitions/mcir.CustomImageStatus" + } + ], "example": "Available" }, "systemLabel": { @@ -7936,7 +7971,11 @@ const docTemplate = `{ }, "status": { "description": "Available, Unavailable, Attached, ...", - "type": "string", + "allOf": [ + { + "$ref": "#/definitions/mcir.DiskStatus" + } + ], "example": "Available" }, "systemLabel": { @@ -8643,7 +8682,11 @@ 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\"", - "$ref": "#/definitions/mcis.McisCmdReq" + "allOf": [ + { + "$ref": "#/definitions/mcis.McisCmdReq" + } + ] }, "vmDynamicReq": { "$ref": "#/definitions/mcis.TbVmDynamicReq" @@ -9380,6 +9423,17 @@ const docTemplate = `{ } } }, + "mcis.SpiderImageType": { + "type": "string", + "enum": [ + "PublicImage", + "MyImage" + ], + "x-enum-varnames": [ + "PublicImage", + "MyImage" + ] + }, "mcis.SpiderVMInfo": { "type": "object", "properties": { @@ -9401,7 +9455,11 @@ const docTemplate = `{ }, "iid": { "description": "Fields for response", - "$ref": "#/definitions/common.IID" + "allOf": [ + { + "$ref": "#/definitions/common.IID" + } + ] }, "imageIId": { "$ref": "#/definitions/common.IID" @@ -9410,7 +9468,7 @@ const docTemplate = `{ "type": "string" }, "imageType": { - "type": "string" + "$ref": "#/definitions/mcis.SpiderImageType" }, "keyPairIId": { "$ref": "#/definitions/common.IID" @@ -9446,7 +9504,11 @@ const docTemplate = `{ }, "region": { "description": "ex) {us-east1, us-east1-c} or {ap-northeast-2}", - "$ref": "#/definitions/mcis.RegionInfo" + "allOf": [ + { + "$ref": "#/definitions/mcis.RegionInfo" + } + ] }, "rootDeviceName": { "description": "\"/dev/sda1\", ...", @@ -9481,7 +9543,11 @@ const docTemplate = `{ }, "subnetIID": { "description": "AWS, ex) subnet-8c4a53e4", - "$ref": "#/definitions/common.IID" + "allOf": [ + { + "$ref": "#/definitions/common.IID" + } + ] }, "subnetName": { "type": "string" @@ -9964,11 +10030,19 @@ const docTemplate = `{ }, "healthChecker": { "description": "HealthChecker", - "$ref": "#/definitions/mcis.TbNLBHealthCheckerReq" + "allOf": [ + { + "$ref": "#/definitions/mcis.TbNLBHealthCheckerReq" + } + ] }, "listener": { "description": "Frontend", - "$ref": "#/definitions/mcis.NLBListenerReq" + "allOf": [ + { + "$ref": "#/definitions/mcis.NLBListenerReq" + } + ] }, "scope": { "description": "REGION(V) | GLOBAL", @@ -9981,7 +10055,11 @@ const docTemplate = `{ }, "targetGroup": { "description": "Backend", - "$ref": "#/definitions/mcis.TbNLBTargetGroupReq" + "allOf": [ + { + "$ref": "#/definitions/mcis.TbNLBTargetGroupReq" + } + ] }, "type": { "description": "PUBLIC(V) | INTERNAL", @@ -10180,7 +10258,11 @@ const docTemplate = `{ }, "region": { "description": "AWS, ex) {us-east1, us-east1-c} or {ap-northeast-2}", - "$ref": "#/definitions/mcis.RegionInfo" + "allOf": [ + { + "$ref": "#/definitions/mcis.RegionInfo" + } + ] }, "rootDeviceName": { "type": "string" @@ -10577,6 +10659,8 @@ var SwaggerInfo = &swag.Spec{ Description: "CB-Tumblebug REST API", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, + LeftDelim: "{{", + RightDelim: "}}", } func init() { diff --git a/src/api/rest/docs/swagger.json b/src/api/rest/docs/swagger.json index 15601d86a..656efafe6 100644 --- a/src/api/rest/docs/swagger.json +++ b/src/api/rest/docs/swagger.json @@ -7422,6 +7422,34 @@ } } }, + "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": { @@ -7687,7 +7715,11 @@ }, "iid": { "description": "Fields for response", - "$ref": "#/definitions/common.IID" + "allOf": [ + { + "$ref": "#/definitions/common.IID" + } + ] }, "keyValueList": { "type": "array", @@ -7838,7 +7870,11 @@ "example": "aws-ap-southeast-1-1" }, "status": { - "type": "string", + "allOf": [ + { + "$ref": "#/definitions/mcir.CustomImageStatus" + } + ], "example": "Available" }, "systemLabel": { @@ -7928,7 +7964,11 @@ }, "status": { "description": "Available, Unavailable, Attached, ...", - "type": "string", + "allOf": [ + { + "$ref": "#/definitions/mcir.DiskStatus" + } + ], "example": "Available" }, "systemLabel": { @@ -8635,7 +8675,11 @@ }, "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\"", - "$ref": "#/definitions/mcis.McisCmdReq" + "allOf": [ + { + "$ref": "#/definitions/mcis.McisCmdReq" + } + ] }, "vmDynamicReq": { "$ref": "#/definitions/mcis.TbVmDynamicReq" @@ -9372,6 +9416,17 @@ } } }, + "mcis.SpiderImageType": { + "type": "string", + "enum": [ + "PublicImage", + "MyImage" + ], + "x-enum-varnames": [ + "PublicImage", + "MyImage" + ] + }, "mcis.SpiderVMInfo": { "type": "object", "properties": { @@ -9393,7 +9448,11 @@ }, "iid": { "description": "Fields for response", - "$ref": "#/definitions/common.IID" + "allOf": [ + { + "$ref": "#/definitions/common.IID" + } + ] }, "imageIId": { "$ref": "#/definitions/common.IID" @@ -9402,7 +9461,7 @@ "type": "string" }, "imageType": { - "type": "string" + "$ref": "#/definitions/mcis.SpiderImageType" }, "keyPairIId": { "$ref": "#/definitions/common.IID" @@ -9438,7 +9497,11 @@ }, "region": { "description": "ex) {us-east1, us-east1-c} or {ap-northeast-2}", - "$ref": "#/definitions/mcis.RegionInfo" + "allOf": [ + { + "$ref": "#/definitions/mcis.RegionInfo" + } + ] }, "rootDeviceName": { "description": "\"/dev/sda1\", ...", @@ -9473,7 +9536,11 @@ }, "subnetIID": { "description": "AWS, ex) subnet-8c4a53e4", - "$ref": "#/definitions/common.IID" + "allOf": [ + { + "$ref": "#/definitions/common.IID" + } + ] }, "subnetName": { "type": "string" @@ -9956,11 +10023,19 @@ }, "healthChecker": { "description": "HealthChecker", - "$ref": "#/definitions/mcis.TbNLBHealthCheckerReq" + "allOf": [ + { + "$ref": "#/definitions/mcis.TbNLBHealthCheckerReq" + } + ] }, "listener": { "description": "Frontend", - "$ref": "#/definitions/mcis.NLBListenerReq" + "allOf": [ + { + "$ref": "#/definitions/mcis.NLBListenerReq" + } + ] }, "scope": { "description": "REGION(V) | GLOBAL", @@ -9973,7 +10048,11 @@ }, "targetGroup": { "description": "Backend", - "$ref": "#/definitions/mcis.TbNLBTargetGroupReq" + "allOf": [ + { + "$ref": "#/definitions/mcis.TbNLBTargetGroupReq" + } + ] }, "type": { "description": "PUBLIC(V) | INTERNAL", @@ -10172,7 +10251,11 @@ }, "region": { "description": "AWS, ex) {us-east1, us-east1-c} or {ap-northeast-2}", - "$ref": "#/definitions/mcis.RegionInfo" + "allOf": [ + { + "$ref": "#/definitions/mcis.RegionInfo" + } + ] }, "rootDeviceName": { "type": "string" diff --git a/src/api/rest/docs/swagger.yaml b/src/api/rest/docs/swagger.yaml index 804fff05a..099853d25 100644 --- a/src/api/rest/docs/swagger.yaml +++ b/src/api/rest/docs/swagger.yaml @@ -185,6 +185,28 @@ definitions: connectionName: type: string type: object + mcir.CustomImageStatus: + enum: + - Available + - Unavailable + type: string + x-enum-varnames: + - MyImageAvailable + - MyImageUnavailable + mcir.DiskStatus: + enum: + - Creating + - Available + - Attached + - Deleting + - Error + type: string + x-enum-varnames: + - DiskCreating + - DiskAvailable + - DiskAttached + - DiskDeleting + - DiskError mcir.FilterSpecsByRangeRequest: properties: connectionName: @@ -357,7 +379,8 @@ definitions: description: Windows7, Ubuntu etc. type: string iid: - $ref: '#/definitions/common.IID' + allOf: + - $ref: '#/definitions/common.IID' description: Fields for response keyValueList: items: @@ -461,8 +484,9 @@ definitions: example: aws-ap-southeast-1-1 type: string status: + allOf: + - $ref: '#/definitions/mcir.CustomImageStatus' example: Available - type: string systemLabel: description: SystemLabel is for describing the MCIR in a keyword (any string can be used) for special System purpose @@ -525,9 +549,10 @@ definitions: example: aws-ap-southeast-1-datadisk type: string status: + allOf: + - $ref: '#/definitions/mcir.DiskStatus' description: Available, Unavailable, Attached, ... example: Available - type: string systemLabel: description: SystemLabel is for describing the MCIR in a keyword (any string can be used) for special System purpose @@ -1018,7 +1043,8 @@ definitions: example: random type: string postCommand: - $ref: '#/definitions/mcis.McisCmdReq' + allOf: + - $ref: '#/definitions/mcis.McisCmdReq' 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" @@ -1523,6 +1549,14 @@ definitions: host: type: string type: object + mcis.SpiderImageType: + enum: + - PublicImage + - MyImage + type: string + x-enum-varnames: + - PublicImage + - MyImage mcis.SpiderVMInfo: properties: cspid: @@ -1537,14 +1571,15 @@ definitions: type: string type: array iid: - $ref: '#/definitions/common.IID' + allOf: + - $ref: '#/definitions/common.IID' description: Fields for response imageIId: $ref: '#/definitions/common.IID' imageName: type: string imageType: - type: string + $ref: '#/definitions/mcis.SpiderImageType' keyPairIId: $ref: '#/definitions/common.IID' keyPairName: @@ -1568,7 +1603,8 @@ definitions: publicIP: type: string region: - $ref: '#/definitions/mcis.RegionInfo' + allOf: + - $ref: '#/definitions/mcis.RegionInfo' description: ex) {us-east1, us-east1-c} or {ap-northeast-2} rootDeviceName: description: '"/dev/sda1", ...' @@ -1593,7 +1629,8 @@ definitions: startTime: type: string subnetIID: - $ref: '#/definitions/common.IID' + allOf: + - $ref: '#/definitions/common.IID' description: AWS, ex) subnet-8c4a53e4 subnetName: type: string @@ -1947,10 +1984,12 @@ definitions: description: type: string healthChecker: - $ref: '#/definitions/mcis.TbNLBHealthCheckerReq' + allOf: + - $ref: '#/definitions/mcis.TbNLBHealthCheckerReq' description: HealthChecker listener: - $ref: '#/definitions/mcis.NLBListenerReq' + allOf: + - $ref: '#/definitions/mcis.NLBListenerReq' description: Frontend scope: description: REGION(V) | GLOBAL @@ -1960,7 +1999,8 @@ definitions: example: REGION type: string targetGroup: - $ref: '#/definitions/mcis.TbNLBTargetGroupReq' + allOf: + - $ref: '#/definitions/mcis.TbNLBTargetGroupReq' description: Backend type: description: PUBLIC(V) | INTERNAL @@ -2117,7 +2157,8 @@ definitions: publicIP: type: string region: - $ref: '#/definitions/mcis.RegionInfo' + allOf: + - $ref: '#/definitions/mcis.RegionInfo' description: AWS, ex) {us-east1, us-east1-c} or {ap-northeast-2} rootDeviceName: type: string