路径参数
-
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
字符串 以下之一: 取值为
aws-us-east-1
、aws-us-west-2
、aws-us-east-2
、aws-eu-central-1
、aws-eu-west-1
、aws-eu-west-2
、aws-ap-southeast-1
、aws-ap-southeast-2
、aws-ap-south-1
或aws-sa-east-1
。取值为
azure-eastus2
、azure-westus
、azure-westeurope
、azure-eastasia
或azure-southeastasia
。取值为
gcp-us-central1
、gcp-us-east4
、gcp-us-west1
、gcp-europe-west1
或gcp-asia-south1
。-
应用服务器物理部署位置的标识符,与托管应用的云提供商无关。
取值为
US-VA
、US-OR
、DE-FF
、IE
、AU
、IN-MB
、SG
或BR-SP
。 -
应用程序部署模型。
值为
GLOBAL
或LOCAL
。 -
应用程序的环境。
取值为
development
、testing
、qa
或production
。 -
用作新应用程序基础的 App Services 模板应用的 ID。
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"
}
}
{
"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"
}
{
"error": "string",
"error_code": "string"
}