How can I schedule resizing a Linode?
Linode
Linode Staff
How can I set a specific time to resize my Linode?
1 Reply
tommydavidson
Linode Staff
While there is no way to do this directly using the tools on our platform (Cloud Manager, API, or CLI), you can write a script that uses the CLI or API, and execute it using a cron job.
An example script using the API would look similar to this:
#!/usr/bin/env bash
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer $API_TOKEN" \
-X POST -d '{
"type": "g6-standard-2"
}' \
https://api.linode.com/v4/linode/instances/$LINODE_ID/resize
And example script using the CLI would look similar to this:
#!/usr/bin/env bash
linode-cli linodes resize $LINODE_ID --type g6-standard-2
The documentation for the resize endpoint can be found here.