{
  "swagger": "2.0",
  "info": {
    "title": "Migration APIs for TiDB Cloud",
    "version": "alpha"
  },
  "tags": [
    {
      "name": "MigrationService"
    }
  ],
  "schemes": ["https"],
  "consumes": ["application/json"],
  "produces": ["application/json"],
  "paths": {
    "/api/v1/serverless/migration/supported-sources": {
      "get": {
        "operationId": "MigrationService_GetSupportedSources",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/GetSupportedSourcesResp"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "provider",
            "in": "query",
            "required": false,
            "type": "string",
            "enum": ["CLOUD_PROVIDER_ALICLOUD", "CLOUD_PROVIDER_AWS"]
          }
        ],
        "tags": ["MigrationService"]
      }
    },
    "/api/v1/serverless/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/migration/ip-whitelist": {
      "get": {
        "operationId": "MigrationService_GetIpWhitelist",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/GetIpWhitelistResp"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": ["MigrationService"]
      }
    },
    "/api/v1/serverless/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/migration/precheck": {
      "post": {
        "summary": "re-use the param of CreateTask",
        "operationId": "MigrationService_Precheck",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/CreateMigrationPrecheckResp"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/MigrationService.PrecheckBody"
            }
          }
        ],
        "tags": ["MigrationService"]
      }
    },
    "/api/v1/serverless/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/migration/precheck/{id}": {
      "get": {
        "operationId": "MigrationService_GetPrecheck",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/MigrationPrecheck"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": ["MigrationService"]
      },
      "delete": {
        "operationId": "MigrationService_CancelPrecheck",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/EmptyResp"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": ["MigrationService"]
      }
    },
    "/api/v1/serverless/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/migration/tasks": {
      "get": {
        "operationId": "MigrationService_ListTasks",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/ListMigrationTasksResp"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "page_token",
            "description": "Optional. The page token, default is empty.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "page_size",
            "description": "Optional. The page size, default is 10.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "order_by",
            "description": "Specifies the sorting order of results. Use a comma-separated list of field names, optionally appending `desc` for descending order. For example, `createTime desc`. By default, fields are sorted in ascending order.\n\nSupported field: `createTime`.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": ["MigrationService"]
      },
      "post": {
        "operationId": "MigrationService_CreateTask",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/MigrationTask"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/MigrationService.CreateTaskBody"
            }
          }
        ],
        "tags": ["MigrationService"]
      }
    },
    "/api/v1/serverless/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/migration/tasks/{id}": {
      "get": {
        "operationId": "MigrationService_GetTask",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/MigrationTask"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": ["MigrationService"]
      },
      "delete": {
        "operationId": "MigrationService_DeleteTask",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/MigrationTask"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": ["MigrationService"]
      }
    },
    "/api/v1/serverless/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/migration/tasks/{id}:pause": {
      "post": {
        "operationId": "MigrationService_PauseTask",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/EmptyResp"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/MigrationService.PauseTaskBody"
            }
          }
        ],
        "tags": ["MigrationService"]
      }
    },
    "/api/v1/serverless/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/migration/tasks/{id}:resume": {
      "post": {
        "operationId": "MigrationService_ResumeTask",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/EmptyResp"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/MigrationService.ResumeTaskBody"
            }
          }
        ],
        "tags": ["MigrationService"]
      }
    },
    "/api/v1/serverless/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/migration:createVpcEndpoint": {
      "post": {
        "operationId": "MigrationService_CreateVpcEndpoint",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/CreateEndpointResp"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/MigrationService.CreateVpcEndpointBody"
            }
          }
        ],
        "tags": ["MigrationService"]
      }
    },
    "/api/v1/serverless/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/migration:describeVpcEndpoint": {
      "post": {
        "operationId": "MigrationService_DescribeVpcEndpoint",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/DescribeEndpointResp"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/MigrationService.DescribeVpcEndpointBody"
            }
          }
        ],
        "tags": ["MigrationService"]
      }
    },
    "/api/v1/serverless/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/migration:getSourceTables": {
      "post": {
        "operationId": "MigrationService_GetSourceTables",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/GetSourceTablesResp"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/MigrationService.GetSourceTablesBody"
            }
          }
        ],
        "tags": ["MigrationService"]
      }
    },
    "/api/v1/serverless/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/migration:getVpcInfo": {
      "post": {
        "operationId": "MigrationService_GetVpcInfo",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/GetVpcInfoResp"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/MigrationService.GetVpcInfoBody"
            }
          }
        ],
        "tags": ["MigrationService"]
      }
    },
    "/api/v1/serverless/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/migration:validateSourceConnection": {
      "post": {
        "operationId": "MigrationService_ValidateMigrationSourceConn",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/EmptyResp"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/MigrationService.ValidateMigrationSourceConnBody"
            }
          }
        ],
        "tags": ["MigrationService"]
      }
    },
    "/api/v1/serverless/orgs/{org_id}/projects/{project_id}/clusters/{cluster_id}/migration:validateTargetConnection": {
      "post": {
        "operationId": "MigrationService_ValidateMigrationTargetConn",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/EmptyResp"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/Status"
            }
          }
        },
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "cluster_id",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/MigrationService.ValidateMigrationTargetConnBody"
            }
          }
        ],
        "tags": ["MigrationService"]
      }
    }
  },
  "definitions": {
    "Any": {
      "type": "object",
      "additionalProperties": {},
      "properties": {
        "@type": {
          "type": "string"
        }
      }
    },
    "BaseResp": {
      "type": "object",
      "properties": {
        "tags": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "title": "such as: request_id, trace_id"
        },
        "err_code": {
          "type": "string",
          "format": "int64"
        },
        "err_msg": {
          "type": "string"
        }
      }
    },
    "BlockAllowRules": {
      "type": "object",
      "properties": {
        "do_dbs": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "title": "wildcards are not supported because of limitation of openapi"
        },
        "do_tables": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/BlockAllowRules.Table"
          }
        }
      }
    },
    "BlockAllowRules.Table": {
      "type": "object",
      "properties": {
        "schema": {
          "type": "string",
          "title": "wildcards are not supported because of limitation of openapi"
        },
        "table": {
          "description": "wildcards are not supported because of limitation of openapi. Use \"*\" or \"~.*\" to represent all tables in the schema.",
          "type": "string"
        }
      }
    },
    "ConnMethod": {
      "type": "object",
      "properties": {
        "conn_type": {
          "$ref": "#/definitions/ConnType"
        },
        "display_name": {
          "type": "string",
          "title": "e.g. Public IP"
        }
      }
    },
    "ConnProfile": {
      "type": "object",
      "properties": {
        "conn_type": {
          "$ref": "#/definitions/ConnType"
        },
        "endpoint_id": {
          "type": "string"
        },
        "host": {
          "type": "string"
        },
        "port": {
          "type": "integer",
          "format": "int32"
        },
        "user": {
          "type": "string"
        },
        "password": {
          "type": "string"
        },
        "security": {
          "$ref": "#/definitions/Security",
          "title": "optional, if not set, use default"
        }
      }
    },
    "ConnType": {
      "type": "string",
      "enum": ["PUBLIC", "PRIVATE_LINK"]
    },
    "CreateEndpointResp": {
      "type": "object",
      "properties": {
        "endpoint_id": {
          "type": "string"
        },
        "base_resp": {
          "$ref": "#/definitions/BaseResp"
        }
      }
    },
    "CreateMigrationPrecheckResp": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "base_resp": {
          "$ref": "#/definitions/BaseResp"
        }
      }
    },
    "DescribeEndpointResp": {
      "type": "object",
      "properties": {
        "phase": {
          "$ref": "#/definitions/DescribeEndpointResp.Phase"
        },
        "error_message": {
          "type": "string"
        },
        "endpoint_id": {
          "type": "string"
        },
        "service_name": {
          "type": "string"
        },
        "create_time": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "DescribeEndpointResp.Phase": {
      "description": " - PendingAcceptance: means user should accept the private link request in their account.\n - Available: means private link is ready.\n - Failed: failed to create the private link endpoint, then message will contain detailed message\n - Pending: means it's still creating.",
      "type": "string",
      "enum": ["PendingAcceptance", "Available", "Failed", "Pending"]
    },
    "DumpDetail": {
      "type": "object",
      "properties": {
        "bps": {
          "type": "string",
          "format": "int64"
        },
        "progress": {
          "type": "number",
          "format": "double"
        },
        "total_tables": {
          "type": "string",
          "format": "int64"
        },
        "completed_tables": {
          "type": "string",
          "format": "int64"
        },
        "finished_bytes": {
          "type": "string",
          "format": "int64"
        },
        "finished_rows": {
          "type": "string",
          "format": "int64"
        }
      }
    },
    "EmptyResp": {
      "type": "object",
      "properties": {
        "base_resp": {
          "$ref": "#/definitions/BaseResp"
        }
      }
    },
    "GetIpWhitelistResp": {
      "type": "object",
      "properties": {
        "ips": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "base_resp": {
          "$ref": "#/definitions/BaseResp"
        }
      }
    },
    "GetSourceTablesResp": {
      "type": "object",
      "properties": {
        "tables": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/GetSourceTablesResp.Table"
          }
        },
        "base_resp": {
          "$ref": "#/definitions/BaseResp"
        }
      }
    },
    "GetSourceTablesResp.Table": {
      "type": "object",
      "properties": {
        "schema": {
          "type": "string"
        },
        "table": {
          "type": "string"
        }
      }
    },
    "GetSupportedSourcesReq.CloudProvider": {
      "type": "string",
      "enum": ["CLOUD_PROVIDER_ALICLOUD", "CLOUD_PROVIDER_AWS"]
    },
    "GetSupportedSourcesResp": {
      "type": "object",
      "properties": {
        "sources": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/SupportedSource"
          }
        },
        "base_resp": {
          "$ref": "#/definitions/BaseResp"
        }
      }
    },
    "GetVpcInfoResp": {
      "type": "object",
      "properties": {
        "account_id": {
          "type": "string"
        },
        "availability_zones": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "ListMigrationTasksResp": {
      "type": "object",
      "properties": {
        "tasks": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/MigrationTask"
          }
        },
        "total_size": {
          "type": "integer",
          "format": "int64"
        },
        "next_page_token": {
          "type": "string",
          "readOnly": true
        },
        "base_resp": {
          "$ref": "#/definitions/BaseResp"
        }
      }
    },
    "LoadDetail": {
      "type": "object",
      "properties": {
        "bps": {
          "type": "string",
          "format": "int64"
        },
        "progress": {
          "type": "number",
          "format": "double"
        },
        "finished_bytes": {
          "type": "string",
          "format": "int64"
        },
        "total_bytes": {
          "type": "string",
          "format": "int64"
        }
      }
    },
    "MigrationPrecheck": {
      "type": "object",
      "properties": {
        "total": {
          "type": "integer",
          "format": "int32"
        },
        "failed_cnt": {
          "type": "integer",
          "format": "int32"
        },
        "warn_cnt": {
          "type": "integer",
          "format": "int32"
        },
        "success_cnt": {
          "type": "integer",
          "format": "int32"
        },
        "status": {
          "type": "string"
        },
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/PrecheckItem"
          }
        },
        "base_resp": {
          "$ref": "#/definitions/BaseResp"
        }
      }
    },
    "MigrationService.CreateTaskBody": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "sources": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/Source"
          }
        },
        "target": {
          "$ref": "#/definitions/Target"
        },
        "mode": {
          "$ref": "#/definitions/TaskMode"
        },
        "full_instance_migration": {
          "type": "boolean"
        }
      }
    },
    "MigrationService.CreateVpcEndpointBody": {
      "type": "object",
      "properties": {
        "service_name": {
          "type": "string"
        }
      },
      "required": ["service_name"]
    },
    "MigrationService.DescribeVpcEndpointBody": {
      "type": "object",
      "properties": {
        "endpoint_id": {
          "type": "string"
        }
      },
      "required": ["endpoint_id"]
    },
    "MigrationService.GetSourceTablesBody": {
      "type": "object",
      "properties": {
        "conn_profile": {
          "$ref": "#/definitions/ConnProfile"
        }
      }
    },
    "MigrationService.GetVpcInfoBody": {
      "type": "object"
    },
    "MigrationService.PauseTaskBody": {
      "type": "object",
      "title": "PauseMigrationTaskReq is used to pause a migration task"
    },
    "MigrationService.PrecheckBody": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "sources": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/Source"
          }
        },
        "target": {
          "$ref": "#/definitions/Target"
        },
        "mode": {
          "$ref": "#/definitions/TaskMode"
        },
        "full_instance_migration": {
          "type": "boolean"
        }
      }
    },
    "MigrationService.ResumeTaskBody": {
      "type": "object",
      "title": "ResumeMigrationTaskReq is used to resume a paused migration task"
    },
    "MigrationService.ValidateMigrationSourceConnBody": {
      "type": "object",
      "properties": {
        "conn_profile": {
          "$ref": "#/definitions/ConnProfile"
        }
      }
    },
    "MigrationService.ValidateMigrationTargetConnBody": {
      "type": "object",
      "properties": {
        "user": {
          "type": "string"
        },
        "password": {
          "type": "string"
        }
      }
    },
    "MigrationTask": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "sub_tasks": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/SubTask"
          }
        },
        "target_user": {
          "type": "string"
        },
        "create_time": {
          "type": "string",
          "format": "date-time"
        },
        "mode": {
          "$ref": "#/definitions/TaskMode"
        },
        "state": {
          "$ref": "#/definitions/MigrationTask.State"
        },
        "base_resp": {
          "$ref": "#/definitions/BaseResp"
        }
      }
    },
    "MigrationTask.State": {
      "type": "string",
      "enum": ["CREATING", "RUNNING", "PAUSED", "CANCELED", "FAILED", "DELETING"]
    },
    "PrecheckItem": {
      "type": "object",
      "properties": {
        "desc": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "solution": {
          "type": "string"
        },
        "reason": {
          "type": "string"
        },
        "solution_doc_url": {
          "type": "string"
        },
        "type": {
          "$ref": "#/definitions/PrecheckItemType"
        }
      }
    },
    "PrecheckItemType": {
      "type": "string",
      "enum": [
        "PRECHECK_ITEM_TYPE_DUMP_PRIVILEGE_CHECKING",
        "PRECHECK_ITEM_TYPE_REPLICATION_PRIVILEGE_CHECKING",
        "PRECHECK_ITEM_TYPE_VERSION_CHECKING",
        "PRECHECK_ITEM_TYPE_SERVER_ID_CHECKING",
        "PRECHECK_ITEM_TYPE_BINLOG_ENABLE_CHECKING",
        "PRECHECK_ITEM_TYPE_BINLOG_FORMAT_CHECKING",
        "PRECHECK_ITEM_TYPE_BINLOG_ROW_IMAGE_CHECKING",
        "PRECHECK_ITEM_TYPE_TABLE_SCHEMA_CHECKING",
        "PRECHECK_ITEM_TYPE_BINLOG_DB_CHECKING",
        "PRECHECK_ITEM_TYPE_CONN_NUMBER_CHECKING",
        "PRECHECK_ITEM_TYPE_TARGET_DB_PRIVILEGE_CHECKING",
        "PRECHECK_ITEM_TYPE_META_POSITION_CHECKING",
        "PRECHECK_ITEM_TYPE_LIGHTNING_TABLE_EMPTY_CHECKING",
        "PRECHECK_ITEM_TYPE_PRIMARY_KEY_CHECKING"
      ]
    },
    "Security": {
      "type": "object",
      "properties": {
        "cert_allowed_cn": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "ssl_ca_content": {
          "type": "string",
          "format": "byte"
        },
        "ssl_cert_content": {
          "type": "string",
          "format": "byte"
        },
        "ssl_key_content": {
          "type": "string",
          "format": "byte"
        }
      }
    },
    "Source": {
      "type": "object",
      "properties": {
        "conn_profile": {
          "$ref": "#/definitions/ConnProfile"
        },
        "ba_rules": {
          "$ref": "#/definitions/BlockAllowRules",
          "title": "set empty to migrate all dbs/tables excluding systems dbs"
        },
        "binlog_name": {
          "type": "string"
        },
        "binlog_pos": {
          "type": "integer",
          "format": "int32"
        },
        "binlog_gtid": {
          "type": "string"
        },
        "source_type_id": {
          "type": "string",
          "title": "e.g. aws-rds-mysql"
        }
      }
    },
    "Status": {
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "format": "int32"
        },
        "message": {
          "type": "string"
        },
        "details": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/Any"
          }
        }
      }
    },
    "SubTask": {
      "type": "object",
      "properties": {
        "source": {
          "$ref": "#/definitions/Source"
        },
        "current_step": {
          "$ref": "#/definitions/SubTask.Step"
        },
        "stage": {
          "$ref": "#/definitions/SubTask.Stage"
        },
        "dump_detail": {
          "$ref": "#/definitions/DumpDetail"
        },
        "load_detail": {
          "$ref": "#/definitions/LoadDetail"
        },
        "sync_detail": {
          "$ref": "#/definitions/SyncDetail"
        },
        "error_msg": {
          "type": "string"
        }
      }
    },
    "SubTask.Stage": {
      "type": "string",
      "enum": ["STAGE_RUNNING", "STAGE_PAUSED", "STAGE_FAILED", "STAGE_FINISHED", "STAGE_UNKNOWN"]
    },
    "SubTask.Step": {
      "type": "string",
      "enum": ["STEP_DUMP", "STEP_LOAD", "STEP_SYNC"]
    },
    "SupportedSource": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "title": "e.g. aws-rds-mysql"
        },
        "display_name": {
          "type": "string",
          "title": "e.g. AWS RDS MySQL"
        },
        "conn_methods": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/ConnMethod"
          }
        }
      }
    },
    "SyncDetail": {
      "type": "object",
      "properties": {
        "rps": {
          "type": "string",
          "format": "int64",
          "title": "xx row/s"
        },
        "latency": {
          "type": "string",
          "format": "int64"
        },
        "checkpoint": {
          "type": "string"
        }
      }
    },
    "Target": {
      "type": "object",
      "properties": {
        "user": {
          "type": "string"
        },
        "password": {
          "type": "string"
        }
      }
    },
    "TaskMode": {
      "type": "string",
      "enum": ["MODE_ALL", "MODE_INCREMENTAL"]
    }
  },
  "securityDefinitions": {
    "bearer": {
      "type": "apiKey",
      "description": "Authentication token, prefixed by Bearer: 'Bearer token'",
      "name": "Authorization",
      "in": "header"
    }
  }
}
