MongoDB Atlas API
Registering an account for MongoDB Atlas in MechCloud OIDC Proxy
Once you have deployed MechCloud OIDC proxy (see parent section for instructions), you will need to add an account for MongoDB Atlas api before using the REST API chatbot for managing your resources (e.g. clusters) in your MongoDB Atlas account. Here is the curl command to create a MongoDB Atlas account in MechCloud OIDC proxy -
Above command require a MechCloud jwt token which can be generated by logging into MechCloud console and then opening https://portal.mechcloud.io/oauth2/auth1 link in the same or a different tab.
Before executing above command, you will need to create a service account in MongoDB Atlas UI and update client id / secret in the above command with the generated client id and client secret. Here are the steps for same -
Login to MongoDB Atlas console.
Navigate to Access Manager -> Organization Access.
Click and Add New button and select Service Account from the dropdown.
Enter the required details for the service account and choose a role (e.g. Organization Read Only) under Organization Permissions dropdown.
Click on Projects in the left menu for the organization and then click on a project name.
Navigate to Access Manager -> Project Access using the top menu.
Click on Invite to Project button.
Click in the search field and it will automatically display all the service accounts.
Select a service account from the dropdown and choose an appropriate project role (e.g. Project Read Only).
Prompts for Supported Operations
Projects
Listing all the projects
Listing items in a project IP access list
You can get project_id
from one of the above prompts.
Adding items in a project IP access list
You can get project_id
from one of the above prompts. @CURRENT_IP
is a special placeholder which will be replaced with the ip of the machine where this prompt will be executed from.
Last updated