Class: OCI::CloudBridge::Models::VmwareVmProperties

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/cloud_bridge/models/vmware_vm_properties.rb

Overview

VMware virtual machine related properties.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ VmwareVmProperties

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



112
113
114
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/oci/cloud_bridge/models/vmware_vm_properties.rb', line 112

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

  self.customer_fields = attributes[:'customerFields'] if attributes[:'customerFields']

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

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

  self.customer_tags = attributes[:'customerTags'] if attributes[:'customerTags']

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

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

  self.instance_uuid = attributes[:'instanceUuid'] if attributes[:'instanceUuid']

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

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

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

  self.vmware_tools_status = attributes[:'vmwareToolsStatus'] if attributes[:'vmwareToolsStatus']

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

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

  self.is_disks_uuid_enabled = attributes[:'isDisksUuidEnabled'] unless attributes[:'isDisksUuidEnabled'].nil?

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

  self.is_disks_uuid_enabled = attributes[:'is_disks_uuid_enabled'] unless attributes[:'is_disks_uuid_enabled'].nil?

  self.is_disks_cbt_enabled = attributes[:'isDisksCbtEnabled'] unless attributes[:'isDisksCbtEnabled'].nil?

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

  self.is_disks_cbt_enabled = attributes[:'is_disks_cbt_enabled'] unless attributes[:'is_disks_cbt_enabled'].nil?

  self.fault_tolerance_state = attributes[:'faultToleranceState'] if attributes[:'faultToleranceState']

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

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

  self.fault_tolerance_bandwidth = attributes[:'faultToleranceBandwidth'] if attributes[:'faultToleranceBandwidth']

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

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

  self.fault_tolerance_secondary_latency = attributes[:'faultToleranceSecondaryLatency'] if attributes[:'faultToleranceSecondaryLatency']

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

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

Instance Attribute Details

#clusterString

Cluster name.

Returns:

  • (String)


13
14
15
# File 'lib/oci/cloud_bridge/models/vmware_vm_properties.rb', line 13

def cluster
  @cluster
end

#customer_fieldsArray<String>

Customer fields.

Returns:

  • (Array<String>)


17
18
19
# File 'lib/oci/cloud_bridge/models/vmware_vm_properties.rb', line 17

def customer_fields
  @customer_fields
end

#customer_tagsArray<OCI::CloudBridge::Models::CustomerTag>

Customer defined tags.



21
22
23
# File 'lib/oci/cloud_bridge/models/vmware_vm_properties.rb', line 21

def customer_tags
  @customer_tags
end

#fault_tolerance_bandwidthInteger

Fault tolerance bandwidth.

Returns:

  • (Integer)


51
52
53
# File 'lib/oci/cloud_bridge/models/vmware_vm_properties.rb', line 51

def fault_tolerance_bandwidth
  @fault_tolerance_bandwidth
end

#fault_tolerance_secondary_latencyInteger

Fault tolerance to secondary latency.

Returns:

  • (Integer)


55
56
57
# File 'lib/oci/cloud_bridge/models/vmware_vm_properties.rb', line 55

def fault_tolerance_secondary_latency
  @fault_tolerance_secondary_latency
end

#fault_tolerance_stateString

Fault tolerance state.

Returns:

  • (String)


47
48
49
# File 'lib/oci/cloud_bridge/models/vmware_vm_properties.rb', line 47

def fault_tolerance_state
  @fault_tolerance_state
end

#instance_uuidString

vCenter-specific identifier of the virtual machine.

Returns:

  • (String)


25
26
27
# File 'lib/oci/cloud_bridge/models/vmware_vm_properties.rb', line 25

def instance_uuid
  @instance_uuid
end

#is_disks_cbt_enabledBOOLEAN

Indicates that change tracking is supported for virtual disks of this virtual machine. However, even if change tracking is supported, it might not be available for all disks of the virtual machine.

Returns:

  • (BOOLEAN)


43
44
45
# File 'lib/oci/cloud_bridge/models/vmware_vm_properties.rb', line 43

def is_disks_cbt_enabled
  @is_disks_cbt_enabled
end

#is_disks_uuid_enabledBOOLEAN

Whether changed block tracking for this VM's disk is active.

Returns:

  • (BOOLEAN)


37
38
39
# File 'lib/oci/cloud_bridge/models/vmware_vm_properties.rb', line 37

def is_disks_uuid_enabled
  @is_disks_uuid_enabled
end

#pathString

Path directory of the asset.

Returns:

  • (String)


29
30
31
# File 'lib/oci/cloud_bridge/models/vmware_vm_properties.rb', line 29

def path
  @path
end

#vmware_tools_statusString

VMware tools status.

Returns:

  • (String)


33
34
35
# File 'lib/oci/cloud_bridge/models/vmware_vm_properties.rb', line 33

def vmware_tools_status
  @vmware_tools_status
end

Class Method Details

.attribute_mapObject

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



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/oci/cloud_bridge/models/vmware_vm_properties.rb', line 58

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'cluster': :'cluster',
    'customer_fields': :'customerFields',
    'customer_tags': :'customerTags',
    'instance_uuid': :'instanceUuid',
    'path': :'path',
    'vmware_tools_status': :'vmwareToolsStatus',
    'is_disks_uuid_enabled': :'isDisksUuidEnabled',
    'is_disks_cbt_enabled': :'isDisksCbtEnabled',
    'fault_tolerance_state': :'faultToleranceState',
    'fault_tolerance_bandwidth': :'faultToleranceBandwidth',
    'fault_tolerance_secondary_latency': :'faultToleranceSecondaryLatency'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/oci/cloud_bridge/models/vmware_vm_properties.rb', line 77

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'cluster': :'String',
    'customer_fields': :'Array<String>',
    'customer_tags': :'Array<OCI::CloudBridge::Models::CustomerTag>',
    'instance_uuid': :'String',
    'path': :'String',
    'vmware_tools_status': :'String',
    'is_disks_uuid_enabled': :'BOOLEAN',
    'is_disks_cbt_enabled': :'BOOLEAN',
    'fault_tolerance_state': :'String',
    'fault_tolerance_bandwidth': :'Integer',
    'fault_tolerance_secondary_latency': :'Integer'
    # 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



184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/oci/cloud_bridge/models/vmware_vm_properties.rb', line 184

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    cluster == other.cluster &&
    customer_fields == other.customer_fields &&
    customer_tags == other.customer_tags &&
    instance_uuid == other.instance_uuid &&
    path == other.path &&
    vmware_tools_status == other.vmware_tools_status &&
    is_disks_uuid_enabled == other.is_disks_uuid_enabled &&
    is_disks_cbt_enabled == other.is_disks_cbt_enabled &&
    fault_tolerance_state == other.fault_tolerance_state &&
    fault_tolerance_bandwidth == other.fault_tolerance_bandwidth &&
    fault_tolerance_secondary_latency == other.fault_tolerance_secondary_latency
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



224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# File 'lib/oci/cloud_bridge/models/vmware_vm_properties.rb', line 224

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


204
205
206
# File 'lib/oci/cloud_bridge/models/vmware_vm_properties.rb', line 204

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



213
214
215
# File 'lib/oci/cloud_bridge/models/vmware_vm_properties.rb', line 213

def hash
  [cluster, customer_fields, customer_tags, instance_uuid, path, vmware_tools_status, is_disks_uuid_enabled, is_disks_cbt_enabled, fault_tolerance_state, fault_tolerance_bandwidth, fault_tolerance_secondary_latency].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



257
258
259
260
261
262
263
264
265
266
# File 'lib/oci/cloud_bridge/models/vmware_vm_properties.rb', line 257

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



251
252
253
# File 'lib/oci/cloud_bridge/models/vmware_vm_properties.rb', line 251

def to_s
  to_hash.to_s
end