2010-03-19 21:29:42 -04:00
|
|
|
module Fog
|
|
|
|
module Rackspace
|
|
|
|
module Servers
|
|
|
|
class Real
|
2009-10-17 17:24:34 -04:00
|
|
|
|
|
|
|
# Reboot an existing server
|
|
|
|
#
|
|
|
|
# ==== Parameters
|
|
|
|
# * server_id<~Integer> - Id of server to reboot
|
|
|
|
# * type<~String> - Type of reboot, must be in ['HARD', 'SOFT']
|
|
|
|
#
|
2010-02-06 17:51:19 -05:00
|
|
|
def reboot_server(server_id, type = 'SOFT')
|
2009-10-17 17:24:34 -04:00
|
|
|
request(
|
2009-11-14 19:45:52 -05:00
|
|
|
:body => { 'reboot' => { 'type' => type }}.to_json,
|
2009-10-17 17:24:34 -04:00
|
|
|
:expects => 202,
|
|
|
|
:method => 'POST',
|
2009-11-14 19:45:52 -05:00
|
|
|
:path => "servers/#{server_id}/action.json"
|
2009-10-17 17:24:34 -04:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2010-03-19 21:29:42 -04:00
|
|
|
class Mock
|
2009-10-17 17:24:34 -04:00
|
|
|
|
2009-11-14 19:45:52 -05:00
|
|
|
def reboot_server(server_id, type)
|
2010-02-02 01:53:18 -05:00
|
|
|
raise MockNotImplemented.new("Contributions welcome!")
|
2009-10-17 17:24:34 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|