Get All Clusters in All Projects
On this page
- OAuth 2.0 authentication for programmatic access to Cloud Manager is available as a Preview feature.
- The feature and the corresponding documentation might change at any time during the Preview period. To use OAuth 2.0 authentication, create a service account to use in your requests to the Cloud Manager Public API.
Get details for all clusters in all projects available to the programmatic 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/public/v1.0
GET /api/public/v1.0/clusters
Request Path Parameters
This endpoint doesn't 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 that 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:
| false |
Request Body Parameters
This endpoint doesn't use HTTP request body parameters.
Response
Response Parameters
Response Document
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 | array | Array includes one object for each item detailed in the
results Embedded Document section. |
links | array | 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 | Integer count of 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. |
results
Embedded Document
Each result is one project.
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. |
clusters.[n].availability | string | Availability of the cluster. Values include:
|
clusters.[n].backupEnabled | boolean | Specifies if backup is enabled for the cluster. |
clusters.[n].clusterId | string | Unique identifier of the Cloud Manager 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 Cloud Manager. |
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. |
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 Cloud Manager, this value is always Cloud Manager. |
tags | array of strings | Tags applied to the project. |
Example Request
curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest \ --header "Accept: application/json" \ --include \ --request GET "https://cloud.mongodb.com/api/public/v1.0/clusters?pretty=true"
Example Response
Response Header
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
200 OK Vary: Accept-Encoding Content-Type: application/json Strict-Transport-Security: max-age=300 Date: {dateInUnixFormat} Connection: keep-alive Content-Length: {requestLengthInBytes} X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}
Response Body
1 { 2 "links" : [ 3 { 4 "href" : "https://cloud.mongodb.com/api/public/v1.0/clusters", 5 "rel" : "self" 6 } 7 ], 8 "results" : [ 9 { 10 "clusters" : [ 11 { 12 "alertCount" : 0, 13 "authEnabled" : true, 14 "availability" : "available", 15 "backupEnabled" : false, 16 "clusterId" : "5e6bc0352e41683c191c8956", 17 "dataSizeBytes" : 0, 18 "name" : "Cluster1", 19 "nodeCount" : 3, 20 "sslEnabled" : true, 21 "type" : "replica set", 22 "versions" : [ 23 "4.2.3" 24 ] 25 }, 26 { 27 "alertCount" : 0, 28 "authEnabled" : true, 29 "availability" : "available", 30 "backupEnabled" : false, 31 "clusterId" : "5e6bc60ba4c3f47a54d8fe95", 32 "dataSizeBytes" : 0, 33 "name" : "Cluster2", 34 "nodeCount" : 3, 35 "sslEnabled" : true, 36 "type" : "replica set", 37 "versions" : [ 38 "4.2.3" 39 ] 40 } 41 ], 42 "groupId" : "5df90932f10fab675508b0e5", 43 "groupName" : "az", 44 "orgId" : "5df7a168f10fab3a149357fb", 45 "orgName" : "jww-12-16", 46 "planType" : "Cloud Manager", 47 "tags" : [ 48 49 ] 50 }, 51 { 52 "clusters" : [ 53 { 54 "alertCount" : 0, 55 "authEnabled" : true, 56 "availability" : "available", 57 "backupEnabled" : false, 58 "clusterId" : "5e6bbf6a9de0d35b1527dd93", 59 "dataSizeBytes" : 0, 60 "name" : "Cluster0", 61 "nodeCount" : 3, 62 "sslEnabled" : true, 63 "type" : "replica set", 64 "versions" : [ 65 "4.2.3" 66 ] 67 } 68 ], 69 "groupId" : "5df90590f10fab5e33de2305", 70 "groupName" : "jww-12-17", 71 "orgId" : "5df7a168f10fab3a149357fb", 72 "orgName" : "jww-12-16", 73 "planType" : "Cloud Manager", 74 "tags" : [ 75 76 ] 77 }, 78 { 79 "clusters" : [ 80 { 81 "alertCount" : 0, 82 "authEnabled" : true, 83 "availability" : "dead", 84 "backupEnabled" : false, 85 "clusterId" : "5e6be93fd434591c4ca765f6", 86 "dataSizeBytes" : 0, 87 "name" : "Cluster0", 88 "nodeCount" : 0, 89 "sslEnabled" : true, 90 "type" : "replica set", 91 "versions" : [ 92 "4.2.3" 93 ] 94 } 95 ], 96 "groupId" : "5df90923f10fab675508b065", 97 "groupName" : "gcp", 98 "orgId" : "5df7a168f10fab3a149357fb", 99 "orgName" : "jww-12-16", 100 "planType" : "Cloud Manager", 101 "tags" : [ 102 103 ] 104 } 105 ], 106 "totalCount" : 3 107 }