创建一个新应用

发布 /groups/{groupId}/apps

路径参数

查询参数

  • defaults 布尔

    是否创建默认应用程序。

  • 产品 字符串

    应用程序的产品类型。应用程序默认使用 standard 产品类型。对于大多数应用程序,您根本不需要指定 product,或者应该指定 standard

    atlasdata-apidevice-sync 产品类型代表 Atlas TriggersAtlas Data APIAtlas Device Sync 的特殊应用,您可以通过 Atlas UI 访问这些应用。

    取值为 standardatlasdata-apidevice-sync

application/json

body 必需

描述要创建的新应用的对象

  • 名称 字符串

    应用程序的名称。必须以字母开头,并且只能包含 ASCII 字母、数字、下划线和连字符。

  • provider_region 字符串

    以下之一:

    取值为 aws-us-east-1aws-us-west-2aws-us-east-2aws-eu-central-1aws-eu-west-1aws-eu-west-2aws-ap-southeast-1aws-ap-southeast-2aws-ap-south-1aws-sa-east-1

    取值为 azure-eastus2azure-westusazure-westeuropeazure-eastasiaazure-southeastasia

    取值为 gcp-us-central1gcp-us-east4gcp-us-west1gcp-europe-west1gcp-asia-south1

  • 位置 字符串

    应用服务器物理部署位置的标识符,与托管应用的云提供商无关。

    取值为 US-VAUS-ORDE-FFIEAUIN-MBSGBR-SP

  • deployment_model 字符串

    应用程序部署模型

    值为 GLOBALLOCAL

  • environment 字符串

    应用程序的环境。

    取值为 developmenttestingqaproduction

  • template_id 字符串

    用作新应用程序基础的 App Services 模板应用的 ID。

  • data_source 对象

    以下之一:

响应

  • 201 application/json

    已成功创建应用程序。

    隐藏响应属性 显示响应属性 对象

    特定的现有应用程序。

    • 名称 字符串

      应用程序的名称。必须以字母开头,并且只能包含 ASCII 字母、数字、下划线和连字符。

    • provider_region 字符串

      以下之一:

      取值为 aws-us-east-1aws-us-west-2aws-us-east-2aws-eu-central-1aws-eu-west-1aws-eu-west-2aws-ap-southeast-1aws-ap-southeast-2aws-ap-south-1aws-sa-east-1

      取值为 azure-eastus2azure-westusazure-westeuropeazure-eastasiaazure-southeastasia

      取值为 gcp-us-central1gcp-us-east4gcp-us-west1gcp-europe-west1gcp-asia-south1

    • 位置 字符串

      应用服务器物理部署位置的标识符,与托管应用的云提供商无关。

      取值为 US-VAUS-ORDE-FFIEAUIN-MBSGBR-SP

    • deployment_model 字符串

      应用程序部署模型

      值为 GLOBALLOCAL

    • environment 字符串

      应用程序的环境。

      取值为 developmenttestingqaproduction

    • _id 字符串

      应用程序的唯一内部ID。

    • client_app_id 字符串

      应用程序的公共 App ID。

    • domain_id 字符串

      应用程序的关联域ID。

    • GROUP_ID 字符串

      应用程序的Atlas项目/群组ID

    • last_used 整型

      上次使用此应用的时间(以 UNIX 时间表示)(即自 11 月1970 以来的秒数)。

    • last_modified 整型

      上次修改此应用的时间(以 UNIX 时间表示)(即自 11 月1970 以来的秒数)。

    • 产品 字符串

      此应用适用的产品。

      取值为 standardatlasdata-apidevice-sync

  • 400 application/json

    请求中存在错误。

    隐藏响应属性 显示响应属性 对象
    • 错误 字符串

      描述错误的消息。

    • error_code 字符串

      错误类型。

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"
}