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

Inherits:
Kitchen::Driver::Oci show all
Defined in:
lib/kitchen/driver/oci/instance.rb

Overview

generic class for instance models

Direct Known Subclasses

Models::Compute, Models::Dbaas

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Kitchen::Driver::Oci

#create, #destroy, validation_error

Methods included from Models

#instance_class, #volume_class

Constructor Details

#initialize(config, state, oci, api, action) ⇒ Instance

Returns a new instance of Instance.



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

def initialize(config, state, oci, api, action)
  super()
  @config = config
  @state = state
  @oci = oci
  @api = api
end

Instance Attribute Details

#apiObject

Returns the value of attribute api.



30
31
32
# File 'lib/kitchen/driver/oci/instance.rb', line 30

def api
  @api
end

#configObject

Returns the value of attribute config.



30
31
32
# File 'lib/kitchen/driver/oci/instance.rb', line 30

def config
  @config
end

#ociObject

Returns the value of attribute oci.



30
31
32
# File 'lib/kitchen/driver/oci/instance.rb', line 30

def oci
  @oci
end

#stateObject

Returns the value of attribute state.



30
31
32
# File 'lib/kitchen/driver/oci/instance.rb', line 30

def state
  @state
end

Instance Method Details

#availability_domainObject



44
45
46
# File 'lib/kitchen/driver/oci/instance.rb', line 44

def availability_domain
  launch_details.availability_domain = config[:availability_domain]
end

#compartment_idObject



40
41
42
# File 'lib/kitchen/driver/oci/instance.rb', line 40

def compartment_id
  launch_details.compartment_id = oci.compartment
end

#defined_tagsObject



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

def defined_tags
  launch_details.defined_tags = config[:defined_tags]
end

#final_state(state, instance_id) ⇒ Object



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

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

#freeform_tagsObject



56
57
58
# File 'lib/kitchen/driver/oci/instance.rb', line 56

def freeform_tags
  launch_details.freeform_tags = process_freeform_tags
end

#shapeObject



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

def shape
  launch_details.shape = config[:shape]
end