2012-03-01 04:37:40 -05:00
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class OpenStack
|
|
|
|
class Real
|
|
|
|
|
|
|
|
def get_snapshot_details(snapshot_id)
|
|
|
|
|
|
|
|
request(
|
|
|
|
:expects => 200,
|
|
|
|
:method => 'GET',
|
|
|
|
:path => "os-snapshots/#{snapshot_id}"
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
class Mock
|
|
|
|
|
|
|
|
def get_snapshot_details(detailed=true)
|
|
|
|
response = Excon::Response.new
|
|
|
|
response.status = 200
|
|
|
|
response.body = {
|
|
|
|
'snapshot' => {
|
|
|
|
'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-03-01 04:37:40 -05:00
|
|
|
'size' => 3,
|
2012-08-15 23:27:35 -04:00
|
|
|
'volume_id' => '4',
|
2012-03-01 04:37:40 -05:00
|
|
|
'status' => 'online',
|
2012-08-15 23:27:35 -04:00
|
|
|
'created_at' => Time.now
|
2012-03-01 04:37:40 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
response
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|