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/ibm/requests/storage/create_volume.rb

43 lines
1.1 KiB
Ruby
Raw Normal View History

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
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',
: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