Module: Kitchen::Driver::Oci::Instance::ComputeLaunchDetails

Defined in:
lib/kitchen/driver/oci/instance/compute.rb

Overview

setter methods that populate the details of OCI::Core::Models::LaunchInstanceDetails

Instance Method Summary collapse

Instance Method Details

#agent_configObject



52
53
54
55
56
57
58
# File 'lib/kitchen/driver/oci/instance/compute.rb', line 52

def agent_config
  launch_details.agent_config = OCI::Core::Models::LaunchInstanceAgentConfigDetails.new(
    are_all_plugins_disabled: config[:all_plugins_disabled],
    is_management_disabled: config[:management_disabled],
    is_monitoring_disabled: config[:monitoring_disabled]
  )
end

#hostname_display_nameObject



25
26
27
28
29
# File 'lib/kitchen/driver/oci/instance/compute.rb', line 25

def hostname_display_name
  display_name = hostname
  launch_details.display_name = display_name
  launch_details.create_vnic_details = create_vnic_details(display_name)
end

#instance_metadataObject



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

def 
  launch_details. = 
end

#instance_source_detailsObject



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

def instance_source_details
  launch_details.source_details = OCI::Core::Models::InstanceSourceViaImageDetails.new(
    sourceType: "image",
    imageId: image_id,
    bootVolumeSizeInGBs: config[:boot_volume_size_in_gbs]
  )
end

#preemptible_instance_configObject



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

def preemptible_instance_config
  return unless config[:preemptible_instance]

  launch_details.preemptible_instance_config = OCI::Core::Models::PreemptibleInstanceConfigDetails.new(
    preemption_action:
      OCI::Core::Models::TerminatePreemptionAction.new(
        type: "TERMINATE", preserve_boot_volume: true
      )
  )
end

#shape_configObject



42
43
44
45
46
47
48
49
50
# File 'lib/kitchen/driver/oci/instance/compute.rb', line 42

def shape_config
  return if config[:shape_config].empty?

  launch_details.shape_config = OCI::Core::Models::LaunchInstanceShapeConfigDetails.new(
    ocpus: config[:shape_config][:ocpus],
    memory_in_gbs: config[:shape_config][:memory_in_gbs],
    baseline_ocpu_utilization: config[:shape_config][:baseline_ocpu_utilization] || "BASELINE_1_1"
  )
end