Hi there ,
I’m looking for a solution to change my cluster tier with Atlas API programmatically (I want to scale it down during nighttime and scale up during day time). Is there any way to do that?
I really appreciate any help you can provide.
Hi there ,
I’m looking for a solution to change my cluster tier with Atlas API programmatically (I want to scale it down during nighttime and scale up during day time). Is there any way to do that?
I really appreciate any help you can provide.
Hi there!
Since there wasn’t a reply to your message, I tried to run it by our documentation bot. Here is the response I got
Yes, you can programmatically change the cluster tier using the MongoDB Atlas API. This allows you to scale your cluster up or down based on your needs, such as scaling down during nighttime and scaling up during daytime.
To modify the cluster tier, you can use the Modify a Cluster endpoint of the Atlas API. Here is a general outline of how you can achieve this:
Here is an example using curl
:
curl -u "<publicKey>:<privateKey>" --digest \ -X PATCH "https://cloud.mongodb.com/api/atlas/v1.0/groups/<projectId>/clusters/<clusterName>" \ -H "Content-Type: application/json" \ -d '{ "providerSettings": { "instanceSizeName": "M10" // Change to your desired tier } }'
Replace <publicKey>
, <privateKey>
, <projectId>
, and <clusterName>
with your actual Atlas API credentials and cluster details. Adjust the instanceSizeName
to the desired tier.
Remember to handle any potential downtime or impact on your application when changing the cluster tier, as the cluster will reboot during the modification process.
Modify a Cluster
Docs
Configure Additional Settings
Docs
Create a Cluster
Docs
Topic | Replies | Views | Activity |
---|---|---|---|
Realm Server Queries | 0 | 288 | May 2024 |
Would it be possible for the MongoDB Node.js driver to extract the correct “projection” type? | 4 | 655 | May 2024 |
Would it be possible for the MongoDB Node.js driver to give a typescript warning if filtering on field that does not exists? | 4 | 586 | May 2024 |
Certificate based logins rejected today - june 6th, 2024 due to Letsencrypt intermediate chain rotation | 0 | 683 | Jun 2024 |
DNS Resolution Issue for Private Endpoint on MongoDB Atlas Cluster in Azure | 1 | 404 | Jul 2024 |