2012-02-24 07:03:55 -05:00
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class OpenStack
|
|
|
|
class Real
|
|
|
|
|
|
|
|
def list_volumes(detailed=true)
|
|
|
|
|
|
|
|
path = detailed ? 'os-volumes/detail' : 'os-volumes'
|
|
|
|
request(
|
|
|
|
:expects => 200,
|
|
|
|
:method => 'GET',
|
|
|
|
:path => path
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
class Mock
|
|
|
|
|
|
|
|
def list_volumes(detailed=true)
|
|
|
|
response = Excon::Response.new
|
|
|
|
response.status = 200
|
|
|
|
response.body = {
|
2012-04-01 09:19:27 -04:00
|
|
|
"volumes" => [
|
|
|
|
{ "status" => "available",
|
|
|
|
"displayDescription" => "",
|
|
|
|
"availabilityZone" => "nova",
|
|
|
|
"displayName" => "WD",
|
|
|
|
"attachments" => [{}],
|
|
|
|
"volumeType" => nil,
|
|
|
|
"snapshotId" => nil,
|
|
|
|
"size" => 1,
|
|
|
|
"id" => 6,
|
|
|
|
"createdAt" => "2012-03-30 05:31:00.655058",
|
|
|
|
"metadata" => {} },
|
|
|
|
{ "status" => "available",
|
|
|
|
"displayDescription" => "",
|
|
|
|
"availabilityZone" => "nova",
|
|
|
|
"displayName" => "test",
|
|
|
|
"attachments" => [{}],
|
|
|
|
"volumeType" => nil,
|
|
|
|
"snapshotId" => nil,
|
|
|
|
"size" => 1,
|
|
|
|
"id" => 8,
|
|
|
|
"createdAt" => "2012-03-30 16:14:55.582717",
|
|
|
|
"metadata" => {} }
|
|
|
|
] }
|
2012-02-24 07:03:55 -05:00
|
|
|
response
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|