Navigation

Get MongoDB Process by ID

Get information for the specified Atlas MongoDB process in the specified group. An Atlas MongoDB process can be either a mongod or a 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}

Request Path Parameters

Path Element Required/Optional Description
GROUP-ID Required. The unique identifier for the group whose MongoDB processes you want to retrieve.
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 a content object.

Name Type Description
created DateTime Date this Atlas MongoDB process was created by Atlas.
groupId string ID of the group that owns the Atlas MongoDB process.
hostname string The hostname of the machine running the Atlas MongoDB process.
id string The hostname and port of the Atlas MongoDB process in hostname:port format.
lastPing DateTime When the last ping for this Atlas MongoDB process was received.
links array of objects One or more links to sub-resources and/or related resources.
port number The port to which the Atlas MongoDB process listens.
shardName string Name of the shard this process belongs to. Only present if this process is part of a sharded cluster.
replicaSetName string Name of the replica set this process belongs to. Only present if this process is part of a replica set.
typeName string

Type for this Atlas MongoDB process. Possible values are:

  • REPLICA_PRIMARY
  • REPLICA_SECONDARY
  • RECOVERING
  • SHARD_MONGOS
  • SHARD_CONFIG
  • SHARD_STANDALONE
  • SHARD_PRIMARY
  • SHARD_SECONDARY
  • NO_DATA

The type for new processes added to Atlas will be NO_DATA until Atlas completes deployment of the process.

version string Version of MongoDB running for this process.

Example Request

Important

You must modify the following code block with the appropriate credentials, group ID, host, and port.

curl -i -u "username:apiKey" --digest "https://cloud.mongodb.com/api/atlas/v1.0/groups/{GROUP-ID}/processes/{HOST}:{PORT}?pretty=true"

Example Response

HTTP/1.1 200 OK
Content-Type: application/json
Date: Wed, 23 Aug 2017 15:41:26 GMT
Strict-Transport-Security: max-age=300
Content-Length: 948
Connection: keep-alive

{
  "created" : "2017-08-22T15:14:06Z",
  "groupId" : "12345678",
  "hostname" : "shard-00-00.mongodb.net",
  "id" : "shard-00-00.mongodb.net:27017",
  "lastPing" : "2017-08-23T15:40:48Z",
  "links" : [ ... ],
  "port" : 27017,
  "replicaSetName" : "shard-0",
  "typeName" : "REPLICA_PRIMARY",
  "version" : "3.4.7"
}