Class: Kitchen::Driver::Oci

Inherits:
Base
  • Object
show all
Includes:
Models
Defined in:
lib/kitchen/driver/oci.rb,
lib/kitchen/driver/oci/api.rb,
lib/kitchen/driver/oci/config.rb,
lib/kitchen/driver/oci/models.rb,
lib/kitchen/driver/oci/instance.rb,
lib/kitchen/driver/oci/blockstorage.rb,
lib/kitchen/driver/oci/models/dbaas.rb,
lib/kitchen/driver/oci/models/iscsi.rb,
lib/kitchen/driver/oci/models/compute.rb,
lib/kitchen/driver/oci/models/paravirtual.rb

Overview

Oracle OCI driver for Kitchen.

Author:

  • Stephen Pearson <stephen.pearson@oracle.com>

Direct Known Subclasses

Blockstorage, Instance

Defined Under Namespace

Modules: Models Classes: Api, Blockstorage, Config, Instance

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Models

#instance_class, #volume_class

Class Method Details

.validation_error(message, driver) ⇒ Object

Raises:

  • (UserError)


98
99
100
# File 'lib/kitchen/driver/oci.rb', line 98

def self.validation_error(message, driver)
  raise UserError, "#{driver.class}<#{driver.instance.name}>#config#{message}"
end

Instance Method Details

#create(state) ⇒ Object



104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/kitchen/driver/oci.rb', line 104

def create(state)
  return if state[:server_id]

  validate_config!
  oci, api = auth(__method__)
  inst = instance_class(config, state, oci, api, __method__)
  state_details = inst.launch
  state.merge!(state_details)
  instance.transport.connection(state).wait_until_ready
  create_and_attach_volumes(config, state, oci, api)
  process_post_script
end

#destroy(state) ⇒ Object



117
118
119
120
121
122
123
124
125
# File 'lib/kitchen/driver/oci.rb', line 117

def destroy(state)
  return unless state[:server_id]

  oci, api = auth(__method__)
  instance.transport.connection(state).close
  detatch_and_delete_volumes(state, oci, api) if state[:volumes]
  inst = instance_class(config, state, oci, api, __method__)
  inst.terminate
end