调用此端点将多个数据源链接到一个应用程序。 每个应用的关联数据源总限制为100 。 此端点链接的数据源将具有ReadAndWrite默认规则。
路径参数
-
Atlas 项目/组 ID。
-
您的应用程序的 ObjectID。App Services API 项目和应用程序 ID 部分演示了如何查找此值。
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)
FailedLinkingDataSourceResponse
{
"failedClusterNames": [
"first-cluster"
]
}
{
"error": "string",
"error_code": "string"
}