2012-04-09 23:28:49 -04:00
|
|
|
module Fog
|
2012-04-09 23:45:14 -04:00
|
|
|
module Volume
|
2012-04-09 23:28:49 -04:00
|
|
|
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' => {
|
2012-09-03 02:40:34 -04:00
|
|
|
'id' => '1',
|
2012-08-15 23:27:35 -04:00
|
|
|
'display_name' => Fog::Mock.random_letters(rand(8) + 5),
|
|
|
|
'display_description' => Fog::Mock.random_letters(rand(12) + 10),
|
2012-09-03 02:40:34 -04:00
|
|
|
'size' => 3,
|
2012-08-15 23:27:35 -04:00
|
|
|
'volume_type' => nil,
|
|
|
|
'snapshot_id' => '4',
|
2012-09-03 02:40:34 -04:00
|
|
|
'status' => 'online',
|
2012-08-15 23:27:35 -04:00
|
|
|
'availability_zone' => 'nova',
|
|
|
|
'created_at' => Time.now,
|
2012-09-03 02:40:34 -04:00
|
|
|
'attachments' => []
|
2012-04-09 23:28:49 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
response
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|