Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add customImage mgmt and snapshot features #1190

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions conf/template.credentials.conf
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ CredentialKey05[$IndexCloudit]=TenantId
#Fill in {{YOUR-Cloudit-Credentidal-TenantId}} Ex:tnt1234
CredentialVal05[$IndexCloudit]=#{{YOUR-Cloudit-Credentidal-TenantId}}

CredentialKey06[$IndexCloudit]=ClusterId
#Fill in {{YOUR-Cloudit-Credentidal-ClusterId}} Ex:cluster01
CredentialVal06[$IndexCloudit]=#{{YOUR-Cloudit-Credentidal-ClusterId}}


## Tencent
Expand Down
231 changes: 229 additions & 2 deletions src/api/rest/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2621,7 +2621,7 @@ const docTemplate = `{
"application/json"
],
"tags": [
"[Infra service] MCIS Provisioning management"
"[Infra resource] MCIR Data Disk management"
],
"summary": "Attach/Detach data disk to/from VM",
"parameters": [
Expand Down Expand Up @@ -2690,6 +2690,75 @@ const docTemplate = `{
}
}
}
},
"post": {
"description": "Create VM snapshot",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"[Infra resource] VM snapshot management"
],
"summary": "Create VM snapshot",
"parameters": [
{
"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": "vm01",
"description": "VM ID",
"name": "vmId",
"in": "path",
"required": true
},
{
"enum": [
"snapshot"
],
"type": "string",
"description": "Command to perform",
"name": "command",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/mcir.TbCustomImageInfo"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
}
}
}
},
"/ns/{nsId}/mcis/{mcisId}/vmgroup": {
Expand Down Expand Up @@ -3535,6 +3604,69 @@ const docTemplate = `{
}
}
},
"/ns/{nsId}/resources/customImage": {
"post": {
"description": "Create Custom Image",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"[Infra resource] MCIR Custom Image management"
],
"summary": "Create Custom Image",
"parameters": [
{
"type": "string",
"default": "ns01",
"description": "Namespace ID",
"name": "nsId",
"in": "path",
"required": true
},
{
"enum": [
"register"
],
"type": "string",
"description": "Option: ",
"name": "option",
"in": "query"
},
{
"description": "Details for an Custom Image object",
"name": "customImageInfo",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/mcir.TbCustomImageReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/mcir.TbCustomImageInfo"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
}
}
}
},
"/ns/{nsId}/resources/dataDisk": {
"get": {
"description": "List all Data Disks or Data Disks' ID",
Expand Down Expand Up @@ -6960,6 +7092,90 @@ const docTemplate = `{
}
}
},
"mcir.TbCustomImageInfo": {
"type": "object",
"properties": {
"associatedObjectList": {
"type": "array",
"items": {
"type": "string"
}
},
"connectionName": {
"type": "string"
},
"creationDate": {
"type": "string"
},
"cspCustomImageId": {
"type": "string"
},
"cspCustomImageName": {
"type": "string"
},
"description": {
"type": "string"
},
"guestOS": {
"description": "Windows7, Ubuntu etc.",
"type": "string"
},
"id": {
"type": "string"
},
"isAutoGenerated": {
"type": "boolean"
},
"keyValueList": {
"type": "array",
"items": {
"$ref": "#/definitions/common.KeyValue"
}
},
"name": {
"type": "string"
},
"namespace": {
"description": "required to save in RDB",
"type": "string"
},
"sourceVmId": {
"type": "string"
},
"status": {
"type": "string"
},
"systemLabel": {
"description": "SystemLabel is for describing the MCIR in a keyword (any string can be used) for special System purpose",
"type": "string",
"example": "Managed by CB-Tumblebug"
}
}
},
"mcir.TbCustomImageReq": {
"type": "object",
"required": [
"name"
],
"properties": {
"connectionName": {
"type": "string"
},
"cspCustomImageId": {
"description": "This field is for 'Register existing custom image'",
"type": "string"
},
"description": {
"type": "string"
},
"name": {
"type": "string"
},
"sourceVmId": {
"type": "string"
}
}
},
"mcir.TbDataDiskInfo": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -7021,7 +7237,6 @@ const docTemplate = `{
"required": [
"connectionName",
"diskSize",
"diskType",
"name"
],
"properties": {
Expand Down Expand Up @@ -9285,6 +9500,9 @@ const docTemplate = `{
"mcis.inspectOverview": {
"type": "object",
"properties": {
"customImage": {
"type": "integer"
},
"dataDisk": {
"type": "integer"
},
Expand All @@ -9308,9 +9526,18 @@ const docTemplate = `{
"mcis.registerationOverview": {
"type": "object",
"properties": {
"customImage": {
"type": "integer"
},
"dataDisk": {
"type": "integer"
},
"failed": {
"type": "integer"
},
"nlb": {
"type": "integer"
},
"securityGroup": {
"type": "integer"
},
Expand Down
Loading