2010-09-08 15:58:51 -04:00
|
|
|
module Fog
|
2011-06-16 19:28:54 -04:00
|
|
|
module Compute
|
2012-03-01 21:54:49 -05:00
|
|
|
class BareMetalCloud
|
2010-09-08 15:58:51 -04:00
|
|
|
class Real
|
|
|
|
|
|
|
|
# Boot a new server
|
|
|
|
#
|
|
|
|
# ==== Parameters
|
|
|
|
# * planId<~String> - The id of the plan to boot the server with
|
|
|
|
# * options<~Hash>: optional extra arguments
|
|
|
|
# * imageId<~String> - Optional image to boot server from
|
|
|
|
# * name<~String> - Name to boot new server with
|
|
|
|
#
|
|
|
|
# ==== Returns
|
|
|
|
# * response<~Excon::Response>:
|
|
|
|
# * body<~Hash>:
|
|
|
|
# * 'server'<~Hash>:
|
|
|
|
# * 'id'<~String> - Id of the image
|
|
|
|
#
|
|
|
|
def add_server(plan_id, options = {})
|
|
|
|
request(
|
|
|
|
:expects => 200,
|
|
|
|
:method => 'GET',
|
|
|
|
:parser => Fog::ToHashDocument.new,
|
|
|
|
:path => 'api/addServer',
|
|
|
|
:query => {'planId' => plan_id}.merge!(options)
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|