Navigation

Update a Container

Base URL: https://cloud.mongodb.com/

Syntax

PATCH /api/atlas/v1.0/groups/{GROUP-ID}/containers/{CONTAINER-ID}

Request Path Parameters

Parameter Required/Optional Description
GROUP-ID Required. The unique identifier for the group.
CONTAINER-ID Required. The identifier for the container.

Request Query Parameters

Field Required/Optional Description
envelope Optional. A boolean that specifies whether or not to wrap the response in an envelope.

Request Body Parameters

Parameter Required/Optional Description
atlasCidrBlock Required.

Atlas CIDR block.

Atlas uses the specified CIDR block for all other VPC peering connections created in the group.

The Atlas CIDR block must be at least a /24 and at most a /21 in one of the following private networks.

  • 10.0.0.0/8
  • 172.16.0.0/12
  • 192.168.0.0/16

Atlas locks this value if an M10+ cluster or a VPC peering connection already exists. To modify the CIDR block, ensure there are no M10+ clusters in the group and no other VPC peering connections in the group. Alternatively, create a new group and create a VPC Peering Connection to set the desired Atlas VPC CIDR block for that group.

Important

Atlas limits the number of MongoDB nodes per VPC based on the CIDR block and the region selected for the group. For example, a group in an AWS region supporting 3 availability zones and a Atlas CIDR VPC block of /24 is limited to the equivalent of 27 3-node replica sets.

Contact MongoDB Support for any questions on Atlas limits of MongoDB nodes per VPC.

providerName Required. The provider name. Specify AWS.
regionName Required. AWS region name.

HTTP Response Elements

Field Description
id The container ID.
providerName Provider name; e.g. AWS.
atlasCidrBlock The Atlas CIDR block.
regionName AWS region.
vpcId The ID of the peer VPC.
isProvisioned Flag that indicates if the group has clusters deployed in the VPC.

Example Request

curl -X PATCH -u 'username:apiKey' --digest "https://cloud.mongodb.com/api/atlas/v1.0/groups/5356823b3794dee37132bb7b/containers/1112222b3bf99403840e8934" \
   -H "Content-Type: application/json" --data '
   {
       "atlasCidrBlock" : "192.168.248.0/21",
       "providerName" : "AWS",
       "regionName" : "US_EAST_1"
   }'

Example Response

{
  "atlasCidrBlock" : "192.168.248.0/21",
  "id" : "1112269b3bf99403840e8934",
  "providerName" : "AWS",
  "provisioned" : true,
  "regionName" : "US_EAST_1",
  "vpcId" : "vpc-zz0zzzzz"
}