Sha256: f9ea4cb15f7b3f6d457f50f68233b0ea6d563c0f1ec9da85dd0c29dc005412fb

Contents?: true

Size: 1.05 KB

Versions: 5

Compression:

Stored size: 1.05 KB

Contents

module Fog
  module OracleCloud
    class SOA
      class Real

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

          body_data = body_data.reject {|key, value| value.nil?}
          request(
            :method   => 'PUT',
            :expects  => 202,
            :path     => "/paas/service/soa/api/v1.1/instances/#{@identity_domain}/#{service_name}",
            :body     => Fog::JSON.encode(body_data)
          )
        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.12 lib/fog/oraclecloud/requests/soa/delete_instance.rb
fog-oraclecloud-0.1.11 lib/fog/oraclecloud/requests/soa/delete_instance.rb
fog-oraclecloud-0.1.10 lib/fog/oraclecloud/requests/soa/delete_instance.rb
fog-oraclecloud-0.1.9 lib/fog/oraclecloud/requests/soa/delete_instance.rb
fog-oraclecloud-0.1.8 lib/fog/oraclecloud/requests/soa/delete_instance.rb