3.19.0 • Published 1 month ago

mongodb-atlas-api-client v3.19.0

Weekly downloads
85
License
ISC
Repository
github
Last release
1 month ago

Mongodb atlas api client for NODEJS

A mongdb atlas api client for nodejs.

Coverage Status NPM Publish

NPM

How to install

npm install mongodb-atlas-api-client

Getting Started

The basic syntax is

Atlas API uses HTTP Digest Authentication. It essentially requires a username and a password which are hashed using a unique server-generated value called a nonce. The username is the API public key and the password is the corresponding private key. It internally uses urllib

const getClient = require("mongodb-atlas-api-client");
const {user, cluster} = getClient({
  "publicKey": "some public key",
  "privateKey": "some private key",
  "baseUrl": "https://cloud.mongodb.com/api/atlas/v1.0",
  "projectId": "some project/group id"
});

const options = {
  "envelope": true,
  "itemsPerPage": 10,
  "pretty": true,
  "httpOptions": { // This parameter will not be sent as querystring. This will be send to http request package `urllib`
    "timeout": 5000
  }
}

const response = await user.getAll(options); // get All users
const response = await cluster.get("someClusterName"); // get single cluster
const response = await user.delete("someUserName", options); // delete single user
const response = await user.create(body, options); // create user
const response = await user.update("someUserName", body, options); // update user

Running the tests

npm test

API

Following entities are currently supported

User

user.get(username, options) ⇒ Promise

Function - Returns the details of user name passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
usernameStringname of the user for which details needs to be retrieved
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib.

More details - https://docs.atlas.mongodb.com/reference/api/database-users-get-single-user/

user.getAll(options) ⇒ Promise

Function - Returns all the users. Pagination can be controlled via options object.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/database-users-get-all-users/

user.create(body, options) ⇒ Promise

Function - Creates the user as per body passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
bodyObjectBody which has details for user which needs to be created
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/database-users-create-a-user/

user.update(username, body, options) ⇒ Promise

Function - Updates the user for the username passed. It only updates the properties passed in body.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
usernameStringname of the user for which details needs to be updated
bodyObjectBody which has details for user which needs to be updated
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/database-users-update-a-user/

user.delete(username, options) ⇒ Promise

Function - Deletes the user name passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
usernameStringname of the user which needs to be deleted
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/database-users-delete-a-user/

CloudBackup

cloudBackup.getReplicaSetCloudBackup(clustername, snapshotId, options) ⇒ Promise

Function - Returns the details of the specified snapshotId.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
clusternameStringname of the cluster for which details needs to be retrieved
snapshotIdStringId of the snapshot for which details needs to be retrieved
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v1/#tag/Cloud-Backups/operation/getReplicaSetBackup

cloudBackup.getAllReplicaSetCloudBackups(clustername, options) ⇒ Promise

Function - Returns the details of all snapshots of an specified clustername.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
clusternameStringname of the cluster for which details needs to be retrieved
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v1/#tag/Cloud-Backups/operation/listReplicaSetBackups

cloudBackup.getSnapshotRestoreJob(clustername, restoreJobId, options) ⇒ Promise

Function - Returns the details of all snapshots of an specified clustername.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
clusternameStringname of the cluster for which details needs to be retrieved
restoreJobIdStringsnapshot restore job id for which details needs to be retrieved
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v1/#tag/Cloud-Backups/operation/getBackupRestoreJob

cloudBackup.createSnapshotRestoreJob(clustername, body, options) ⇒ Promise

Function - Returns the details of all snapshots of an specified clustername.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
clusternameStringname of the cluster for which details needs to be retrieved
bodyObjectBody which has details for snapshot restore job which needs to be created
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v1/#tag/Cloud-Backups/operation/createBackupRestoreJob

Cluster

cluster.get(clustername, options) ⇒ Promise

Function - Returns the details of cluster name passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
clusternameStringname of the cluster for which details needs to be retrieved
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/clusters-get-one/

cluster.getAll(options) ⇒ Promise

Function - Returns all the clusters. Pagination can be controlled via options object.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/clusters-get-all/

cluster.getAdvanceConfiguration(clustername, options) ⇒ Promise

Function - Returns the advance configuration of cluster name passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
clusternameStringname of the cluster for which advance configuration needs to be retrieved
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/clusters-get-advanced-configuration-options/

cluster.create(body, options) ⇒ Promise

Function - Creates the cluster as per body passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
bodyObjectBody which has details for cluster which needs to be created
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/clusters-create-one/

cluster.update(clustername, body, options) ⇒ Promise

Function - Updates the cluster for the clustername passed. It only updates the properties passed in body.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
clusternameStringname of the cluster for which details needs to be updated
bodyObjectBody which has details for cluster which needs to be updated
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/clusters-modify-one/

cluster.updateAdvanceConfiguration(clustername, body, options) ⇒ Promise

Function - Updates the advance configuration of cluster for the clustername passed. It only updates the properties passed in body.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
clusternameStringname of the cluster for which advance configuration needs to be updated
bodyObjectBody which has details for cluster which needs to be updated
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/clusters-modify-advanced-configuration-options/

cluster.testPrimaryFailOver(clustername, options) ⇒ Promise

Function - Tests failure of primary replica set member.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
clusternameStringname of the cluster for which failure needs to be tested
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/clusters-test-failover/

cluster.delete(clustername, options) ⇒ Promise

Function - Deletes the cluster name passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
clusternameStringname of the cluster which needs to be deleted
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/clusters-delete-one/

CustomDbRole

customDbRole.get(rolename, options) ⇒ Promise

Function - Returns the details of role name passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
rolenameStringname of the role for which details needs to be retrieved
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/custom-roles-get-single-role/

customDbRole.getAll(options) ⇒ Promise

Function - Returns all the roles. Pagination can be controlled via options object.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/custom-roles-get-all-roles/

customDbRole.create(body, options) ⇒ Promise

Function - Creates the role as per body passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
bodyObjectBody which has details for role which needs to be created
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/custom-roles-create-a-role/

customDbRole.update(rolename, body, options) ⇒ Promise

Function - Updates the role for the rolename passed. It only updates the properties passed in body.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
rolenameStringname of the role for which details needs to be updated
bodyObjectBody which has details for role which needs to be updated
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/custom-roles-update-a-role/

customDbRole.delete(rolename, options) ⇒ Promise

Function - Deletes the role name passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
rolenameStringname of the role which needs to be deleted
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/custom-roles-delete-a-role/

ProjectWhitelist

projectWhitelist.get(whitelistentry, options) ⇒ Promise

Function - Returns the details of whitelistentry name passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
whitelistentryStringname of the whitelistentry for which details needs to be retrieved
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/whitelist-get-one-entry/

projectWhitelist.getAll(options) ⇒ Promise

Function - Returns all the whitelistentries. Pagination can be controlled via options object.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/whitelist-get-all/

projectWhitelist.create(body, options) ⇒ Promise

Function - Creates the whitelistentry as per body passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
bodyObjectBody which has details for whitelistentry which needs to be created
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/whitelist-add-one/

projectWhitelist.update(body, options) ⇒ Promise

Function - Updates the whitelistentry passed. It only updates the properties passed in body.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
bodyObjectBody which has details for whitelistentry which needs to be updated
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/whitelist-update-one/

projectWhitelist.delete(whitelistentry, options) ⇒ Promise

Function - Deletes the whitelistentry name passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
whitelistentryStringname of the whitelistentry which needs to be deleted
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/whitelist-delete-one/

ProjectAccesslist

projectAccesslist.get(accesslistentry, options) ⇒ Promise

Function - Returns the details of accesslistentry name passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
accesslistentryStringname of the accesslistentry for which details needs to be retrieved
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/ip-access-list/get-one-access-list-entry/

projectAccesslist.getAll(options) ⇒ Promise

Function - Returns all the accesslistentries. Pagination can be controlled via options object.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/ip-access-list/get-all-access-list-entries/

projectAccesslist.create(body, options) ⇒ Promise

Function - Creates the accesslistentry as per body passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
bodyObjectBody which has details for accesslistentry which needs to be created
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/ip-access-list/add-entries-to-access-list/

projectAccesslist.update(body, options) ⇒ Promise

Function - Updates the accesslistentry passed. It only updates the properties passed in body.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
bodyObjectBody which has details for accesslistentry which needs to be updated
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/ip-access-list/add-entries-to-access-list/

projectAccesslist.delete(accesslistentry, options) ⇒ Promise

Function - Deletes the accesslistentry name passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
accesslistentryStringname of the accesslistentry which needs to be deleted
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/ip-access-list/delete-one-access-list-entry/

Project

project.getById(projectId, options) ⇒ Promise

Function - Returns the details of project id passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
projectIdStringproject id for which details needs to be retrieved
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/project-get-one/

project.getByName(projectName, options) ⇒ Promise

Function - Returns the details of project name passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
projectIdStringproject name for which details needs to be retrieved
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/project-get-one-by-name/

project.getTeamsByProjectId(projectId, options) ⇒ Promise

Function - Returns the teams of project id passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
projectIdStringproject id for which teams needs to be retrieved
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/project-get-teams/

project.getAll(options) ⇒ Promise

Function - Returns all the projects. Pagination can be controlled via options object.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/project-get-all/

project.create(body, options) ⇒ Promise

Function - Creates the project as per body passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
bodyObjectBody which has details for project which needs to be created
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/project-create-one/

project.assignTeams(projectId, body, options) ⇒ Promise

Function - Assigns the teams for the projectId passed. It only updates the properties passed in body.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
projectIdStringId of the project for which teams needs to be associated
bodyObjectBody which has details for teams which needs to be associated
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/project-add-team/

project.delete(projectId, options) ⇒ Promise

Function - Deletes the project id passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
projectIdStringId of the project which needs to be deleted
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/project-delete-one/

project.removeUserFromProject(projectId, userId, options) ⇒ Promise

Function - Removes the user id passed from the project.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
userIdStringId of the user which needs to be removed from project
projectIdStringId of the project
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/project-remove-user/

Organization

organization.getById(organizationId, options) ⇒ Promise

Function - Returns the details of organization id passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
organizationIdStringorg§ id for which details needs to be retrieved
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/organization-get-one/

organization.getAllUsersForOrganization(organizationId, options) ⇒ Promise

Function - Returns all the users for organization id passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
organizationIdStringorganization id for which users needs to be retrieved
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/organization-users-get-all-users/

organization.getAllProjectsForOrganization(organizationId, options) ⇒ Promise

Function - Returns all the projects for organization id passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
organizationIdStringorganization id for which projects needs to be retrieved
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/organization-get-all-projects/

organization.getAll(options) ⇒ Promise

Function - Returns all the organizations. Pagination can be controlled via options object.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/organization-get-all/

organization.rename(organizationId, body, options) ⇒ Promise

Function - Renames the organization

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
organizationIdStringId of the organization for which needs to be renamed
bodyObjectBody which has details for organization which needs to be renamed
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/organization-rename/

organization.invite(organizationId, body, options) ⇒ Promise

Function - Sends an invitation to the given email (username) to join the Organization

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
organizationIdStringId of the organization for which needs to be renamed
bodyObjectOrganization invitation details
body.rolesstring[]Atlas roles to assign to the invited user. If the user accepts the invitation, Atlas assigns these roles to them.
body.teamIdsstring[](Optional) Unique 24-hexadecimal digit strings that identify the teams that you invite the user to join.
body.usernamestringEmail address of the invited user. This is the address to which Atlas sends the invite.
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/organization-create-one-invitation/

organization.delete(organizationId, options) ⇒ Promise

Function - Deletes the project id passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
organizationIdStringId of the organization which needs to be deleted
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/organization-delete-one/

AtlasUser

atlasUser.getById(userId, options) ⇒ Promise

Function - Returns the details of user id passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
userIdStringId of the user for which details needs to be retrieved
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/user-get-by-id/

atlasUser.getByName(username, options) ⇒ Promise

Function - Returns the details of user name passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
usernameStringName of the user for which details needs to be retrieved
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/user-get-one-by-name/

atlasUser.getAll(options) ⇒ Promise

Function - Returns all the users. Pagination can be controlled via options object.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/user-get-all/

atlasUser.create(body, options) ⇒ Promise

Function - Creates the atlas user as per body passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
bodyObjectBody which has details for atlas user which needs to be created
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/user-create/

atlasUser.update(userId, body, options) ⇒ Promise

Function - Updates the user for the userId passed. It only updates the properties passed in body.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
userIdStringId of the user for which details needs to be updated
bodyObjectBody which has details for user which needs to be updated
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/user-update/

Event

event.get(eventId, options) ⇒ Promise

Function - Returns the details of event id passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
eventIdStringid of the event for which details needs to be retrieved
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/events-projects-get-one/

event.getAll(options) ⇒ Promise

Function - Returns all the events. Pagination can be controlled via options object.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/events-projects-get-all/

event.getByOrganizationId(organizationId, eventId, options) ⇒ Promise

Function - Returns the details of event id passed for organization id.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
organizationIdStringid of the organization for which details needs to be retrieved
eventIdStringid of the event for which details needs to be retrieved
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/events-orgs-get-one/

event.getAllByOrganizationId(organizationId, options) ⇒ Promise

Function - Returns all the events. Pagination can be controlled via options object.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
organizationIdStringid of the organization for which details needs to be retrieved
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/events-orgs-get-all/

Alert

alert.get(alertId, options) ⇒ Promise

Function - Returns the details of alert id passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
alertIdStringid of the alert for which details needs to be retrieved
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/alerts-get-alert/

alert.getAll(options) ⇒ Promise

Function - Returns all the alerts. Pagination can be controlled via options object.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/alerts-get-all-alerts/

event.acknowledge(alertId, options) ⇒ Promise

Function - Acknowledge or unacknowledge an alert

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
alertIdStringid of the alert which needs to be acknowledged
bodyObjectBody which has details for alert which needs to be acknowledged
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/alerts-acknowledge-alert/

DataLake

dataLake.get(dataLakeName, options) ⇒ Promise

Function - Returns the details of dataLake name passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
dataLakeNameStringname of the dataLake for which details needs to be retrieved
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.mongodb.com/datalake/reference/api/dataLakes-get-one-tenant/

dataLake.getAll(options) ⇒ Promise

Function - Returns all the dataLakes. Pagination can be controlled via options object.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.mongodb.com/datalake/reference/api/dataLakes-get-all-tenants/

dataLake.getLogsStream(dataLakeName, options) ⇒ Promise

Function - Returns the dataLake logs stream.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
dataLakeNameStringname of the dataLake for which details needs to be retrieved
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.mongodb.com/datalake/reference/api/dataLakes-download-query-logs/

dataLake.create(body, options) ⇒ Promise

Function - Creates the dataLake as per body passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
bodyObjectBody which has details for dataLake which needs to be created
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.mongodb.com/datalake/reference/api/dataLakes-create-one-tenant/

dataLake.update(dataLakeName, body, options) ⇒ Promise

Function - Updates the dataLake for the username passed. It only updates the properties passed in body.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
dataLakeNameStringname of the dataLake for which details needs to be retrieved
bodyObjectBody which has details for dataLake which needs to be updated
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.mongodb.com/datalake/reference/api/dataLakes-update-one-tenant/

dataLake.delete(dataLakeName, options) ⇒ Promise

Function - Deletes the dataLake name passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
dataLakeNameStringname of the datalake which needs to be deleted
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.mongodb.com/datalake/reference/api/dataLakes-delete-one-tenant/

CloudProviderAccess

cloudProviderAccess.getAll(options) ⇒ Promise

Function - Returns all the cloudProviderAccess. Pagination can be controlled via options object.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/cloud-provider-access-get-roles/

cloudProviderAccess.create(body, options) ⇒ Promise

Function - Creates the cloudProviderAccess as per body passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
bodyObjectBody which has details for cloudProviderAccess which needs to be created
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/cloud-provider-access-create-one-role/

cloudProviderAccess.update(roleId, body, options) ⇒ Promise

Function - Updates the cloudProviderAccess for the roleId passed. It only updates the properties passed in body.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
roleIdStringroleId of the cloudProviderAccess for which details needs to be updated
bodyObjectBody which has details for dataLake which needs to be updated
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/cloud-provider-access-authorize-one-role/

cloudProviderAccess.delete(roleId, options) ⇒ Promise

Function - Deletes the cloudProviderAccess name passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
roleIdStringroleId of the cloudProviderAccess which needs to be deleted
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/cloud-provider-access-deauthorize-one-role/

AtlasSearch

atlasSearch.get(clusterName, indexId, options) ⇒ Promise

Function - Returns the details of atlas search index by cluster name and index passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
clusterNameStringname of the cluster for which details needs to be retrieved
indexIdStringid of the index for which details needs to be retrieved
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/fts-indexes-get-one/

atlasSearch.getAll(clusterName, databaseName, collectionName, options) ⇒ Promise

Function - Returns all the atlas search indexes. Pagination can be controlled via options object.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
clusterNameStringname of the cluster for which details needs to be retrieved
databaseNameStringname of the database for which details needs to be retrieved
collectionNameStringname of the collection for which details needs to be retrieved
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/fts-indexes-get-all/

atlasSearch.getAllAnalyzers(clusterName, options) ⇒ Promise

Function - Returns all the Analyzers. Pagination can be controlled via options object.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
clusterNameStringname of the cluster for which details needs to be retrieved
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/fts-analyzers-get-all/

atlasSearch.create(clusterName, body, options) ⇒ Promise

Function - Creates the atlas search index as per body passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
clusterNameStringname of the cluster for which details needs to be retrieved
bodyObjectBody which has details for cluster which needs to be created
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/fts-indexes-create-one/

atlasSearch.update(clusterName, indexId, body, options) ⇒ Promise

Function - Updates the atlas search index for the clusterName passed. It only updates the properties passed in body.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
clusterNameStringname of the cluster for which details needs to be updated
indexIdStringname of the index for which details needs to be updated
bodyObjectBody which has details for cluster which needs to be updated
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/fts-indexes-update-one/

atlasSearch.upsertAnalyzer(clusterName, body, options) ⇒ Promise

Function - Upserts the analyser for the clusterName passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
clusterNameStringname of the cluster for which details needs to be upserted
bodyObjectBody which has details for cluster which needs to be upserted
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/fts-analyzers-update-all/

atlasSearch.delete(clusterName, indexId, options) ⇒ Promise

Function - Deletes the atlas search index by cluster name passed.

Returns: Promise - - promise which resolves on success and rejects on error

ParamTypeDefaultDescription
clusterNameStringname of the cluster which needs to be deleted
indexIdStringname of the index for which details needs to be deleted
optionsObject{}Optional object containing extra query strings which will be passed to atlas api. It can also include httpOptions which will be sent to urllib. More info can be found here - https://github.com/node-modules/urllib

More details - https://docs.atlas.mongodb.com/reference/api/fts-indexes-delete-one/

3.19.0

1 month ago

3.18.0

3 months ago

3.17.0

3 months ago

3.15.0

8 months ago

3.16.0

7 months ago

3.12.0

10 months ago

3.14.0

10 months ago

3.11.0

12 months ago

3.13.0

10 months ago

3.10.0

1 year ago

3.9.0

1 year ago

3.8.0

1 year ago

3.4.0

2 years ago

3.6.0

1 year ago

3.7.0

1 year ago

3.5.0

2 years ago

3.3.0

2 years ago

2.32.0

2 years ago

3.2.0

2 years ago

3.0.0

2 years ago

3.1.0

2 years ago

2.30.0

2 years ago

2.31.0

2 years ago

2.29.0

2 years ago

2.28.0

2 years ago

2.27.0

3 years ago

2.26.0

3 years ago

2.25.0

3 years ago

2.24.0

3 years ago

2.23.0

3 years ago

2.22.0

3 years ago

2.21.0

3 years ago

2.20.0

3 years ago

2.17.0

3 years ago

2.18.0

3 years ago

2.16.0

3 years ago

2.15.0

3 years ago

2.14.0

3 years ago

2.13.0

3 years ago

2.12.0

3 years ago

2.11.0

3 years ago

2.10.0

4 years ago

2.9.0

4 years ago

2.8.0

4 years ago

2.7.0

4 years ago

2.6.0

4 years ago

2.5.0

4 years ago

2.4.0

4 years ago

2.3.0

4 years ago

2.2.0

4 years ago

2.1.1

4 years ago

2.0.0

4 years ago

1.26.0

4 years ago

1.25.0

4 years ago

1.24.1

4 years ago

1.24.0

4 years ago

1.23.0

4 years ago

1.22.0

4 years ago

1.21.0

4 years ago

1.20.0

4 years ago

1.19.0

4 years ago

1.18.2

4 years ago

1.18.0

4 years ago

1.17.0

4 years ago

1.16.0

4 years ago

1.15.0

4 years ago

1.14.0

4 years ago

1.13.0

4 years ago

1.12.0

4 years ago

1.11.0

4 years ago

1.10.0

4 years ago

1.9.2

4 years ago

1.9.1

4 years ago

1.9.0

4 years ago

1.8.0

4 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago