Skip to content

Commit

Permalink
Add provisioning DataDisk to VM
Browse files Browse the repository at this point in the history
  • Loading branch information
seokho-son committed Jan 16, 2024
1 parent 131b701 commit 8b99ee5
Show file tree
Hide file tree
Showing 8 changed files with 393 additions and 47 deletions.
2 changes: 1 addition & 1 deletion scripts/runSpider.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

CONTAINER_NAME_READ="CB-Spider"
CONTAINER_VERSION="0.8.0"
CONTAINER_VERSION="0.8.1"
CONTAINER_PORT="-p 1024:1024 -p 2048:2048"
CONTAINER_DATA_PATH="/root/go/src/github.com/cloud-barista/cb-spider/meta_db"

Expand Down
97 changes: 97 additions & 0 deletions src/api/rest/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3264,6 +3264,16 @@ const docTemplate = `{
"name": "option",
"in": "query",
"required": true
},
{
"enum": [
"true",
"false"
],
"type": "string",
"description": "Force to attach/detach even if VM info is not matched",
"name": "force",
"in": "query"
}
],
"responses": {
Expand All @@ -3286,6 +3296,68 @@ const docTemplate = `{
}
}
}
},
"post": {
"description": "Provisioning (Create and attach) dataDisk",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"[Infra resource] MCIR Data Disk management"
],
"summary": "Provisioning (Create and attach) dataDisk",
"parameters": [
{
"description": "Details for an Data Disk object",
"name": "dataDiskInfo",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/mcir.TbDataDiskVmReq"
}
},
{
"type": "string",
"default": "ns01",
"description": "Namespace ID",
"name": "nsId",
"in": "path",
"required": true
},
{
"type": "string",
"default": "mcis01",
"description": "MCIS ID",
"name": "mcisId",
"in": "path",
"required": true
},
{
"type": "string",
"default": "g1-1",
"description": "VM ID",
"name": "vmId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/mcis.TbVmInfo"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
}
}
}
},
"/ns/{nsId}/mcis/{mcisId}/vm/{vmId}/snapshot": {
Expand Down Expand Up @@ -8348,6 +8420,31 @@ const docTemplate = `{
}
}
},
"mcir.TbDataDiskVmReq": {
"type": "object",
"required": [
"diskSize",
"name"
],
"properties": {
"description": {
"type": "string"
},
"diskSize": {
"type": "string",
"default": "100",
"example": "77"
},
"diskType": {
"type": "string",
"example": "default"
},
"name": {
"type": "string",
"example": "aws-ap-southeast-1-datadisk"
}
}
},
"mcir.TbFirewallRuleInfo": {
"type": "object",
"required": [
Expand Down
97 changes: 97 additions & 0 deletions src/api/rest/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -3257,6 +3257,16 @@
"name": "option",
"in": "query",
"required": true
},
{
"enum": [
"true",
"false"
],
"type": "string",
"description": "Force to attach/detach even if VM info is not matched",
"name": "force",
"in": "query"
}
],
"responses": {
Expand All @@ -3279,6 +3289,68 @@
}
}
}
},
"post": {
"description": "Provisioning (Create and attach) dataDisk",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"[Infra resource] MCIR Data Disk management"
],
"summary": "Provisioning (Create and attach) dataDisk",
"parameters": [
{
"description": "Details for an Data Disk object",
"name": "dataDiskInfo",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/mcir.TbDataDiskVmReq"
}
},
{
"type": "string",
"default": "ns01",
"description": "Namespace ID",
"name": "nsId",
"in": "path",
"required": true
},
{
"type": "string",
"default": "mcis01",
"description": "MCIS ID",
"name": "mcisId",
"in": "path",
"required": true
},
{
"type": "string",
"default": "g1-1",
"description": "VM ID",
"name": "vmId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/mcis.TbVmInfo"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
}
}
}
},
"/ns/{nsId}/mcis/{mcisId}/vm/{vmId}/snapshot": {
Expand Down Expand Up @@ -8341,6 +8413,31 @@
}
}
},
"mcir.TbDataDiskVmReq": {
"type": "object",
"required": [
"diskSize",
"name"
],
"properties": {
"description": {
"type": "string"
},
"diskSize": {
"type": "string",
"default": "100",
"example": "77"
},
"diskType": {
"type": "string",
"example": "default"
},
"name": {
"type": "string",
"example": "aws-ap-southeast-1-datadisk"
}
}
},
"mcir.TbFirewallRuleInfo": {
"type": "object",
"required": [
Expand Down
68 changes: 68 additions & 0 deletions src/api/rest/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,24 @@ definitions:
required:
- diskSize
type: object
mcir.TbDataDiskVmReq:
properties:
description:
type: string
diskSize:
default: "100"
example: "77"
type: string
diskType:
example: default
type: string
name:
example: aws-ap-southeast-1-datadisk
type: string
required:
- diskSize
- name
type: object
mcir.TbFirewallRuleInfo:
properties:
cidr:
Expand Down Expand Up @@ -4672,6 +4690,49 @@ paths:
summary: Get available dataDisks for a VM
tags:
- '[Infra resource] MCIR Data Disk management'
post:
consumes:
- application/json
description: Provisioning (Create and attach) dataDisk
parameters:
- description: Details for an Data Disk object
in: body
name: dataDiskInfo
required: true
schema:
$ref: '#/definitions/mcir.TbDataDiskVmReq'
- default: ns01
description: Namespace ID
in: path
name: nsId
required: true
type: string
- default: mcis01
description: MCIS ID
in: path
name: mcisId
required: true
type: string
- default: g1-1
description: VM ID
in: path
name: vmId
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/mcis.TbVmInfo'
"404":
description: Not Found
schema:
$ref: '#/definitions/common.SimpleMsg'
summary: Provisioning (Create and attach) dataDisk
tags:
- '[Infra resource] MCIR Data Disk management'
put:
consumes:
- application/json
Expand Down Expand Up @@ -4708,6 +4769,13 @@ paths:
name: option
required: true
type: string
- description: Force to attach/detach even if VM info is not matched
enum:
- "true"
- "false"
in: query
name: force
type: string
produces:
- application/json
responses:
Expand Down
Loading

0 comments on commit 8b99ee5

Please sign in to comment.