Navigation

Enable Connect via Peering Only Mode for a Project

Enable or disable Connect via Peering Only mode for an Atlas project. This mode cannot be enabled or disabled while you have dedicated GCP or Azure-backed clusters or Atlas Network Peering connections in an Atlas project.

You must have the Project Owner role or the Organization Owner role to successfully call this endpoint.

What is Connect via Peering Only Mode?

Connect via Peering Only mode prevents clusters in an Atlas project from connecting to any network destination other than aan Atlas Network Peer. Connect via Peering Only mode applies only to GCP and Azure-backed dedicated clusters. This setting disables the ability to:

  1. Deploy non-GCP or Azure-backed dedicated clusters in an Atlas project, and
  2. Use MongoDB Stitch with dedicated clusters in an Atlas project.

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

Resource

PATCH /groups/{GROUP-ID}/privateIpMode

Request Path Parameters

Body Parameter Type Necessity Description
GROUP-ID string Required Unique identifier of the project for which you want to enable Connect via Peering Only mode.

Request Query Parameters

This endpoint may use any of the HTTP request query parameters available to all Atlas API resources. These are all optional.

Name Type Description Default
pretty boolean Indicates whether the response body should be in a prettyprint format. false
envelope boolean

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 one result, the response body includes:

status HTTP response code
envelope The expected response body
false

Request Body Parameters

Body Parameter Type Necessity Description
enabled boolean Required Indicates whether Connect via Peering Only mode is enabled or disabled for an Atlas project.

Response

Body Parameter Type Description
enabled boolean Indicates whether Connect via Peering Only mode is enabled or disabled for an Atlas project.

Example Request

1
2
3
4
5
6
7
8
9
curl --user "{USERNAME}:{APIKEY}" --digest \
  --header "Accept: application/json" \
  --header "Content-Type: application/json" \
  --include \
  --request PATCH "https://cloud.mongodb.com/api/atlas/v1.0/groups/{GROUP-ID}/privateIpMode?pretty=true" \
  --data '
    {
      "enabled" : true
    }'

Example Response

Response Header

HTTP/1.1 401 Unauthorized
Content-Type: application/json;charset=ISO-8859-1
Date: {dateInUnixFormat}
WWW-Authenticate: Digest realm="MMS Public API", domain="", nonce="{nonce}", algorithm=MD5, op="auth", stale=false
Content-Length: {requestLengthInBytes}
Connection: keep-alive
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Type: application/json
Strict-Transport-Security: max-age=300
Date: {dateInUnixFormat}
Connection: keep-alive
Content-Length: {requestLengthInBytes}

Response Body

1
2
3
{
  "enabled" : true
}