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 =

rubocop:disable Metrics/LineLength

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

Instance Attribute Summary collapse

Class Method 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



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/oci/core/models/launch_options.rb', line 115

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 }

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

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

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

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

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

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

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

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

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

  self.remote_data_volume_type = attributes[:'remote_data_volume_type'] if attributes[:'remote_data_volume_type']
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.

  • ‘PARAVIRTUALIZED` - Paravirtualized disk.

Returns:

  • (String)


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

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)


60
61
62
# File 'lib/oci/core/models/launch_options.rb', line 60

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)


67
68
69
# File 'lib/oci/core/models/launch_options.rb', line 67

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.

  • ‘PARAVIRTUALIZED` - Paravirtualized disk.

Returns:

  • (String)


79
80
81
# File 'lib/oci/core/models/launch_options.rb', line 79

def remote_data_volume_type
  @remote_data_volume_type
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



82
83
84
85
86
87
88
89
90
91
# File 'lib/oci/core/models/launch_options.rb', line 82

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'boot_volume_type': :'bootVolumeType',
    'firmware': :'firmware',
    'network_type': :'networkType',
    'remote_data_volume_type': :'remoteDataVolumeType'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



94
95
96
97
98
99
100
101
102
103
# File 'lib/oci/core/models/launch_options.rb', line 94

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'boot_volume_type': :'String',
    'firmware': :'String',
    'network_type': :'String',
    'remote_data_volume_type': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



209
210
211
212
213
214
215
216
# File 'lib/oci/core/models/launch_options.rb', line 209

def ==(other)
  return true if equal?(other)
  self.class == other.class &&
    boot_volume_type == other.boot_volume_type &&
    firmware == other.firmware &&
    network_type == other.network_type &&
    remote_data_volume_type == other.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



241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
# File 'lib/oci/core/models/launch_options.rb', line 241

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)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      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) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


221
222
223
# File 'lib/oci/core/models/launch_options.rb', line 221

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



230
231
232
# File 'lib/oci/core/models/launch_options.rb', line 230

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



273
274
275
276
277
278
279
280
281
# File 'lib/oci/core/models/launch_options.rb', line 273

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



267
268
269
# File 'lib/oci/core/models/launch_options.rb', line 267

def to_s
  to_hash.to_s
end