I want to add and remove Heroku Dynos through platform API Just like we do
ps:scale web=0
in Heroku toolbelt CLI.
I have already tried
POST /apps/{app_id_or_name}/dynos/{dyno_id_or_name}/actions/stop
but it doesn't do anything however the response has a status code of 200.
As per the dyno stop
ps:stop
behavior outlined in this question:Running
ps:stop
on dynos that are part of a scaled process will automatically be restarted. In Private Spaces,ps:stop
will terminate and replace the dedicated instance running the dyno(s). To permanently stop dynos, scale down the process."To scale down the dynos to 0 through the Platform API, you'll need to use formation API.
Formation List:
Formation Update:
Sending quantity = 0 as a parameter will scale the dyno process to zero.