Skip to content

Commit

Permalink
Update Swagger REST API doc
Browse files Browse the repository at this point in the history
  • Loading branch information
seokho-son authored and web-flow committed Oct 7, 2024
1 parent 591ce13 commit ee2cb88
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 72 deletions.
78 changes: 52 additions & 26 deletions src/api/rest/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -10614,14 +10614,18 @@ const docTemplate = `{
},
"model.IID": {
"type": "object",
"required": [
"NameId",
"SystemId"
],
"properties": {
"nameId": {
"description": "NameID by user",
"type": "string"
"NameId": {
"type": "string",
"example": "user-defined-name"
},
"systemId": {
"description": "SystemID by CloudOS",
"type": "string"
"SystemId": {
"type": "string",
"example": "csp-defined-id"
}
}
},
Expand Down Expand Up @@ -11912,64 +11916,86 @@ const docTemplate = `{
},
"model.SpiderNodeGroupInfo": {
"type": "object",
"required": [
"DesiredNodeSize",
"IId",
"ImageIID",
"KeyPairIID",
"MaxNodeSize",
"MinNodeSize",
"OnAutoScaling",
"Status",
"VMSpecName"
],
"properties": {
"desiredNodeSize": {
"type": "integer"
"DesiredNodeSize": {
"type": "integer",
"example": 2
},
"iid": {
"IId": {
"description": "{NameId, SystemId}",
"allOf": [
{
"$ref": "#/definitions/model.IID"
}
]
},
"imageIID": {
"ImageIID": {
"description": "VM config.",
"allOf": [
{
"$ref": "#/definitions/model.IID"
}
]
},
"keyPairIID": {
"KeyPairIID": {
"$ref": "#/definitions/model.IID"
},
"keyValueList": {
"KeyValueList": {
"type": "array",
"items": {
"$ref": "#/definitions/model.KeyValue"
}
},
"maxNodeSize": {
"type": "integer"
"MaxNodeSize": {
"type": "integer",
"example": 3
},
"minNodeSize": {
"type": "integer"
"MinNodeSize": {
"type": "integer",
"example": 1
},
"nodes": {
"Nodes": {
"type": "array",
"items": {
"$ref": "#/definitions/model.IID"
}
},
"onAutoScaling": {
"OnAutoScaling": {
"description": "Scaling config.",
"type": "boolean"
"type": "boolean",
"example": true
},
"rootDiskSize": {
"RootDiskSize": {
"description": "\"\", \"default\", \"50\", \"1000\" (GB)",
"type": "string"
"type": "string",
"example": "50"
},
"rootDiskType": {
"RootDiskType": {
"description": "\"SSD(gp2)\", \"Premium SSD\", ...",
"type": "string"
},
"status": {
"$ref": "#/definitions/model.SpiderNodeGroupStatus"
"Status": {
"allOf": [
{
"$ref": "#/definitions/model.SpiderNodeGroupStatus"
}
],
"example": "Active"
},
"vmspecName": {
"type": "string"
"VMSpecName": {
"type": "string",
"example": "t3.medium"
}
}
},
Expand Down
78 changes: 52 additions & 26 deletions src/api/rest/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -10607,14 +10607,18 @@
},
"model.IID": {
"type": "object",
"required": [
"NameId",
"SystemId"
],
"properties": {
"nameId": {
"description": "NameID by user",
"type": "string"
"NameId": {
"type": "string",
"example": "user-defined-name"
},
"systemId": {
"description": "SystemID by CloudOS",
"type": "string"
"SystemId": {
"type": "string",
"example": "csp-defined-id"
}
}
},
Expand Down Expand Up @@ -11905,64 +11909,86 @@
},
"model.SpiderNodeGroupInfo": {
"type": "object",
"required": [
"DesiredNodeSize",
"IId",
"ImageIID",
"KeyPairIID",
"MaxNodeSize",
"MinNodeSize",
"OnAutoScaling",
"Status",
"VMSpecName"
],
"properties": {
"desiredNodeSize": {
"type": "integer"
"DesiredNodeSize": {
"type": "integer",
"example": 2
},
"iid": {
"IId": {
"description": "{NameId, SystemId}",
"allOf": [
{
"$ref": "#/definitions/model.IID"
}
]
},
"imageIID": {
"ImageIID": {
"description": "VM config.",
"allOf": [
{
"$ref": "#/definitions/model.IID"
}
]
},
"keyPairIID": {
"KeyPairIID": {
"$ref": "#/definitions/model.IID"
},
"keyValueList": {
"KeyValueList": {
"type": "array",
"items": {
"$ref": "#/definitions/model.KeyValue"
}
},
"maxNodeSize": {
"type": "integer"
"MaxNodeSize": {
"type": "integer",
"example": 3
},
"minNodeSize": {
"type": "integer"
"MinNodeSize": {
"type": "integer",
"example": 1
},
"nodes": {
"Nodes": {
"type": "array",
"items": {
"$ref": "#/definitions/model.IID"
}
},
"onAutoScaling": {
"OnAutoScaling": {
"description": "Scaling config.",
"type": "boolean"
"type": "boolean",
"example": true
},
"rootDiskSize": {
"RootDiskSize": {
"description": "\"\", \"default\", \"50\", \"1000\" (GB)",
"type": "string"
"type": "string",
"example": "50"
},
"rootDiskType": {
"RootDiskType": {
"description": "\"SSD(gp2)\", \"Premium SSD\", ...",
"type": "string"
},
"status": {
"$ref": "#/definitions/model.SpiderNodeGroupStatus"
"Status": {
"allOf": [
{
"$ref": "#/definitions/model.SpiderNodeGroupStatus"
}
],
"example": "Active"
},
"vmspecName": {
"type": "string"
"VMSpecName": {
"type": "string",
"example": "t3.medium"
}
}
},
Expand Down
62 changes: 42 additions & 20 deletions src/api/rest/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7992,14 +7992,17 @@ components:
vCPU:
$ref: '#/components/schemas/model.Range'
model.IID:
required:
- NameId
- SystemId
type: object
properties:
nameId:
NameId:
type: string
description: NameID by user
systemId:
example: user-defined-name
SystemId:
type: string
description: SystemID by CloudOS
example: csp-defined-id
model.IdList:
type: object
properties:
Expand Down Expand Up @@ -8866,47 +8869,66 @@ components:
allOf:
- $ref: '#/components/schemas/model.IID'
model.SpiderNodeGroupInfo:
type: object
properties:
desiredNodeSize:
required:
- DesiredNodeSize
- IId
- ImageIID
- KeyPairIID
- MaxNodeSize
- MinNodeSize
- OnAutoScaling
- Status
- VMSpecName
type: object
properties:
DesiredNodeSize:
type: integer
iid:
example: 2
IId:
type: object
description: "{NameId, SystemId}"
allOf:
- $ref: '#/components/schemas/model.IID'
imageIID:
ImageIID:
type: object
description: VM config.
allOf:
- $ref: '#/components/schemas/model.IID'
keyPairIID:
KeyPairIID:
$ref: '#/components/schemas/model.IID'
keyValueList:
KeyValueList:
type: array
items:
$ref: '#/components/schemas/model.KeyValue'
maxNodeSize:
MaxNodeSize:
type: integer
minNodeSize:
example: 3
MinNodeSize:
type: integer
nodes:
example: 1
Nodes:
type: array
items:
$ref: '#/components/schemas/model.IID'
onAutoScaling:
OnAutoScaling:
type: boolean
description: Scaling config.
rootDiskSize:
example: true
RootDiskSize:
type: string
description: "\"\", \"default\", \"50\", \"1000\" (GB)"
rootDiskType:
example: "50"
RootDiskType:
type: string
description: "\"SSD(gp2)\", \"Premium SSD\", ..."
status:
$ref: '#/components/schemas/model.SpiderNodeGroupStatus'
vmspecName:
Status:
type: object
example: Active
allOf:
- $ref: '#/components/schemas/model.SpiderNodeGroupStatus'
VMSpecName:
type: string
example: t3.medium
model.SpiderNodeGroupStatus:
type: string
enum:
Expand Down

0 comments on commit ee2cb88

Please sign in to comment.