Navigation

Get Available Disks for a MongoDB Process

Get all disks or partitions for the specified Atlas MongoDB process. A Atlas MongoDB process can be either a mongod or mongos.

The Atlas API uses HTTP Digest Authentication. Provide your Atlas username and group API key as the username and password when constructing the HTTP request.

For complete documentation on configuring API access for an Atlas group, see Configure Atlas API Access.

Base URL: https://cloud.mongodb.com/

Resource

GET api/atlas/v1.0/groups/{GROUP-ID}/processes/{HOST}:{PORT}/disks

Request Path Parameters

Parameter Required/Optional Description
GROUP-ID Required ID of the group that owns this Atlas MongoDB process.
HOST Required The hostname of the machine running the Atlas MongoDB process.
PORT Required The port to which the Atlas MongoDB process listens.

Request Query Parameters

Field Required/Optional Description
pageNum Optional.

The page to return.

Defaults to 1.

itemsPerPage Optional.

Maximum number of items to return per page.

Defaults to 100.

envelope Optional.

A boolean that specifies whether or not to wrap the response in an envelope.

Defaults to false.

pretty Optional.

A boolean that specifies whether or not to return a “pretty-printed” JSON document.

Defaults to false.

Request Body Parameters

This endpoint does not use HTTP request body parameters.

Response Elements

If you set the query element envelope to true, the response is wrapped by the content object.

The HTTP response returns a JSON document that includes the following objects:

results Array

Each object in the results array represents a single disk for the MongoDB process.

Name Type Description
links array

An array containing a single document with the following format:

{
   "href" : "https://cloud.mongodb.com/api/atlas/v1.0/groups/{GROUP-ID}/processes/{HOST}:{PORT}/disks/{DISK-ID}",
   "rel" : "self"
}

You can use the href value to retrieve measurements for the disk.

See Linking for more information on links.

partitionName string The name of the disk or partition. You can use this value to retrieve measurements for the disk.
links Array
An array of documents, representing a link to one or more sub-resources and/or related resources such as list pagination. See Linking for more information.
totalCount
The total number of items in the result set. This value may be higher than the number of objects in the results array if the entire result set is paginated.

Example Request

Replace the information in brackets {} with your own Atlas information to execute this example request:

curl -u "<ATLAS-USERNAME>:<API-KEY>" --digest -i "https://cloud.mongodb.com/api/atlas/v1.0/groups/{GROUP-ID}/processes/{HOST}:{PORT}/disks?pretty=true"

Example Response

{
   "links":[
      {
         "href":"https://cloud.mongodb.com/api/atlas/v1.0/groups/12345678/processes/shard-00-00.mongodb.net:27017/disks?pageNum=1&itemsPerPage=100",
         "rel":"self"
      }
   ],
   "results":[
      {
         "links":[
            {
               "href":"https://cloud.mongodb.com/api/atlas/v1.0/groups/12345678/processes/shard-00-00.mongodb.net:27017/disks/xvdb",
               "rel":"self"
            }
         ],
         "partitionName":"xvdb"
      }
   ],
   "totalCount":1
}