heroku / platform-api

Ruby HTTP client for the Heroku API
MIT License
214 stars 85 forks source link

Is there a way to stop a Dyno? #52

Closed AaronMegaphone closed 7 years ago

AaronMegaphone commented 7 years ago

I can't seem to find a way to stop a Dyno using the platform-api gem. Is this by design? I can see here https://devcenter.heroku.com/articles/platform-api-reference that the API includes a Dyno Stop endpoint. The only alternative I can think of is to create a Dyno with Dyno#create and run heroku ps:stop run.1

geemus commented 7 years ago

It's not particularly clear as currently documented, but restart will also give you what you need (delete dyno). Basically, when you call this you get one of two things. 1) it's a permanent dyno from your procfile, so it gets replaced with a new dyno or 2) it's a run/scheduler dyno, so it just gets stopped. Hope that gets you what you need.

AaronMegaphone commented 7 years ago

@geemus Thanks a lot that is exactly what I'm looking for. A kill switch to stop a one-off dyno.