Navigation

Get All Clusters in All Projects

Get details for all clusters in all projects available to the programmatic or personal API key making the request.

Required Roles

You can successfully call this endpoint with any assigned role.

Request

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

GET /api/atlas/v1.0/clusters

Request Path Parameters

This endpoint does not use HTTP request path parameters.

Request Query Parameters

Name Type Necessity Description Default
pretty boolean Optional Flag indicating whether the response body should be in a prettyprint format. false
envelope boolean Optional

Flag indicating if Atlas should wrap the response in a JSON envelope.

This option may be needed for some API clients. These 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 Expected response body
false

HTTP Response Elements

The HTTP response returns a JSON document that includes an array for each project the API key is authorized to view. Each array contains the following elements:

Name Type Description
clusters array of objects Objects that describe the clusters in each project that the API key is authorized to view.
clusters.[n].alertCount integer Number of open alerts.
clusters.[n].authEnabled boolean

Specifies if authentication is required to access the nodes in the cluster.

In Atlas, this value is always true.

clusters.[n].availability string

Availability of the cluster. Values include:

  • available: All nodes in the cluster are available.
  • warning: Some nodes in the cluster are available. At least one node is unavailable.
  • unavailable: The cluster is unavailable. The cluster does not have a primary node.
  • dead: The cluster is inactive.
clusters.[n].backupEnabled boolean Specifies if backup is enabled for the cluster.
clusters.[n].clusterId string Unique identifier of the Atlas cluster.
clusters.[n].dataSizeBytes number Total size of the data stored on each node in the cluster in bytes.
clusters.[n].name string Name of the cluster as it appears in Atlas.
clusters.[n].nodeCount integer Number of nodes in the cluster.
clusters.[n].sslEnabled boolean

Specifies if SSL authentication is required to access the nodes in the cluster.

In Atlas, this value is always true.

clusters.[n].type string

The type of MongoDB cluster. Values include:

clusters.[n].versions array of strings Version of MongoDB that each node in the cluster is running.
groupId string Unique identifier of the project.
groupName string Name of the project to which the returned clusters belong.
orgId string Unique identifier for the organization that owns the project to which the returned clusters belong.
orgName string Name of the organization that owns the project to which the returned clusters belong.
planType string

Plan type.

In Atlas, this value is always Atlas.

tags array of strings

Tags applied to the project.

In Atlas, this array is always empty.

Example

Request

curl -i -u "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest "https://cloud.mongodb.com/api/atlas/v1.0/clusters"

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

{
    "links": [
       {
            "href": "https://cloud.mongodb.com/api/atlas/v1.0/clusters",
            "rel": "self"
        }
    ],
    "results": [
        {
            "clusters": [
                {
                    "alertCount": 0,
                    "authEnabled": true,
                    "availability": "available",
                    "backupEnabled": false,
                    "clusterId": "5e6bc0352e41683c191c8956",
                    "dataSizeBytes": 0,
                    "name": "Cluster1",
                    "nodeCount": 3,
                    "sslEnabled": true,
                    "type": "replica set",
                    "versions": [
                        "4.2.3"
                    ]
                },
                {
                    "alertCount": 0,
                    "authEnabled": true,
                    "availability": "available",
                    "backupEnabled": false,
                    "clusterId": "5e6bc60ba4c3f47a54d8fe95",
                    "dataSizeBytes": 0,
                    "name": "Cluster2",
                    "nodeCount": 3,
                    "sslEnabled": true,
                    "type": "replica set",
                    "versions": [
                        "4.2.3"
                    ]
                }
            ],
            "groupId": "5df90932f10fab675508b0e5",
            "groupName": "az",
            "orgId": "5df7a168f10fab3a149357fb",
            "orgName": "jww-12-16",
            "planType": "Atlas",
            "tags": []
        },
        {
            "clusters": [
                {
                    "alertCount": 0,
                    "authEnabled": true,
                    "availability": "available",
                    "backupEnabled": false,
                    "clusterId": "5e6bbf6a9de0d35b1527dd93",
                    "dataSizeBytes": 0,
                    "name": "Cluster0",
                    "nodeCount": 3,
                    "sslEnabled": true,
                    "type": "replica set",
                    "versions": [
                        "4.2.3"
                    ]
                }
            ],
            "groupId": "5df90590f10fab5e33de2305",
            "groupName": "jww-12-17",
            "orgId": "5df7a168f10fab3a149357fb",
            "orgName": "jww-12-16",
            "planType": "Atlas",
            "tags": []
        },
        {
            "clusters": [
                {
                    "alertCount": 0,
                    "authEnabled": true,
                    "availability": "dead",
                    "backupEnabled": false,
                    "clusterId": "5e6be93fd434591c4ca765f6",
                    "dataSizeBytes": 0,
                    "name": "Cluster0",
                    "nodeCount": 0,
                    "sslEnabled": true,
                    "type": "replica set",
                    "versions": [
                        "4.2.3"
                    ]
                }
            ],
            "groupId": "5df90923f10fab675508b065",
            "groupName": "gcp",
            "orgId": "5df7a168f10fab3a149357fb",
            "orgName": "jww-12-16",
            "planType": "Atlas",
            "tags": []
        }
    ],
    "totalCount": 3
}
←   Clusters Get All Clusters  →