Sha256: 11515aa1059af572f95dcb59a158575cd666a7613fa8f6fa1f4e66345cf2f89a

Contents?: true

Size: 1.09 KB

Versions: 5

Compression:

Stored size: 1.09 KB

Contents

module Fog
  module OracleCloud
    class Java
      class Real

        def delete_instance(service_name, dba_name, dba_password, options={})
          body_data = {
            'dbaName'     => dba_name,
            'dbaPassword' => dba_password,
            'forceDelete' => options[:force_delete]
          }

          body_data = body_data.reject {|key, value| value.nil?}
          request(
            :method   => 'PUT',
            :expects  => 202,
            :path     => "/paas/service/jcs/api/v1.1/instances/#{@identity_domain}/#{service_name}",
            :body     => Fog::JSON.encode(body_data),
            :headers  => {
              'Content-Type'=>'application/vnd.com.oracle.oracloud.provisioning.Service+json'
            }
          )
        end
      end

      class Mock
        def delete_instance(name, dba_name, dba_password, options={})
          response = Excon::Response.new
          self.data[:instances][name]['status'] = 'Terminating'
          self.data[:deleted_at][name] = Time.now
          response.status = 204
          response
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fog-oraclecloud-0.1.17 lib/fog/oraclecloud/requests/java/delete_instance.rb
fog-oraclecloud-0.1.16 lib/fog/oraclecloud/requests/java/delete_instance.rb
fog-oraclecloud-0.1.15 lib/fog/oraclecloud/requests/java/delete_instance.rb
fog-oraclecloud-0.1.14 lib/fog/oraclecloud/requests/java/delete_instance.rb
fog-oraclecloud-0.1.13 lib/fog/oraclecloud/requests/java/delete_instance.rb