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 |
---|---|---|---|
Account Locked, Back Ups and Billing | 1 | 571 | May 2024 |
Running mongodb/atlas local in kubernetes: exit status 1 | 1 | 311 | May 2024 |
Can I increase my cloud.mongodb.com/v2 cookie session length? | 0 | 141 | Jul 2024 |
MongoDB-Atlas-Local - error related to volumes configured | 0 | 208 | Oct 2024 |
One node is in down status and I don’t know how to repair it | 0 | 59 | Dec 2024 |