Class: Kitchen::Driver::Oci::Instance
- Inherits:
-
Kitchen::Driver::Oci
- Object
- Base
- Kitchen::Driver::Oci
- Kitchen::Driver::Oci::Instance
- 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.
Direct Known Subclasses
Defined Under Namespace
Modules: CommonLaunchDetails, ComputeLaunchDetails, DatabaseDetails, DbHomeDetails, DbaasLaunchDetails
Instance Attribute Summary collapse
-
#api ⇒ Kitchen::Driver::Oci::Api
The API object that contains each of the authenticated clients for interfacing with OCI.
-
#config ⇒ Kitchen::LazyHash
The config provided by the driver.
-
#logger ⇒ Kitchen::Logger
The instance of Kitchen::Logger in use by the active Kitchen::Instance.
-
#oci ⇒ Kitchen::Driver::Oci::Config
The config object that contains properties of the authentication to OCI.
-
#state ⇒ Hash
The definition of the state of the instance from the statefile.
Instance Method Summary collapse
-
#final_state(state, instance_id) ⇒ Hash
Adds the instance info into the state.
-
#initialize(opts = {}) ⇒ Instance
constructor
A new instance of Instance.
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
#api ⇒ Kitchen::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 |
#config ⇒ Kitchen::LazyHash
The config provided by the driver.
48 49 50 |
# File 'lib/kitchen/driver/oci/instance.rb', line 48 def config @config end |
#logger ⇒ Kitchen::Logger
The instance of Kitchen::Logger in use by the active Kitchen::Instance.
68 69 70 |
# File 'lib/kitchen/driver/oci/instance.rb', line 68 def logger @logger end |
#oci ⇒ Kitchen::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 |
#state ⇒ Hash
The definition of the state of the instance from the statefile.
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.
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 |