diff --git a/pkg/api/rest/docs/docs.go b/pkg/api/rest/docs/docs.go index ca1708d..7b43974 100644 --- a/pkg/api/rest/docs/docs.go +++ b/pkg/api/rest/docs/docs.go @@ -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", @@ -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": { @@ -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": [ @@ -1185,7 +1469,7 @@ const docTemplate = `{ "type": "string", "example": "3" }, - "vmUserPassword default:": { + "vmUserPassword": { "type": "string" } } diff --git a/pkg/api/rest/docs/swagger.json b/pkg/api/rest/docs/swagger.json index cb3d9e2..4545701 100644 --- a/pkg/api/rest/docs/swagger.json +++ b/pkg/api/rest/docs/swagger.json @@ -324,6 +324,144 @@ } } }, + "/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", @@ -932,6 +1070,132 @@ } } }, + "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": { @@ -1129,6 +1393,26 @@ } } }, + "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": [ @@ -1178,7 +1462,7 @@ "type": "string", "example": "3" }, - "vmUserPassword default:": { + "vmUserPassword": { "type": "string" } } diff --git a/pkg/api/rest/docs/swagger.yaml b/pkg/api/rest/docs/swagger.yaml index 1888f7f..c401a6f 100644 --- a/pkg/api/rest/docs/swagger.yaml +++ b/pkg/api/rest/docs/swagger.yaml @@ -213,6 +213,88 @@ definitions: $ref: '#/definitions/migration.TbVmInfo' type: array type: object + migration.MigrateInstanceRequest: + properties: + NetworkId: + type: string + id: + type: string + name: + type: string + os: + type: string + type: + type: string + type: object + migration.MigrateInstanceResponse: + properties: + NetworkId: + type: string + id: + type: string + name: + type: string + os: + type: string + type: + type: string + type: object + migration.MigrateNetworkRequest: + properties: + id: + type: string + ipv4CidrBlock: + type: string + ipv6CidrBlock: + type: string + name: + type: string + subnets: + items: + $ref: '#/definitions/migration.Subnet' + type: array + type: object + migration.MigrateNetworkResponse: + properties: + id: + type: string + ipv4CidrBlock: + type: string + ipv6CidrBlock: + type: string + name: + type: string + subnets: + items: + $ref: '#/definitions/migration.Subnet' + type: array + type: object + migration.MigrateStorageRequest: + properties: + NetworkId: + type: string + id: + type: string + name: + type: string + size: + type: string + type: + type: string + type: object + migration.MigrateStorageResponse: + properties: + NetworkId: + type: string + id: + type: string + name: + type: string + size: + type: string + type: + type: string + type: object migration.RegionInfo: properties: region: @@ -346,6 +428,19 @@ definitions: description: CountUndefined is for counting Undefined type: integer type: object + migration.Subnet: + properties: + id: + type: string + ipv4CidrBlock: + type: string + ipv6CidrBlock: + type: string + name: + type: string + parentNetworkId: + type: string + type: object migration.TbVmDynamicReq: properties: commonImage: @@ -388,7 +483,7 @@ definitions: VMs will be created accordingly. example: "3" type: string - 'vmUserPassword default:': + vmUserPassword: type: string required: - commonImage @@ -728,6 +823,99 @@ paths: summary: Migrate an infrastructure on a cloud platform tags: - '[Migration] Infrastructure' + /migration/infra/instance: + post: + consumes: + - application/json + description: It migrates instance on a cloud platform. Storage includes name, + spec, OS, and so on. + parameters: + - description: Specify name, spec, OS, and so on. + in: body + name: InstanceInfo + required: true + schema: + $ref: '#/definitions/migration.MigrateInstanceRequest' + produces: + - application/json + 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' + summary: (Skeleton) Migrate instance on a cloud platform + tags: + - '[Migration] Infrastructure' + /migration/infra/network: + post: + consumes: + - application/json + description: It migrates network on a cloud platform. Network includes name, + ID, IPv4 CIDR block, IPv6 CIDR block, and so on. + parameters: + - description: Specify name, IPv4 CIDR block, etc. + in: body + name: NetworkInfo + required: true + schema: + $ref: '#/definitions/migration.MigrateNetworkRequest' + produces: + - application/json + 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' + summary: (Skeleton) Migrate network on a cloud platform + tags: + - '[Migration] Infrastructure' + /migration/infra/storage: + post: + consumes: + - application/json + description: It migrates storage on a cloud platform. Storage includes name, + ID, type, size, and so on. + parameters: + - description: Specify name, type, size, affiliated Network ID, and so on. + in: body + name: StorageInfo + required: true + schema: + $ref: '#/definitions/migration.MigrateStorageRequest' + produces: + - application/json + 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' + summary: (Skeleton) Migrate storage on a cloud platform + tags: + - '[Migration] Infrastructure' /ns: delete: consumes: