1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/bare_metal_cloud/requests/compute/add_server.rb
John Wang 3a17e5174b Switch from NewServers to BareMetalCloud for #773
Includes changing from new_servers to bare_metal_cloud as well as newservers to baremetalcloud.
2012-03-01 18:54:49 -08:00

33 lines
921 B
Ruby

module Fog
module Compute
class BareMetalCloud
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