2012-01-10 17:20:56 -05:00
|
|
|
module Fog
|
|
|
|
module Storage
|
|
|
|
class IBM
|
|
|
|
class Real
|
|
|
|
|
|
|
|
# Create a volume
|
|
|
|
#
|
|
|
|
# ==== Returns
|
|
|
|
# * response<~Excon::Response>:
|
|
|
|
# * body<~Hash>
|
|
|
|
# TODO: docs
|
2012-01-17 16:34:47 -05:00
|
|
|
def create_volume(name, offering_id, format, location_id, size)
|
|
|
|
request(
|
2012-01-10 17:20:56 -05:00
|
|
|
:method => 'POST',
|
|
|
|
:expects => 200,
|
|
|
|
:path => '/storage',
|
2012-01-17 16:34:47 -05:00
|
|
|
:body => {
|
|
|
|
'name' => name,
|
|
|
|
'offeringID' => offering_id,
|
|
|
|
'format' => format,
|
|
|
|
'location' => location_id,
|
|
|
|
'size' => size
|
|
|
|
}
|
|
|
|
)
|
2012-01-10 17:20:56 -05:00
|
|
|
end
|
2011-12-02 13:27:44 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
class Mock
|
|
|
|
|
|
|
|
def create_volume(name, offering_id, format, location_id, size)
|
|
|
|
volume = Fog::IBM::Mock.create_volume(name, format, location_id, size, offering_id)
|
|
|
|
self.data[:volumes][volume['id']] = volume
|
|
|
|
response = Excon::Response.new
|
|
|
|
response.status = 200
|
|
|
|
response.body = format_get_volume_response_for(volume['id'])
|
|
|
|
response
|
|
|
|
end
|
2012-01-10 17:20:56 -05:00
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|