Sha256: 45c0633e8ce2d2c03f87ad79152c75c834805e007980332e2c550759974e8f64

Contents?: true

Size: 1.22 KB

Versions: 2

Compression:

Stored size: 1.22 KB

Contents

module Fog
  module Compute
    class OracleCloud
      class Real
				def get_security_application(name)
          path = "/secapplication"
          name.sub! "/Compute-#{@identity_domain}/#{@username}/", ''
          if name.include? '/oracle/public' then
            path += "/#{name}/"
          else 
            path += "/Compute-#{@identity_domain}/#{@username}/#{name}/"
          end
 					response = request(
            :expects  => 200,
            :method   => 'GET',
            :path     => path,
            :headers  => {
              'Content-Type' => 'application/oracle-compute-v3+json',
              'Accept' => 'application/oracle-compute-v3+json'
            }
          )
          response
        end
      end
      class Mock
        def get_security_application(name)
          response = Excon::Response.new
          clean_name = name.sub "/Compute-#{@identity_domain}/#{@username}/", ''
          if app = self.data[:security_applications][clean_name] 
            response.status = 200
            response.body = app
            response
          else
            raise Fog::Compute::OracleCloud::NotFound.new("Security application #{name} does not exist");
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fog-oraclecloud-0.1.17 lib/fog/oraclecloud/requests/compute/get_security_application.rb
fog-oraclecloud-0.1.16 lib/fog/oraclecloud/requests/compute/get_security_application.rb