Sha256: 0344fdaf85a1869bb30099681bc07eac94912f68525c26674348ae25e573c00c

Contents?: true

Size: 1.06 KB

Versions: 4

Compression:

Stored size: 1.06 KB

Contents

module Fog
  module Compute
    class OracleCloud
      class Real
				def get_storage_attachment(name)
          name.sub! "/Compute-#{@identity_domain}/#{@username}/", ''
 					response = request(
            :expects  => 200,
            :method   => 'GET',
            :path     => "/storage/attachment/Compute-#{@identity_domain}/#{@username}/#{name}",
            :headers  => {
              'Content-Type' => 'application/oracle-compute-v3+json',
              'Accept' => 'application/oracle-compute-v3+json'
            }
          )
          response
        end
      end

      class Mock
        def get_storage_attachment(name)
          response = Excon::Response.new
          clean_name = name.sub "/Compute-#{@identity_domain}/#{@username}/", ''

          if sa = self.data[:storage_attachments][clean_name] 
            response.status = 200
            response.body = sa
            response
          else;
            raise Fog::Compute::OracleCloud::NotFound.new("Storage Attachment #{name} does not exist");
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fog-oraclecloud-0.1.17 lib/fog/oraclecloud/requests/compute/get_storage_attachment.rb
fog-oraclecloud-0.1.16 lib/fog/oraclecloud/requests/compute/get_storage_attachment.rb
fog-oraclecloud-0.1.15 lib/fog/oraclecloud/requests/compute/get_storage_attachment.rb
fog-oraclecloud-0.1.14 lib/fog/oraclecloud/requests/compute/get_storage_attachment.rb