I want to increase/decrease workers by code, can you help?
I have a serverless setup already.
Generally we keep
1 active worker
in the actual time when we expect the traffic throughout the day, and at night when no one is using the application we make active workers 0
to avoid any charges. And then the next day, we make active workers 1
manually from runpod dashboard.
We are willing to do that automatically. I know there is a GraphQL
but I am not able to find relevant code to do that.
Can anyone please help?
Thanks!!6 Replies
I wanted to ask for the exact same thing!
Let's hope for the best!
it's actually possible by Graph QL API, you can find a sample Endpoint mutation call below
GraphQL API Docs:
https://graphql-spec.runpod.io/
Without API Docs:
you can go to your dashboard and open the Developer Tools by F12
go to Network tab
then make an update on your endpoint and find the mutation API call
then you can just copy that as CURL and work on it on postman
remember to remove all Headers and add api_key query param
The network hack is a Gem 💎
Will surely try this!! Thanks!!
🚀
PS: To set Active Worker you need to set the workersMin variable in json
In the reference there is no such mutation for endpoints?
Oh there is