发布 /groups/{groupId}/apps/{appId}/multi_data_sources

调用此端点将多个数据源链接到一个应用程序。 每个应用的关联数据源总限制为100 。 此端点链接的数据源将具有ReadAndWrite默认规则。

路径参数

application/json

body

  • 名称 字符串

    创建一个名称来标识要链接的每个集群。

  • 类型 字符串

    您想要链接的数据源的类型。

    值为 mongodb-atlasdatalake

  • config 对象
    隐藏配置属性 显示配置属性 对象
    • 集群名称 字符串 必需

      其中数据源的集群名称。名称最长可以有 64 个字符,并且只能包含 ASCII 字母、数字、下划线和连字符。

响应

  • 201

    无内容

  • 400 application/json
    • 数据源超过有效载荷中 25 的限制
    • 应用程序上的数据源超过 100 的限制
    • 单一数据源的多个默认规则
    • 数据源类型既不是“mongodb-atlas”也不是“datalake”
    • 至少一个数据源链接失败
    以下之一:
POST /groups/{groupId}/apps/{appId}/multi_data_sources
curl \
 --request POST 'https://services.cloud.mongodb.com/api/admin/v3.0/groups/{groupId}/apps/{appId}/multi_data_sources' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '[{"name":"first-cluster","type":"mongodb-atlas","config":{"clusterName":"Cluster0"}}]'
请求示例
[
  {
    "name": "first-cluster",
    "type": "mongodb-atlas",
    "config": {
      "clusterName": "Cluster0"
    }
  }
]
响应示例 (400)
{
  "failedClusterNames": [
    "first-cluster"
  ]
}
{
  "error": "string",
  "error_code": "string"
}