Skip to content

Commit

Permalink
[Workflow] Update Swagger REST API doc
Browse files Browse the repository at this point in the history
  • Loading branch information
cb-github-robot authored Nov 16, 2023
2 parents 2acc68b + d3aa2a2 commit c9a9337
Show file tree
Hide file tree
Showing 3 changed files with 759 additions and 3 deletions.
286 changes: 285 additions & 1 deletion pkg/api/rest/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,144 @@ const docTemplate = `{
}
}
},
"/migration/infra/instance": {
"post": {
"description": "It migrates instance on a cloud platform. Storage includes name, spec, OS, and so on.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"[Migration] Infrastructure"
],
"summary": "(Skeleton) Migrate instance on a cloud platform",
"parameters": [
{
"description": "Specify name, spec, OS, and so on.",
"name": "InstanceInfo",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/migration.MigrateInstanceRequest"
}
}
],
"responses": {
"200": {
"description": "Successfully migrated storage on a cloud platform",
"schema": {
"$ref": "#/definitions/migration.MigrateInstanceResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
}
}
}
},
"/migration/infra/network": {
"post": {
"description": "It migrates network on a cloud platform. Network includes name, ID, IPv4 CIDR block, IPv6 CIDR block, and so on.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"[Migration] Infrastructure"
],
"summary": "(Skeleton) Migrate network on a cloud platform",
"parameters": [
{
"description": "Specify name, IPv4 CIDR block, etc.",
"name": "NetworkInfo",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/migration.MigrateNetworkRequest"
}
}
],
"responses": {
"200": {
"description": "Successfully migrated network on a cloud platform",
"schema": {
"$ref": "#/definitions/migration.MigrateNetworkResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
}
}
}
},
"/migration/infra/storage": {
"post": {
"description": "It migrates storage on a cloud platform. Storage includes name, ID, type, size, and so on.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"[Migration] Infrastructure"
],
"summary": "(Skeleton) Migrate storage on a cloud platform",
"parameters": [
{
"description": "Specify name, type, size, affiliated Network ID, and so on.",
"name": "StorageInfo",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/migration.MigrateStorageRequest"
}
}
],
"responses": {
"200": {
"description": "Successfully migrated storage on a cloud platform",
"schema": {
"$ref": "#/definitions/migration.MigrateStorageResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
}
}
}
},
"/ns": {
"get": {
"description": "List all namespaces or namespaces' ID",
Expand Down Expand Up @@ -939,6 +1077,132 @@ const docTemplate = `{
}
}
},
"migration.MigrateInstanceRequest": {
"type": "object",
"properties": {
"NetworkId": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"os": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"migration.MigrateInstanceResponse": {
"type": "object",
"properties": {
"NetworkId": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"os": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"migration.MigrateNetworkRequest": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"ipv4CidrBlock": {
"type": "string"
},
"ipv6CidrBlock": {
"type": "string"
},
"name": {
"type": "string"
},
"subnets": {
"type": "array",
"items": {
"$ref": "#/definitions/migration.Subnet"
}
}
}
},
"migration.MigrateNetworkResponse": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"ipv4CidrBlock": {
"type": "string"
},
"ipv6CidrBlock": {
"type": "string"
},
"name": {
"type": "string"
},
"subnets": {
"type": "array",
"items": {
"$ref": "#/definitions/migration.Subnet"
}
}
}
},
"migration.MigrateStorageRequest": {
"type": "object",
"properties": {
"NetworkId": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"size": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"migration.MigrateStorageResponse": {
"type": "object",
"properties": {
"NetworkId": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"size": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"migration.RegionInfo": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1136,6 +1400,26 @@ const docTemplate = `{
}
}
},
"migration.Subnet": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"ipv4CidrBlock": {
"type": "string"
},
"ipv6CidrBlock": {
"type": "string"
},
"name": {
"type": "string"
},
"parentNetworkId": {
"type": "string"
}
}
},
"migration.TbVmDynamicReq": {
"type": "object",
"required": [
Expand Down Expand Up @@ -1185,7 +1469,7 @@ const docTemplate = `{
"type": "string",
"example": "3"
},
"vmUserPassword default:": {
"vmUserPassword": {
"type": "string"
}
}
Expand Down
Loading

0 comments on commit c9a9337

Please sign in to comment.