Class: OCI::Core::Models::LaunchOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/core/models/launch_options.rb

Overview

Options for tuning compatibility and performance of VM shapes.

Constant Summary collapse

BOOT_VOLUME_TYPE_ENUM =
[BOOT_VOLUME_TYPE_ISCSI = 'ISCSI',
BOOT_VOLUME_TYPE_SCSI = 'SCSI',
BOOT_VOLUME_TYPE_IDE = 'IDE',
BOOT_VOLUME_TYPE_VFIO = 'VFIO',
BOOT_VOLUME_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
FIRMWARE_ENUM =
[FIRMWARE_BIOS = 'BIOS',
FIRMWARE_UEFI_64 = 'UEFI_64',
FIRMWARE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
NETWORK_TYPE_ENUM =
[NETWORK_TYPE_E1000 = 'E1000',
NETWORK_TYPE_VFIO = 'VFIO',
NETWORK_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
REMOTE_DATA_VOLUME_TYPE_ENUM =
[REMOTE_DATA_VOLUME_TYPE_ISCSI = 'ISCSI',
REMOTE_DATA_VOLUME_TYPE_SCSI = 'SCSI',
REMOTE_DATA_VOLUME_TYPE_IDE = 'IDE',
REMOTE_DATA_VOLUME_TYPE_VFIO = 'VFIO',
REMOTE_DATA_VOLUME_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ LaunchOptions

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):

  • :boot_volume_type (String)

    The value to assign to the #boot_volume_type property

  • :firmware (String)

    The value to assign to the #firmware property

  • :network_type (String)

    The value to assign to the #network_type property

  • :remote_data_volume_type (String)

    The value to assign to the #remote_data_volume_type property



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/oci/core/models/launch_options.rb', line 78

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}

  if attributes[:'bootVolumeType']
    self.boot_volume_type = attributes[:'bootVolumeType']
  end

  raise 'You cannot provide both :bootVolumeType and :boot_volume_type' if attributes.key?(:'bootVolumeType') && attributes.key?(:'boot_volume_type')

  if attributes[:'boot_volume_type']
    self.boot_volume_type = attributes[:'boot_volume_type']
  end

  if attributes[:'firmware']
    self.firmware = attributes[:'firmware']
  end

  if attributes[:'networkType']
    self.network_type = attributes[:'networkType']
  end

  raise 'You cannot provide both :networkType and :network_type' if attributes.key?(:'networkType') && attributes.key?(:'network_type')

  if attributes[:'network_type']
    self.network_type = attributes[:'network_type']
  end

  if attributes[:'remoteDataVolumeType']
    self.remote_data_volume_type = attributes[:'remoteDataVolumeType']
  end

  raise 'You cannot provide both :remoteDataVolumeType and :remote_data_volume_type' if attributes.key?(:'remoteDataVolumeType') && attributes.key?(:'remote_data_volume_type')

  if attributes[:'remote_data_volume_type']
    self.remote_data_volume_type = attributes[:'remote_data_volume_type']
  end

end

Instance Attribute Details

#boot_volume_typeString

[Required] Emulation type for volume.

  • ‘ISCSI` - ISCSI attached block storage device. This is the default for Boot Volumes and Remote Block

Storage volumes on Oracle provided images.

  • ‘SCSI` - Emulated SCSI disk.

  • ‘IDE` - Emulated IDE disk.

  • ‘VFIO` - Direct attached Virtual Function storage. This is the default option for Local data

volumes on Oracle provided images.

Returns:

  • (String)


42
43
44
# File 'lib/oci/core/models/launch_options.rb', line 42

def boot_volume_type
  @boot_volume_type
end

#firmwareString

[Required] Firmware used to boot VM. Select the option that matches your operating system.

  • ‘BIOS` - Boot VM using BIOS style firmware. This is compatible with both 32 bit and 64 bit operating

systems that boot using MBR style bootloaders.

  • ‘UEFI_64` - Boot VM using UEFI style firmware compatible with 64 bit operating systems. This is the

default for Oracle provided images.

Returns:

  • (String)


51
52
53
# File 'lib/oci/core/models/launch_options.rb', line 51

def firmware
  @firmware
end

#network_typeString

[Required] Emulation type for NIC.

  • ‘E1000` - Emulated Gigabit ethernet controller. Compatible with Linux e1000 network driver.

  • ‘VFIO` - Direct attached Virtual Function network controller. Default for Oracle provided images.

Returns:

  • (String)


58
59
60
# File 'lib/oci/core/models/launch_options.rb', line 58

def network_type
  @network_type
end

#remote_data_volume_typeString

[Required] Emulation type for volume.

  • ‘ISCSI` - ISCSI attached block storage device. This is the default for Boot Volumes and Remote Block

Storage volumes on Oracle provided images.

  • ‘SCSI` - Emulated SCSI disk.

  • ‘IDE` - Emulated IDE disk.

  • ‘VFIO` - Direct attached Virtual Function storage. This is the default option for Local data

volumes on Oracle provided images.

Returns:

  • (String)


69
70
71
# File 'lib/oci/core/models/launch_options.rb', line 69

def remote_data_volume_type
  @remote_data_volume_type
end

Instance Method Details

#==(other_object) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other_object (Object)

    to be compared



162
163
164
165
166
167
168
169
# File 'lib/oci/core/models/launch_options.rb', line 162

def ==(other_object)
  return true if self.equal?(other_object)
  self.class == other_object.class &&
      boot_volume_type == other_object.boot_volume_type &&
      firmware == other_object.firmware &&
      network_type == other_object.network_type &&
      remote_data_volume_type == other_object.remote_data_volume_type
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/oci/core/models/launch_options.rb', line 186

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.public_method("#{key}=").call(OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other_object) ⇒ Boolean

Parameters:

  • other_object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


173
174
175
# File 'lib/oci/core/models/launch_options.rb', line 173

def eql?(other_object)
  self == other_object
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



179
180
181
# File 'lib/oci/core/models/launch_options.rb', line 179

def hash
  [boot_volume_type, firmware, network_type, remote_data_volume_type].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



211
212
213
214
215
216
217
218
219
# File 'lib/oci/core/models/launch_options.rb', line 211

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



205
206
207
# File 'lib/oci/core/models/launch_options.rb', line 205

def to_s
  to_hash.to_s
end