Sha256: f63d9846e14a855ffb6f29075e7bd8f5a7a03b11935900691313a7ea1022c729

Contents?: true

Size: 906 Bytes

Versions: 1

Compression:

Stored size: 906 Bytes

Contents

module Fog
  module OracleCloud
    class Java
      class Real

      	def get_instance(service_name)
 					response = request(
            :expects  => 200,
            :method   => 'GET',
            :path     => "/paas/service/jcs/api/v1.1/instances/#{@identity_domain}/#{service_name}"
          )
          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::Java::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

1 entries across 1 versions & 1 rubygems

Version Path
fog-oraclecloud-0.1.1 lib/fog/oraclecloud/requests/java/get_instance.rb