Docs Menu
Docs Home
/ /
MongoDB Command Line Interface
/ / /

mongocli atlas networking containers list

On this page

  • Syntax
  • Options
  • Output
  • Example

The networking containers list command retrieves the list of Atlas network peering containers on the specified Atlas cluster. You can also retrieve a list of network peering containers through the Atlas API.

mongocli atlas networking containers list
[ --output|-o <output-format> ]
[ --profile|-P <profile-name> ]
[ --projectId <project-ID> ]
[ --provider <AWS|GCP|AZURE> ]

Note

Use -h or --help to view the command-line help for this command.

Option
Type
Description
Required?
--output, -o
string

Command output format. Valid values are:

  • json for output in JSON format

  • go-template for custom output using the Go template

  • go-template-file for custom output specified using Go template file

If omitted, the command returns output in the default format.

no
--profile, -P
string
Name of the profile where the public and private keys for the project are saved. If omitted, uses the default profile. To learn more about creating a profile, see Configure the MongoDB CLI.
no
--projectId
string

Unique identifier of the project. If omitted, uses the project ID in the profile or environment variable.

no
--provider
string

Name of the cloud service provider. Valid values are:

  • AWS

  • GCP

  • AZURE

If omitted, this option defaults to all providers.

no

If the command is successful, it returns the following information:

Field
Description
ID
Unique identifier of the container.
PROVIDER

Cloud provider of the container. Valid values are:

  • AWS

  • GCP

  • AZURE

ATLAS CIDR
CIDR block of the container.
PROVISIONED
Boolean that indicates if the project has clusters deployed in the network peering container or Azure VNet.

The following example uses the mongocli atlas networking containers list command to retrieve the list of network containers for the specified project. The command uses the default profile, which contains the Programmatic API Keys and the project ID. The output is returned in the default format.

mongocli atlas networking containers list

The previous command prints the following fields to the terminal. To learn more about these fields, see Output.

ID PROVIDER REGION ATLAS CIDR PROVISIONED
5e44103f8d614b2f0b6530d8 AWS US_EAST_1 192.168.248.0/21 false
5e4d11e715702545882b82c2 GCP 192.168.0.0/16 true
5e7b3ed1015d8a59863fca6e AZURE US_EAST_2 192.168.248.0/21 false

The following example uses the mongocli atlas networking containers list command to retrieve the list of network containers for the specified project. The command uses the default profile, which contains the Programmatic API Keys and the project ID. The output is returned in JSON format.

mongocli atlas networking containers list -o JSON

The previous command prints the following fields to the terminal. To learn more about these fields, see Output.

[
{
"atlasCidrBlock": "192.168.0.0/16",
"id": "5e4d11e715702545882b82c2",
"providerName": "GCP",
"provisioned": true,
"vpcId": "vpc-0caafc35fc49f3e51"
},
{
"atlasCidrBlock": "192.168.248.0/21",
"id": "5e44103f8d614b2f0b6530d8",
"providerName": "AWS",
"provisioned": false,
"regionName": "US_EAST_1",
"vpcId": "vpc-0caafc35fc49f3d24"
},
{
"atlasCidrBlock": "192.168.248.0/21",
"id": "5e44103f8d614b2f0b6530d8",
"providerName": "5e7b3ed1015d8a59863fca6e",
"provisioned": true,
"regionName": "US_EAST_2",
"vpcId": "vpc-0caafc35fc49f3c22"
}
]

Back

Networking