Sha256: 34e67a8652df92a0b9f5400f2d37c076dbb9f6715841a084b55bb9021e68482d

Contents?: true

Size: 903 Bytes

Versions: 7

Compression:

Stored size: 903 Bytes

Contents

module Fog
  module OracleCloud
    class SOA
      class Real

      	def get_instance(instance_id)
 					response = request(
            :expects  => 200,
            :method   => 'GET',
            :path     => "/paas/service/soa/api/v1.1/instances/#{@identity_domain}/#{instance_id}"
          )
          response
        end
      end

      class Mock
        def get_instance(instance_id)
          response = Excon::Response.new
          if instance_exists? instance_id
            response.status = 200
            response.body   = self.data[:instances][instance_id]
          else
            raise Fog::OracleCloud::SOA::NotFound
          end
          response
        end

        # Checks if an instance exists
        def instance_exists?(instance_id)
          self.data[:instances].key? instance_id
        end
        
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fog-oraclecloud-0.1.7 lib/fog/oraclecloud/requests/soa/get_instance.rb
fog-oraclecloud-0.1.6 lib/fog/oraclecloud/requests/soa/get_instance.rb
fog-oraclecloud-0.1.5 lib/fog/oraclecloud/requests/soa/get_instance.rb
fog-oraclecloud-0.1.4 lib/fog/oraclecloud/requests/soa/get_instance.rb
fog-oraclecloud-0.1.3 lib/fog/oraclecloud/requests/soa/get_instance.rb
fog-oraclecloud-0.1.2 lib/fog/oraclecloud/requests/soa/get_instance.rb
fog-oraclecloud-0.1.1 lib/fog/oraclecloud/requests/soa/get_instance.rb