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

Inherits:
Kitchen::Driver::Oci show all
Includes:
CommonLaunchDetails, Mixin::SshKeys
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

Base class for instance models.

Author:

  • Justin Steele <justin.steele@oracle.com>

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 Mixin::SshKeys

#algorithm, #generate_keys, #private_key_file, #public_key_file, #read_public_key

Methods included from CommonLaunchDetails

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

Methods inherited from Kitchen::Driver::Oci

#create, #destroy, #finalize_config!, validation_error

Methods included from Mixin::Volumes

#create_and_attach_volumes, #create_volume, #detatch_and_delete_volumes, #process_volumes

Methods included from Mixin::Models

#instance_class, #volume_class

Methods included from Mixin::Actions

#are_legacy_imds_endpoints_disbled?, #auth, #execute_post_create_file, #execute_post_create_script, #execute_post_create_string, #instance_options, #instance_options?, #launch, #reboot, #terminate

Constructor Details

#initialize(opts = {}) ⇒ Instance

Returns a new instance of Instance.



36
37
38
39
40
41
42
43
# File 'lib/kitchen/driver/oci/instance.rb', line 36

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.



63
64
65
# File 'lib/kitchen/driver/oci/instance.rb', line 63

def api
  @api
end

#configKitchen::LazyHash

The config provided by the driver.

Returns:

  • (Kitchen::LazyHash)


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

def config
  @config
end

#loggerKitchen::Logger

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

Returns:

  • (Kitchen::Logger)


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

def logger
  @logger
end

#ociKitchen::Driver::Oci::Config

The config object that contains properties of the authentication to OCI.



58
59
60
# File 'lib/kitchen/driver/oci/instance.rb', line 58

def oci
  @oci
end

#stateHash

The definition of the state of the instance from the statefile.

Returns:

  • (Hash)


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

def state
  @state
end

Instance Method Details

#final_state(state, instance_id) ⇒ Hash

Adds the instance info into the state.

Parameters:

  • state (Hash)

    The state from kitchen.

Returns:

  • (Hash)


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

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