MongoDB 关系型迁移器 REST API (1.11.0)

下载 OpenAPI 规范:下载

MongoDB 关系迁移工具的 OpenAPI 规范

Codegen

基于项目映射的代码生成

generateCode

根据您项目的映射规则和模式转换生成应用程序代码

路径参数
projectId
必需
string (id) ^[A-Za-z0-9\-]+$

项目 ID

请求体模式: application/json
collections
必需
字符串数组

包含在生成的代码中的 MongoDB 集合

includeSupportFiles
必需
boolean

是否包含支持文件(如果适用于所选语言和框架)

language
必需
string (codegen-language-type)
枚举: "JAVA" "CSHARP" "JAVASCRIPT" "JSON" "PYTHON"
framework
必需
string (codegen-framework-type)
枚举: "POJO" "POCO" "SPRING_DATA" "PERSISTENCE_LAYER" "MONGOOSE_SCHEMAS" "NODE" "MONGODB_JSON_SCHEMA" "STANDARD_JSON_SCHEMA" "JSON_EXAMPLE_SCHEMA" "PYTHON_TYPED_DICT_CLASSES"

响应

请求示例

内容类型
application/json
{
  • "collections": [
    ],
  • "includeSupportFiles": true,
  • "language": "JAVA",
  • "framework": "POJO"
}

响应示例

内容类型
application/json
{
  • "language": "JAVA",
  • "framework": "POJO",
  • "files": [
    ]
}

getCodegenMetadata

获取代码生成的可用语言和框架

路径参数
projectId
必需
string (id) ^[A-Za-z0-9\-]+$

项目 ID

响应

响应示例

内容类型
application/json
{
  • "metadata": [
    ]
}

Job

数据迁移

getJobs

获取所有迁移作业

查询参数
sort
string^\w+,(DESC|ASC)$
默认: "submittedAt,DESC"
示例: sort=submittedAt,DESC

获取结果的顺序

limit
integer
示例: limit=20

限制结果

type
string (migration-jobs-get-type)
值: "IN_PROGRESS"
示例: type=IN_PROGRESS

过滤作业以仅包含特定类型的作业

projectId
string (id) ^[A-Za-z0-9\-]+$

按projectId过滤作业

响应

响应示例

内容类型
application/json
[
  • {
    }
]

createJob

发布一个新的迁移作业

请求体模式: application/json
projectId
必需
字符串
必需
对象 (jdbc-连接详情)
必需
对象 (mongodb-连接详情)
必需
对象 (迁移作业描述选项)
必需
对象 (迁移验证)
对象 (关系表过滤器)

架构

响应

请求示例

内容类型
application/json
{
  • "projectId": "string",
  • "jdbc连接详情": {
    },
  • "mongodb连接详情": {
    },
  • "options": {
    },
  • "验证": {
    },
  • "relationalTableFilters": {
    }
}

响应示例

内容类型
application/json
{
  • "id": "string",
  • "projectId": "string",
  • "status": "RUNNING",
  • "cdcStatus": "NOT_STARTED",
  • "verificationJobId": "string",
  • "options": {
    },
  • "jdbcConnectionString": "string",
  • "mongoDbConnectionString": "string",
  • "atlasMetadata": {
    },
  • "submittedAt": "2019-08-24T14:15:22Z",
  • "statistics": {
    },
  • "cdcStatistics": {
    },
  • "jobUpdates": [
    ],
  • "failureError": {
    },
  • "metadata": {
    },
  • "relationalTableFilters": {
    }
}

getJob

通过ID获取迁移作业的状态

路径参数
jobId
必需
string (id) ^[A-Za-z0-9\-]+$

作业 ID

响应

响应示例

内容类型
application/json
{
  • "id": "string",
  • "projectId": "string",
  • "status": "RUNNING",
  • "cdcStatus": "NOT_STARTED",
  • "verificationJobId": "string",
  • "options": {
    },
  • "jdbcConnectionString": "string",
  • "mongoDbConnectionString": "string",
  • "atlasMetadata": {
    },
  • "submittedAt": "2019-08-24T14:15:22Z",
  • "statistics": {
    },
  • "cdcStatistics": {
    },
  • "jobUpdates": [
    ],
  • "failureError": {
    },
  • "metadata": {
    },
  • "relationalTableFilters": {
    }
}

pauseJob

暂停正在运行的迁移作业

路径参数
jobId
必需
string (id) ^[A-Za-z0-9\-]+$

作业 ID

响应

响应示例

内容类型
application/json
{
  • "id": "string",
  • "projectId": "string",
  • "status": "RUNNING",
  • "cdcStatus": "NOT_STARTED",
  • "verificationJobId": "string",
  • "options": {
    },
  • "jdbcConnectionString": "string",
  • "mongoDbConnectionString": "string",
  • "atlasMetadata": {
    },
  • "submittedAt": "2019-08-24T14:15:22Z",
  • "statistics": {
    },
  • "cdcStatistics": {
    },
  • "jobUpdates": [
    ],
  • "failureError": {
    },
  • "metadata": {
    },
  • "relationalTableFilters": {
    }
}

resumeJob

恢复暂停的迁移作业

路径参数
jobId
必需
string (id) ^[A-Za-z0-9\-]+$

作业 ID

响应

响应示例

内容类型
application/json
{
  • "id": "string",
  • "projectId": "string",
  • "status": "RUNNING",
  • "cdcStatus": "NOT_STARTED",
  • "verificationJobId": "string",
  • "options": {
    },
  • "jdbcConnectionString": "string",
  • "mongoDbConnectionString": "string",
  • "atlasMetadata": {
    },
  • "submittedAt": "2019-08-24T14:15:22Z",
  • "statistics": {
    },
  • "cdcStatistics": {
    },
  • "jobUpdates": [
    ],
  • "failureError": {
    },
  • "metadata": {
    },
  • "relationalTableFilters": {
    }
}

stopJob

停止正在运行的迁移作业

路径参数
jobId
必需
string (id) ^[A-Za-z0-9\-]+$

作业 ID

响应

响应示例

内容类型
application/json
{
  • "id": "string",
  • "projectId": "string",
  • "status": "RUNNING",
  • "cdcStatus": "NOT_STARTED",
  • "verificationJobId": "string",
  • "options": {
    },
  • "jdbcConnectionString": "string",
  • "mongoDbConnectionString": "string",
  • "atlasMetadata": {
    },
  • "submittedAt": "2019-08-24T14:15:22Z",
  • "statistics": {
    },
  • "cdcStatistics": {
    },
  • "jobUpdates": [
    ],
  • "failureError": {
    },
  • "metadata": {
    },
  • "relationalTableFilters": {
    }
}

项目

捕获关系模式映射

getProjects

获取所有项目

查询参数
sort
string^\w+,(DESC|ASC)$
默认: "lastModified,DESC"
示例: sort=lastModified,DESC

获取结果的顺序

响应

响应示例

内容类型
application/json
[
  • {
    }
]

查询

查询转换

getQueries

获取与项目相关的所有查询的摘要

路径参数
projectId
必需
string (id) ^[A-Za-z0-9\-]+$

项目 ID

响应

响应示例

内容类型
application/json
[
  • {
    }
]

createQuery

创建新的即席查询

路径参数
projectId
必需
string (id) ^[A-Za-z0-9\-]+$

项目 ID

请求体模式: application/json
inputQuery
字符串

响应

请求示例

内容类型
application/json
{
  • "inputQuery": "string"
}

响应示例

内容类型
application/json
{
  • "id": "string",
  • "projectId": "string",
  • "input": {
    },
  • "output": {
    }
}

停止批量查询转换

停止正在运行的批量查询转换作业

路径参数
projectId
必需
string (id) ^[A-Za-z0-9\-]+$

项目 ID

响应

响应示例

内容类型
application/json
{
  • "待处理查询": [
    ],
  • "正在运行的查询": [
    ],
  • "已完成的查询": [
    ],
  • "失败的查询": [
    ]
}

getBulkQueryConversion

获取批量查询转换作业的状态

路径参数
projectId
必需
string (id) ^[A-Za-z0-9\-]+$

项目 ID

响应

响应示例

内容类型
application/json
{
  • "待处理查询": [
    ],
  • "正在运行的查询": [
    ],
  • "已完成的查询": [
    ],
  • "失败的查询": [
    ]
}

createBulkQueryConversion

创建批量查询转换作业

路径参数
projectId
必需
string (id) ^[A-Za-z0-9\-]+$

项目 ID

请求体模式: application/json
language
必需
string (convert-query-language-type)
枚举: "JAVA" "CSHARP" "JAVASCRIPT"
queries
必需
字符串数组
attemptTypedEntities
boolean

响应

请求示例

内容类型
application/json
{
  • "language": "JAVA",
  • "queries": [
    ],
  • "attemptTypedEntities": true
}

响应示例

内容类型
application/json
{
  • "待处理查询": [
    ],
  • "正在运行的查询": [
    ],
  • "已完成的查询": [
    ],
  • "失败的查询": [
    ]
}

deleteQuery

按ID删除查询

路径参数
projectId
必需
string (id) ^[A-Za-z0-9\-]+$

项目 ID

queryId
必需
string (id) ^[A-Za-z0-9\-]+$

查询ID

响应

响应示例

内容类型
application/json
{
  • "jobId": "string",
  • "message": "string",
  • "description": "string",
  • "timestamp": "2019-08-24T14:15:22Z"
}

getQuery

按ID获取查询

路径参数
projectId
必需
string (id) ^[A-Za-z0-9\-]+$

项目 ID

queryId
必需
string (id) ^[A-Za-z0-9\-]+$

查询ID

响应

响应示例

内容类型
application/json
{
  • "query": {
    },
  • "convertedRunResult": {
    },
  • "源运行结果": {
    }
}

convertQuery

转换查询

路径参数
projectId
必需
string (id) ^[A-Za-z0-9\-]+$

项目 ID

queryId
必需
string (id) ^[A-Za-z0-9\-]+$

查询ID

请求体模式: application/json
language
必需
string (convert-query-language-type)
枚举: "JAVA" "CSHARP" "JAVASCRIPT"
attemptTypedEntities
boolean
默认: false

响应

请求示例

内容类型
application/json
{
  • "language": "JAVA",
  • "attemptTypedEntities": false
}

响应示例

内容类型
application/json
{
  • "id": "string",
  • "projectId": "string",
  • "input": {
    },
  • "output": {
    }
}