Class: Rightscaler::Manage::Server

Inherits:
Resource
  • Object
show all
Defined in:
lib/rightscaler/manage/server.rb

Constant Summary

Constants inherited from Resource

Resource::API_VERSION

Instance Method Summary collapse

Methods inherited from Resource

account_id=, #id

Instance Method Details

#rebootObject



19
20
21
# File 'lib/rightscaler/manage/server.rb', line 19

def reboot
  post(:reboot)
end

#reboot_and_waitObject



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

#startObject



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

#stopObject



11
12
13
# File 'lib/rightscaler/manage/server.rb', line 11

def stop
  post(:stop) unless state == "stopped"
end

#stop_and_waitObject



15
16
17
# File 'lib/rightscaler/manage/server.rb', line 15

def stop_and_wait
  watch_until("stopped") { stop }
end