2010-05-24 14:03:52 -04:00
|
|
|
module Fog
|
2010-09-03 04:11:45 -04:00
|
|
|
class Bluebox
|
2010-05-24 14:03:52 -04:00
|
|
|
class Real
|
|
|
|
|
2010-06-02 11:20:38 -04:00
|
|
|
# Create a new block
|
|
|
|
#
|
2010-05-24 14:03:52 -04:00
|
|
|
# ==== Parameters
|
2010-06-02 22:38:50 -04:00
|
|
|
# * product_id<~Integer> - Id of product to create block with
|
|
|
|
# * template_id<~Integer> - Id of template to create block with
|
2010-06-02 22:46:41 -04:00
|
|
|
# * options<~Hash>:
|
|
|
|
# * password<~String> - Password for block
|
|
|
|
# or
|
|
|
|
# * ssh_key<~String> - ssh public key
|
2010-06-04 01:20:31 -04:00
|
|
|
# * username<~String> - optional, defaults to deploy
|
2010-05-24 14:03:52 -04:00
|
|
|
#
|
|
|
|
# ==== Returns
|
|
|
|
# * response<~Excon::Response>:
|
2010-06-02 11:20:38 -04:00
|
|
|
# * body<~Hash>:
|
|
|
|
# TODO
|
2010-06-04 01:20:31 -04:00
|
|
|
def create_block(product_id, template_id, options = {})
|
2010-06-02 11:13:22 -04:00
|
|
|
request(
|
2010-06-02 11:23:12 -04:00
|
|
|
:expects => 200,
|
2010-05-24 14:03:52 -04:00
|
|
|
:method => 'POST',
|
2010-06-04 00:32:59 -04:00
|
|
|
:path => '/api/blocks.json',
|
2010-06-08 01:14:15 -04:00
|
|
|
:query => {'product' => product_id, 'template' => template_id}.merge!(options)
|
2010-05-24 14:03:52 -04:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
class Mock
|
|
|
|
|
2010-06-02 22:38:50 -04:00
|
|
|
def create_block(product_id, template_id, name, password)
|
2010-06-02 11:09:54 -04:00
|
|
|
Fog::Mock.not_implemented
|
2010-05-24 14:03:52 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|