Permalink
Browse files

introduce ps:stop

  • Loading branch information...
1 parent c2157b5 commit a6d9eb7f314bf2c5f162a508e8d764286fb577bb @mmcgrana mmcgrana committed Oct 10, 2011
Showing with 30 additions and 1 deletion.
  1. +4 −0 lib/heroku/client.rb
  2. +26 −1 lib/heroku/command/ps.rb
View
@@ -512,6 +512,10 @@ def ps_restart(app, opts={})
post("/apps/#{app}/ps/restart", opts)
end
+ def ps_stop(app, opts={})
+ post("/apps/#{app}/ps/stop", opts)
+ end
+
def confirm_billing
post("/user/#{escape(@user)}/confirm_billing").to_s
end
View
@@ -121,5 +121,30 @@ def scale
alias_command "scale", "ps:scale"
-end
+ # ps:stop PROCESS
+ #
+ # stop an app process
+ #
+ # Example: heroku stop run.3
+ #
+ def stop
+ app = extract_app
+ opt =
+ if (args.first =~ /.+\..+/)
+ ps = args.first
+ display "Stopping #{ps} process... ", false
+ {:ps => ps}
+ elsif args.first
+ type = args.first
+ display "Stopping #{type} processes... ", false
+ {:type => type}
+ else
+ error "Usage: heroku ps:stop PROCESS"
+ end
+ heroku.ps_stop(app, opt)
+ display "done"
+ end
+
+ alias_command "stop", "ps:stop"
+end

0 comments on commit a6d9eb7

Please sign in to comment.