Class: Kitchen::Driver::Oci::Instance

Inherits:
Kitchen::Driver::Oci show all
Includes:
CommonLaunchDetails
Defined in:
lib/kitchen/driver/oci/instance.rb,
lib/kitchen/driver/oci/instance/dbaas.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

Overview

generic class for instance models

Direct Known Subclasses

Models::Compute, Models::Dbaas

Defined Under Namespace

Modules: CommonLaunchDetails, ComputeLaunchDetails, DatabaseDetails, DbHomeDetails, DbaasLaunchDetails

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from CommonLaunchDetails

#availability_domain, #compartment_id, #defined_tags, #freeform_tags, #shape

Methods inherited from Kitchen::Driver::Oci

#create, #destroy, validation_error

Methods included from Volumes

#create_and_attach_volumes, #create_volume, #process_volumes

Methods included from Models

#instance_class, #volume_class

Constructor Details

#initialize(opts = {}) ⇒ Instance

Returns a new instance of Instance.



33
34
35
36
37
38
39
40
# File 'lib/kitchen/driver/oci/instance.rb', line 33

def initialize(opts = {})
  super()
  @config = opts[:config]
  @state = opts[:state]
  @oci = opts[:oci]
  @api = opts[:api]
  @logger = opts[:logger]
end

Instance Attribute Details

#apiKitchen::Driver::Oci::Api

The API object that contains each of the authenticated clients for interfacing with OCI



68
69
70
# File 'lib/kitchen/driver/oci/instance.rb', line 68

def api
  @api
end

#configKitchen::LazyHash

The config provided by the driver

Returns:

  • (Kitchen::LazyHash)


47
48
49
# File 'lib/kitchen/driver/oci/instance.rb', line 47

def config
  @config
end

#loggerKitchen::Logger

The instance of Kitchen::Logger in use by the active Kitchen::Instance

Returns:

  • (Kitchen::Logger)


75
76
77
# File 'lib/kitchen/driver/oci/instance.rb', line 75

def logger
  @logger
end

#ociKitchen::Driver::Oci::Config

The config object that contains properties of the authentication to OCI



61
62
63
# File 'lib/kitchen/driver/oci/instance.rb', line 61

def oci
  @oci
end

#stateHash

The definition of the state of the instance from the statefile

Returns:

  • (Hash)


54
55
56
# File 'lib/kitchen/driver/oci/instance.rb', line 54

def state
  @state
end

Instance Method Details

#final_state(state, instance_id) ⇒ Object



77
78
79
80
81
# File 'lib/kitchen/driver/oci/instance.rb', line 77

def final_state(state, instance_id)
  state.store(:server_id, instance_id)
  state.store(:hostname, instance_ip(instance_id))
  state
end