Class: Rightscaler::Manage::Server
- Defined in:
- lib/rightscaler/manage/server.rb
Constant Summary
Constants inherited from Resource
Instance Method Summary collapse
- #reboot ⇒ Object
- #reboot_and_wait ⇒ Object
- #run_script(right_script_id) ⇒ Object
- #run_script_and_wait(right_script_id) ⇒ Object
- #start ⇒ Object
- #start_and_wait(scripts = []) ⇒ Object
- #stop ⇒ Object
- #stop_and_wait ⇒ Object
Methods inherited from Resource
Instance Method Details
#reboot ⇒ Object
19 20 21 |
# File 'lib/rightscaler/manage/server.rb', line 19 def reboot post(:reboot) end |
#reboot_and_wait ⇒ Object
23 24 25 |
# File 'lib/rightscaler/manage/server.rb', line 23 def reboot_and_wait watch_until('operational') { reboot } end |
#run_script(right_script_id) ⇒ Object
27 28 29 30 31 |
# File 'lib/rightscaler/manage/server.rb', line 27 def run_script(right_script_id) with_status do post(:run_script, :right_script => right_script_id) end end |
#run_script_and_wait(right_script_id) ⇒ Object
33 34 35 36 |
# File 'lib/rightscaler/manage/server.rb', line 33 def run_script_and_wait(right_script_id) status = run_script(right_script_id) status.watch_until('completed') end |
#start ⇒ Object
3 4 5 |
# File 'lib/rightscaler/manage/server.rb', line 3 def start post(:start) unless state == "operational" end |
#start_and_wait(scripts = []) ⇒ Object
7 8 9 |
# File 'lib/rightscaler/manage/server.rb', line 7 def start_and_wait(scripts=[]) watch_until("operational") { start } end |
#stop ⇒ Object
11 12 13 |
# File 'lib/rightscaler/manage/server.rb', line 11 def stop post(:stop) unless state == "stopped" end |
#stop_and_wait ⇒ Object
15 16 17 |
# File 'lib/rightscaler/manage/server.rb', line 15 def stop_and_wait watch_until("stopped") { stop } end |