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/instance/dbaas.rb,
lib/kitchen/driver/oci/models/compute.rb,
lib/kitchen/driver/oci/instance/common.rb,
lib/kitchen/driver/oci/instance/compute.rb,
lib/kitchen/driver/oci/instance/db_home.rb,
lib/kitchen/driver/oci/instance/database.rb,
lib/kitchen/driver/oci/models/paravirtual.rb

Overview

Oracle OCI driver for Kitchen.

Author:

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)


112
113
114
# File 'lib/kitchen/driver/oci.rb', line 112

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

Instance Method Details

#create(state) ⇒ Object



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

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

  validate_config!
  oci, api = auth(__method__)
  inst = instance_class(config, state, oci, api, __method__)
  launch(state, inst)
  create_and_attach_volumes(config, state, oci, api)
  process_post_script(state)
  reboot(state, inst)
end

#destroy(state) ⇒ Object



130
131
132
133
134
135
136
137
# File 'lib/kitchen/driver/oci.rb', line 130

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

  oci, api = auth(__method__)
  inst = instance_class(config, state, oci, api, __method__)
  detatch_and_delete_volumes(state, oci, api)
  terminate(state, inst)
end