Navigation

Get All Namespaces for a Host

Retrieve up to 20 namespaces for collections experiencing slow queries for a specified host. Namespaces appear in the following format: {database}.{collection}.

Note

If you specify a secondary member of a replica set that has not received any database read operations, the endpoint does not return any namespaces.

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

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

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

Resource

GET /groups/{GROUP-ID}/processes/{PROCESS-ID}/performanceAdvisor/namespaces

Request Path Parameters

Path Element Description
GROUP-ID The unique identifier for the project where the the MongoDB host resides.
PROCESS-ID The unique identifier for the host of a MongoDB process in the following format: {hostname}:{port}. For information about retrieving process ids, see Get All MongoDB Processes in a Group.

Request Query Parameters

Field Required/Optional Description
since Optional Point in time, specified as milliseconds since the Unix Epoch, from which you want to receive results. If you do not also specify the duration parameter, the endpoint returns results from since until the current time. If you do not specify either duration or since, the endpoint returns data for the previous 24 hours.
duration Optional Length of time from the since parameter, in milliseconds, for which you want to receive results. If you do not also specify the since parameter, the endpoint returns results from the number of milliseconds specified by duration before the current time until now. If you do not specify either duration or since, the endpoint returns data for the previous 24 hours.
envelope Optional Boolean that specifies whether or not to wrap the response in an envelope. Default is false.

Request Body Parameters

This endpoint does not use HTTP request body parameters.

Response Elements

Name Type Description
namespaces array Each element in the array represents one namespace on the specified host. Namespaces appear in the following format: {database}.{collection}.
namespaces[i].namespace string A namespace on the specified host.
namespaces[i].type string The type of namespace.

Example Request

curl --digest -i -u "{username}:{apiKey}" \
   "https://cloud.mongodb.com/api/atlas/v1.0/groups/6c381af480eef519ea5cdeb1/processes/cluster0-shard-00-00-mnswc.mongodb-dev.net:27017/performanceAdvisor/namespaces?namespace=data.zips&pretty=true"

Example Response

{
  "namespaces" : [ {
    "namespace" : "data.zips",
    "type" : "COLLECTION"
  }, {
    "namespace" : "data.stocks",
    "type" : "COLLECTION"
  } ]
}