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 authenticates using HTTP Digest Authentication. Provide a programmatic API public key and corresponding private key as the username and password when constructing the HTTP request.

To learn how to configure API access for an Atlas project, see Configure Atlas API Access.

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

GET /groups/{GROUP-ID}/processes/{PROCESS-ID}/performanceAdvisor/namespaces
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.
Name
Type
Necessity
Description
Default
pageNum
integer
Optional
Page number, starting with one, that Atlas returns of the total number of objects.
1
itemsPerPage
integer
Optional
Number of items that Atlas returns per page, up to a maximum of 500.
100
includeCount
boolean
Optional
Flag that indicates whether Atlas returns the totalCount parameter in the response body.
true
pretty
boolean
Optional
Flag that indicates whether Atlas returns the JSON response in the prettyprint format.
false
envelope
boolean
Optional

Flag that indicates whether Atlas wraps 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.

Endpoints that return a list of results use the results object as an envelope. Atlas adds the status parameter to the response body.

false
since
number
Optional

Timestamp in the number of seconds that have elapsed since the UNIX epoch from which to retrieve suggested indexes.

  • If you don't specify duration, the endpoint returns results between since and the current time.
  • If you specify neither duration nor since, the endpoint returns data for the previous 24 hours.
duration
number
Optional

Length of time in milliseconds during which to find suggested indexes among the managed namespaces in the cluster.

  • If you don't specify since, the endpoint returns results for the duration before the current time.
  • If you specify neither duration nor since, the endpoint returns data for the previous 24 hours.

This endpoint does not use HTTP request body parameters.

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.
curl --digest -i -u "{PUBLIC-KEY}:{PRIVATE-KEY}" \
"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"
{
"namespaces" : [ {
"namespace" : "data.zips",
"type" : "COLLECTION"
}, {
"namespace" : "data.stocks",
"type" : "COLLECTION"
} ]
}
Give Feedback