Navigation

Get All Network Peering Connections in A Project

Retrieve details for all network peering connections in one Atlas project. You must have the Project Read Only or more permissive role to successfully call this endpoint.

Note

Groups and projects are synonymous terms. Your {GROUP-ID} is the same as your project ID. For existing groups, your group/project ID remains the same. The resource and corresponding endpoints use the term groups.

Base URL: https://cloud.mongodb.com/api/atlas/v1.0

Resource

GET /groups/{GROUP-ID}/peers

Request Path Parameters

Parameter Type Necessity Description
GROUP-ID string Required Unique identifier for the project.

Request Query Parameters

Name Type Necessity Description Default
pageNum integer Optional Page number (1-based). 1
itemsPerPage integer Optional Maximum number of items to return, up to a maximum of 100. 100
pretty boolean Optional Indicates whether the response body should be in a prettyprint format. false
envelope boolean Optional

Indicates whether or not to wrap the response in an envelope.

Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query.

For endpoints that return a list of results, the results object is an envelope. Atlas adds the status field to the response body.

false
providerName string Optional Cloud provider for this VPC peering connection. Accepted values are AWS, GCP and Azure. AWS

Request Body Parameters

This endpoint does not use HTTP request body parameters.

Response Elements

The response JSON document includes an array of result objects, an array of link objects, and a count of the total number of result objects retrieved.

Name Type Description
results object array Includes one object for each returned result.
links object array Includes one or more links to sub-resources and/or related resources. The relations between URLs are explained in the Web Linking Specification.
totalCount number Specifies the total number of items in the result set. It may be greater than the number of objects in the results array if the entire result set is paginated.

Each element in the result array represents one Network Peering connection and contains the following fields:

Body Parameter Type Description
accepterRegionName string AWS region where the peer VPC resides. Returns null if the region is the same region in which the Atlas VPC resides.
awsAccountId string AWS account ID of the owner of the peer VPC.
connectionId string Unique identifier for the peering connection.
containerId string Unique identifier of the Atlas VPC container for the AWS region.
errorStateName string

Error state, if any.

The VPC peering connection error state value can be one of the following:

  • REJECTED
  • EXPIRED
  • INVALID_ARGUMENT
id string The CIDR block that Atlas uses for the clusters in your project.
routeTableCidrBlock string Peer VPC CIDR block or subnet.
statusName string

The VPC peering connection status value can be one of the following:

  • INITIATING
  • PENDING_ACCEPTANCE
  • FAILED
  • FINALIZING
  • AVAILABLE
  • TERMINATING
vpcId string Unique identifier of the peer VPC.
Response Field Type Description
azureDirectoryId string Unique identifier of your Azure AD directory.
azureSubscriptionId string Unique identifier of your Azure subscription.
containerId string Unique identifier of the Atlas network peering container.
errorState string Description of the Atlas error when status is Failed, Otherwise, Atlas returns null.
id string Unique identifier of the Atlas network peeering connection.
resourceGroupName string Unique identifier of your Azure resource group.
status string

Status of the Atlas network peering connection:

  • ADDING_PEER
  • AVAILABLE
  • FAILED
  • DELETING
vnetName string Unique identifier of your Azure VNet.
Body Parameter Type Description
containerId string Unique identifier of the Atlas Network Peering container for GCP.
gcpProjectId string GCP project ID of the owner of the network peer.
errorMessage string When "status" : "FAILED", Atlas provides a description of the error.
id string Atlas assigned unique ID for the connection. Only specific to and used by Atlas.
networkName string Name of the network peer to which Atlas connects.
status string

The Network Peering connection status value can be one of the following:

  • ADDING_PEER
  • WAITING_FOR_USER
  • AVAILABLE
  • FAILED
  • DELETING

Example Request

1
2
3
curl --user "{USERNAME}:{APIKEY}" --digest \
  --header "Accept: application/json" \
  --request GET "https://cloud.mongodb.com/api/atlas/v1.0/groups/5356823b3794dee37132bb7b/peers?providerName=AWS&pretty=true"
1
2
3
curl --user "{USERNAME}:{APIKEY}" --digest \
  --header "Accept: application/json" \
  --request GET "https://cloud.mongodb.com/api/atlas/v1.0/groups/5356823b3794dee37132bb7b/peers?providerName=AZURE&pretty=true"
1
2
3
curl --user "{USERNAME}:{APIKEY}" --digest \
  --header "Accept: application/json" \
  --request GET "https://cloud.mongodb.com/api/atlas/v1.0/groups/5356823b3794dee37132bb7b/peers?providerName=GCP&pretty=true"

Example Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
{
   "links": [ {
      "href" : "https://cloud.mongodb.com/api/atlas/v1.0/groups/5356823b3794dee37132bb7b/peers?pageNum=1&itemsPerPage=100",
      "rel" : "self"
   } ],
   "results":[ {
      "accepterRegionName" : "us-west-1",
      "awsAccountId" : "999900000000",
      "connectionId" : null,
      "containerId" : "507f1f77bcf86cd799439011",
      "errorStateName" : null,
      "id" : "1112222b3bf99403840e8934",
      "routeTableCidrBlock" : "10.15.0.0/16",
      "statusName" : "INITIATING",
      "vpcId" : "vpc-abc123abc123"
   } ],
   "totalCount": 1
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
{
   "links": [ {
      "href": "https://cloud.mongodb.com/api/atlas/v1.0/groups/5356823b3794dee37132bb7b/peers?providerName=AZURE&pageNum=1&itemsPerPage=100",
      "rel": "self"
       }],
   "results": [ {
      "azureDirectoryId": "35039750-6ebd-4ad5-bcfe-cb4e5fc2d915",
      "azureSubscriptionId": "g893dec2-d92e-478d-bc50-cf99d31bgeg9",
      "containerId": "507f1f77bcf86cd799439011",
      "errorState": null,
      "id": "1112222b3bf99403840e8934",
      "resourceGroupName": "atlas-azure-peering",
      "status": "ADDING_PEER",
      "vnetName": "azure-peer"
   } ],
   "totalCount": 1
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{
   "links": [ {
      "href" : "https://cloud.mongodb.com/api/atlas/v1.0/groups/5356823b3794dee37132bb7b/peers?pageNum=1&itemsPerPage=100",
      "rel" : "self"
   } ],
   "results":[ {
      "containerId" : "507f1f77bcf86cd799439011",
      "gcpProjectId" : "my-sample-project-191923",
      "id" : "1112222b3bf99403840e8934",
      "networkName" : "test1",
      "status" : "ADDING_PEER"
   } ],
   "totalCount": 1
}