2010-09-07 16:26:01 -07:00
|
|
|
module Fog
|
2011-06-16 16:28:54 -07:00
|
|
|
module Compute
|
|
|
|
class Bluebox
|
2010-09-07 16:26:01 -07:00
|
|
|
class Real
|
|
|
|
|
|
|
|
# Create a new block
|
|
|
|
#
|
|
|
|
# ==== Parameters
|
|
|
|
# * product_id<~Integer> - Id of product to create block with
|
|
|
|
# * template_id<~Integer> - Id of template to create block with
|
|
|
|
# * options<~Hash>:
|
|
|
|
# * password<~String> - Password for block
|
|
|
|
# or
|
|
|
|
# * ssh_key<~String> - ssh public key
|
|
|
|
# * username<~String> - optional, defaults to deploy
|
|
|
|
#
|
|
|
|
# ==== Returns
|
|
|
|
# * response<~Excon::Response>:
|
|
|
|
# * body<~Hash>:
|
|
|
|
# TODO
|
2012-02-12 00:02:52 -08:00
|
|
|
def create_block(product_id, template_id, location_id, options = {})
|
2010-09-07 16:26:01 -07:00
|
|
|
request(
|
|
|
|
:expects => 200,
|
|
|
|
:method => 'POST',
|
|
|
|
:path => '/api/blocks.json',
|
2012-02-12 00:02:52 -08:00
|
|
|
:query => {'product' => product_id, 'template' => template_id, 'location' => location_id}.merge!(options)
|
2010-09-07 16:26:01 -07:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|