mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
609995ccbe
reverted back to double quoted string Conflicts: lib/fog/openstack/identity.rb lib/fog/openstack/requests/compute/get_volume_details.rb lib/fog/openstack/requests/compute/list_security_groups.rb lib/fog/openstack/requests/identity/list_tenants.rb lib/fog/openstack/requests/image/create_image.rb lib/fog/openstack/requests/image/list_public_images.rb lib/fog/openstack/requests/image/list_public_images_detailed.rb lib/fog/openstack/requests/image/update_image.rb tests/openstack/requests/compute/volume_tests.rb
42 lines
1 KiB
Ruby
42 lines
1 KiB
Ruby
module Fog
|
|
module Volume
|
|
class OpenStack
|
|
class Real
|
|
|
|
def get_volume_details(volume_id)
|
|
|
|
request(
|
|
:expects => 200,
|
|
:method => 'GET',
|
|
:path => "volumes/#{volume_id}"
|
|
)
|
|
end
|
|
|
|
end
|
|
|
|
class Mock
|
|
|
|
def get_volume_details(detailed=true)
|
|
response = Excon::Response.new
|
|
response.status = 200
|
|
response.body = {
|
|
'volume' => {
|
|
'id' => '1',
|
|
'display_name' => Fog::Mock.random_letters(rand(8) + 5),
|
|
'display_description' => Fog::Mock.random_letters(rand(12) + 10),
|
|
'size' => 3,
|
|
'volume_type' => nil,
|
|
'snapshot_id' => '4',
|
|
'status' => 'online',
|
|
'availability_zone' => 'nova',
|
|
'created_at' => Time.now,
|
|
'attachments' => []
|
|
}
|
|
}
|
|
response
|
|
end
|
|
end
|
|
|
|
end
|
|
end
|
|
end
|