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}.

Info With Circle IconCreated with Sketch.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 ElementDescription
GROUP-IDThe unique identifier for the project where the the MongoDB host resides.
PROCESS-IDThe 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.
FieldRequired/OptionalDescription
sinceOptionalPoint 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.
durationOptionalLength 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.
envelopeOptionalBoolean that specifies whether or not to wrap the response in an envelope. Default is false.

This endpoint does not use HTTP request body parameters.

NameTypeDescription
namespacesarrayEach element in the array represents one namespace on the specified host. Namespaces appear in the following format: {database}.{collection}.
namespaces[i].namespacestringA namespace on the specified host.
namespaces[i].typestringThe 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