Integrations / MongoDB Atlas
MongoDB Atlas
MongoDB Atlas administration: list projects, clusters, database users, alerts, IP access list entries, organizations and process metrics through the Atlas Administration API v2, signed in with an Atlas service account. It does not read or write documents: that needs the MongoDB wire protocol (a driver), and the Atlas Data API that offered an HTTP route to documents has been retired by MongoDB.
10 actions
token_login
10 read0 write
Calls cloud.mongodb.com
Connect
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "mongodb" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();Permissions requested
This toolkit uses a single credential and requests no scopes.
Actions
Get clusterreadmongodb.get_clusterGet one Atlas cluster by name: state, type, MongoDB version, whether it is paused, backup and termination protection settings, and its connection strings.
| Input | Type | Description | |
|---|---|---|---|
group_id | string | Required | Project (group) ID: 24 hex characters, from list_projects |
cluster_name | string | Required | Cluster name, from list_clusters |
await setu.execute({
userId: "user_1",
action: "mongodb.get_cluster",
input: {
"group_id": "<group_id>",
"cluster_name": "<cluster_name>"
},
});Get process metricsreadmongodb.get_process_measurementsGet time series metrics (such as OPCOUNTER_CMD, CONNECTIONS, SYSTEM_CPU_USER) for one MongoDB process over a period. Get the process ID (hostname:port) from list_processes. Granularity and either a period or a start and end are needed.
| Input | Type | Description | |
|---|---|---|---|
group_id | string | Required | Project (group) ID: 24 hex characters, from list_projects |
process_id | string | Required | Process ID as hostname:port, from list_processes |
granularity | string | Required | Interval between data points as an ISO 8601 duration, e.g. PT1M, PT5M, PT1H, P1D |
period | string | Optional | How far back to report, as an ISO 8601 duration, e.g. PT1H or P1D (use instead of start and end) |
m | string | Optional | One metric name, e.g. OPCOUNTER_CMD, CONNECTIONS, SYSTEM_CPU_USER; omit for all metrics |
start | string | Optional | Start time (ISO 8601 UTC), with end instead of period |
end | string | Optional | End time (ISO 8601 UTC) |
await setu.execute({
userId: "user_1",
action: "mongodb.get_process_measurements",
input: {
"group_id": "<group_id>",
"process_id": "<process_id>",
"granularity": "<granularity>"
},
});Get projectreadmongodb.get_projectGet one Atlas project (group) by ID: its name, organization, creation date and cluster count.
| Input | Type | Description | |
|---|---|---|---|
group_id | string | Required | Project (group) ID: 24 hex characters, from list_projects |
await setu.execute({
userId: "user_1",
action: "mongodb.get_project",
input: {
"group_id": "<group_id>"
},
});List alertsreadmongodb.list_alertsList the alerts of an Atlas project, optionally only OPEN, TRACKING or CLOSED ones, with event type, affected cluster and timestamps.
| Input | Type | Description | |
|---|---|---|---|
group_id | string | Required | Project (group) ID: 24 hex characters, from list_projects |
status | string | Optional | Only alerts in this status; omit for all |
items_per_page | integer | Optional | Results per page (1-500, default 100) |
page_num | integer | Optional | Page number, starting at 1 |
await setu.execute({
userId: "user_1",
action: "mongodb.list_alerts",
input: {
"group_id": "<group_id>"
},
});List clustersreadmongodb.list_clustersList the clusters in an Atlas project, returned as parallel lists (same order) of cluster names, states (IDLE, CREATING, UPDATING, DELETING, REPAIRING), MongoDB versions, types and SRV connection strings. Connection strings are addresses only; connecting to the database needs the MongoDB wire protocol, which this toolkit does not offer.
| Input | Type | Description | |
|---|---|---|---|
group_id | string | Required | Project (group) ID: 24 hex characters, from list_projects |
items_per_page | integer | Optional | Results per page (1-500, default 100) |
page_num | integer | Optional | Page number, starting at 1 |
await setu.execute({
userId: "user_1",
action: "mongodb.list_clusters",
input: {
"group_id": "<group_id>"
},
});List database usersreadmongodb.list_database_usersList the database users defined in an Atlas project: username, authentication database and roles. Passwords are never returned.
| Input | Type | Description | |
|---|---|---|---|
group_id | string | Required | Project (group) ID: 24 hex characters, from list_projects |
items_per_page | integer | Optional | Results per page (1-500, default 100) |
page_num | integer | Optional | Page number, starting at 1 |
await setu.execute({
userId: "user_1",
action: "mongodb.list_database_users",
input: {
"group_id": "<group_id>"
},
});List IP access listreadmongodb.list_ip_access_listList the IP access list entries of an Atlas project: the IP addresses, CIDR blocks or security groups allowed to connect, with comments and expiry.
| Input | Type | Description | |
|---|---|---|---|
group_id | string | Required | Project (group) ID: 24 hex characters, from list_projects |
items_per_page | integer | Optional | Results per page (1-500, default 100) |
page_num | integer | Optional | Page number, starting at 1 |
await setu.execute({
userId: "user_1",
action: "mongodb.list_ip_access_list",
input: {
"group_id": "<group_id>"
},
});List organizationsreadmongodb.list_organizationsList the Atlas organizations the service account belongs to, optionally filtered by name (case-insensitive).
| Input | Type | Description | |
|---|---|---|---|
name | string | Optional | Only organizations whose name matches (case-insensitive) |
items_per_page | integer | Optional | Results per page (1-500, default 100) |
page_num | integer | Optional | Page number, starting at 1 |
await setu.execute({
userId: "user_1",
action: "mongodb.list_organizations",
input: {},
});List processesreadmongodb.list_processesList the mongod and mongos processes of an Atlas project. Each process ID (hostname:port) is what get_process_measurements needs.
| Input | Type | Description | |
|---|---|---|---|
group_id | string | Required | Project (group) ID: 24 hex characters, from list_projects |
items_per_page | integer | Optional | Results per page (1-500, default 100) |
page_num | integer | Optional | Page number, starting at 1 |
await setu.execute({
userId: "user_1",
action: "mongodb.list_processes",
input: {
"group_id": "<group_id>"
},
});List projectsreadmongodb.list_projectsList the Atlas projects (also called groups) the service account can see, with each project's ID, name, organization and cluster count. Start here to get the project ID the other actions need.
| Input | Type | Description | |
|---|---|---|---|
items_per_page | integer | Optional | Results per page (1-500, default 100) |
page_num | integer | Optional | Page number, starting at 1 |
await setu.execute({
userId: "user_1",
action: "mongodb.list_projects",
input: {},
});