路径参数
-
Atlas 项目/组 ID。
查询参数
-
是否创建默认应用程序。
-
应用程序的产品类型。应用程序默认使用
standard产品类型。对于大多数应用程序,您根本不需要指定product,或者应该指定standard。atlas、data-api和device-sync产品类型代表 Atlas Triggers、Atlas Data API 和 Atlas Device Sync 的特殊应用,您可以通过 Atlas UI 访问这些应用。取值为
standard、atlas、data-api或device-sync。
body
必需
描述要创建的新应用的对象
-
应用程序的名称。必须以字母开头,并且只能包含 ASCII 字母、数字、下划线和连字符。
-
应用程序的物理部署位置。这应该与更具体的
provider_region值一致。例如,一个provider_region为aws-us-west-2的应用映射到US-OR的location。取值为
US-VA、US-OR、DE-FF、IE、AU、IN-MB、SG或BR-SP。 -
应用程序部署模型。
值为
GLOBAL或LOCAL。 -
应用程序的环境。
取值为
development、testing、qa或production。 -
用作新应用程序基础的 App Services 模板应用的 ID。
POST /groups/{groupId}/apps
curl \
--request POST 'https://services.cloud.mongodb.com/api/admin/v3.0/groups/{groupId}/apps' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"name": "MyApp",
"provider_region": "aws-us-east-1",
"location": "US-VA",
"deployment_model": "GLOBAL",
"environment": "production",
"template_id": "string",
"data_source": {
"_id": "string",
"name": "string",
"type": "string"
}
}'
请求示例
{
"name": "MyApp",
"provider_region": "aws-us-east-1",
"location": "US-VA",
"deployment_model": "GLOBAL",
"environment": "production",
"template_id": "string",
"data_source": {
"_id": "string",
"name": "string",
"type": "string"
}
}
响应示例 (201)
{
"name": "MyApp",
"provider_region": "aws-us-east-1",
"location": "US-VA",
"deployment_model": "GLOBAL",
"environment": "production",
"_id": "633209ffd3bd3478005d1bac",
"client_app_id": "myapp-abcde",
"domain_id": "63320a2b5f9de9a6e0a213e8",
"group_id": "5b2ec991973129243223a114",
"last_used": 1664224746,
"last_modified": 1656440824,
"product": "standard"
}
响应示例 (400)
{
"error": "string",
"error_code": "string"
}