Sha256: fecc6505e28e6a72c833554667da00de0a2faf85af7b5af3a702a28dd7c06599

Contents?: true

Size: 1.18 KB

Versions: 6

Compression:

Stored size: 1.18 KB

Contents

module Fog
  module Compute
    class OracleCloud
      class Real
				def get_orchestration(name)
          if !name.start_with?("/Compute-") then
            # They haven't provided a well formed name, add their name in
            name = "/Compute-#{@identity_domain}/#{@username}/#{name}"
          end
 					response = request(
            :expects  => 200,
            :method   => 'GET',
            :path     => "/orchestration#{name}",
            :headers  => {
              'Content-Type' => 'application/oracle-compute-v3+json',
              'Accept' => 'application/oracle-compute-v3+json'
            }
          )
          response
        end
      end

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

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fog-oraclecloud-0.1.7 lib/fog/oraclecloud/requests/compute/get_orchestration.rb
fog-oraclecloud-0.1.6 lib/fog/oraclecloud/requests/compute/get_orchestration.rb
fog-oraclecloud-0.1.5 lib/fog/oraclecloud/requests/compute/get_orchestration.rb
fog-oraclecloud-0.1.4 lib/fog/oraclecloud/requests/compute/get_orchestration.rb
fog-oraclecloud-0.1.3 lib/fog/oraclecloud/requests/compute/get_orchestration.rb
fog-oraclecloud-0.1.2 lib/fog/oraclecloud/requests/compute/get_orchestration.rb