module Fog module Rackspace class BlockStorage class Real # Retrieves volume detail # @param [String] volume_id # @return [Excon::Response] response: # * body [Hash]: # * 'volume' [Hash]: # * 'volume_type' [String]: - volume type # * 'display_description' [String]: - volume display description # * 'metadata' [Hash]: - volume metadata # * 'availability_zone' [String]: - region of volume # * 'status' [String]: - status of volume # * 'id' [String]: - id of volume # * 'attachments' [Array [200], :method => 'GET', :path => "volumes/#{volume_id}" ) end end class Mock def get_volume(volume_id) possible_states = ["available", "in-use"] volume = self.data[:volumes][volume_id] if volume.nil? raise Fog::Rackspace::BlockStorage::NotFound else volume["status"] = possible_states[rand(possible_states.length)] if volume.nil? raise Fog::Rackspace::BlockStorage::NotFound else response(:body => {"volume" => volume}) end end end end end end end