2012-07-30 18:22:16 -04:00
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class RackspaceV2
|
|
|
|
class Real
|
2013-01-08 10:53:43 -06:00
|
|
|
def rebuild_server(server_id, image_id, options={})
|
2012-07-30 18:22:16 -04:00
|
|
|
data = {
|
2013-01-08 10:53:43 -06:00
|
|
|
'rebuild' => options || {}
|
2012-07-30 18:22:16 -04:00
|
|
|
}
|
2013-01-08 10:53:43 -06:00
|
|
|
data['rebuild']['imageRef'] = image_id
|
2012-07-30 18:22:16 -04:00
|
|
|
|
|
|
|
request(
|
|
|
|
:body => Fog::JSON.encode(data),
|
|
|
|
:expects => [202],
|
|
|
|
:method => 'POST',
|
|
|
|
:path => "servers/#{server_id}/action"
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
2013-01-11 16:06:58 -05:00
|
|
|
|
|
|
|
class Mock
|
|
|
|
def rebuild_server(server_id, image_id, options={})
|
|
|
|
server = self.data[:servers][server_id]
|
|
|
|
response(
|
|
|
|
:body => {"server" => server},
|
|
|
|
:status => 202
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
2012-07-30 18:22:16 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|