Sha256: f375bdd95e08399d0e64697fce59b4e11ca2286e744e12fec9b7d34a9d90a428

Contents?: true

Size: 1.12 KB

Versions: 5

Compression:

Stored size: 1.12 KB

Contents

module Fog
  module Compute
    class OracleCloud
      class Real
      	def delete_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         
          request(
            :method   => 'DELETE',
            :expects  => 204,
            :path     => "/orchestration#{name}",
            :headers  => {
              'Content-Type' => 'application/oracle-compute-v3+json'
            }
          )
      	end
      end

      class Mock
        def delete_orchestration (name)
          response = Excon::Response.new
          clean_name = name.sub "/Compute-#{@identity_domain}/#{@username}/", ''
          if self.data[:orchestrations][clean_name] 
            self.data[:orchestrations].delete(clean_name)
            response.status = 204
            response
          else
            raise Fog::Compute::OracleCloud::NotFound.new("Orchestration #{name} does not exist");
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fog-oraclecloud-0.1.12 lib/fog/oraclecloud/requests/compute/delete_orchestration.rb
fog-oraclecloud-0.1.11 lib/fog/oraclecloud/requests/compute/delete_orchestration.rb
fog-oraclecloud-0.1.10 lib/fog/oraclecloud/requests/compute/delete_orchestration.rb
fog-oraclecloud-0.1.9 lib/fog/oraclecloud/requests/compute/delete_orchestration.rb
fog-oraclecloud-0.1.8 lib/fog/oraclecloud/requests/compute/delete_orchestration.rb