Class: Heroku::Command::Maintenance
- Defined in:
- lib/heroku/command/maintenance.rb
Overview
manage maintenance mode for an app
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#index ⇒ Object
maintenance.
-
#off ⇒ Object
maintenance:off.
-
#on ⇒ Object
maintenance:on.
Methods inherited from Base
#api, #app, #heroku, #initialize, namespace
Methods included from Helpers
#action, #ask, #confirm, #confirm_billing, #confirm_command, #create_git_remote, #deprecate, #display, #display_header, #display_object, #display_row, #display_table, #error, error_with_failure, error_with_failure=, extended, extended_into, #fail, #format_bytes, #format_date, #format_error, #format_with_bang, #get_terminal_environment, #git, #has_git?, #home_directory, #host_name, #hprint, #hputs, included, included_into, #json_decode, #json_encode, #launchy, #line_formatter, #longest, #output_with_bang, #quantify, #redisplay, #retry_on_exception, #run_command, #running_on_a_mac?, #running_on_windows?, #set_buffer, #shell, #spinner, #status, #string_distance, #styled_array, #styled_error, #styled_hash, #styled_header, #suggestion, #time_ago, #truncate, #with_tty
Constructor Details
This class inherits a constructor from Heroku::Command::Base
Instance Method Details
#index ⇒ Object
maintenance
display the current maintenance status of app
Example:
$ pogo maintenance off
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/heroku/command/maintenance.rb', line 16 def index validate_arguments! case api.get_app_maintenance(app).body['maintenance'] when true display('on') when false display('off') end end |
#off ⇒ Object
maintenance:off
take the app out of maintenance mode
Example:
$ pogo maintenance:off Disabling maintenance mode for example
53 54 55 56 57 58 59 |
# File 'lib/heroku/command/maintenance.rb', line 53 def off validate_arguments! action("Disabling maintenance mode for #{app}") do api.post_app_maintenance(app, '0') end end |
#on ⇒ Object
maintenance:on
put the app into maintenance mode
Example:
$ pogo maintenance:on Enabling maintenance mode for example
36 37 38 39 40 41 42 |
# File 'lib/heroku/command/maintenance.rb', line 36 def on validate_arguments! action("Enabling maintenance mode for #{app}") do api.post_app_maintenance(app, '1') end end |