Class: OCI::Database::Models::DbNode

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/database/models/db_node.rb

Overview

DbNode model.

Constant Summary collapse

LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING'.freeze,
  LIFECYCLE_STATE_AVAILABLE = 'AVAILABLE'.freeze,
  LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze,
  LIFECYCLE_STATE_STOPPING = 'STOPPING'.freeze,
  LIFECYCLE_STATE_STOPPED = 'STOPPED'.freeze,
  LIFECYCLE_STATE_STARTING = 'STARTING'.freeze,
  LIFECYCLE_STATE_TERMINATING = 'TERMINATING'.freeze,
  LIFECYCLE_STATE_TERMINATED = 'TERMINATED'.freeze,
  LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
MAINTENANCE_TYPE_ENUM =
[
  MAINTENANCE_TYPE_VMDB_REBOOT_MIGRATION = 'VMDB_REBOOT_MIGRATION'.freeze,
  MAINTENANCE_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 = {}) ⇒ DbNode

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :id (String)

    The value to assign to the #id property

  • :db_system_id (String)

    The value to assign to the #db_system_id property

  • :vnic_id (String)

    The value to assign to the #vnic_id property

  • :backup_vnic_id (String)

    The value to assign to the #backup_vnic_id property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :hostname (String)

    The value to assign to the #hostname property

  • :fault_domain (String)

    The value to assign to the #fault_domain property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :software_storage_size_in_gb (Integer)

    The value to assign to the #software_storage_size_in_gb property

  • :maintenance_type (String)

    The value to assign to the #maintenance_type property

  • :time_maintenance_window_start (DateTime)

    The value to assign to the #time_maintenance_window_start property

  • :time_maintenance_window_end (DateTime)

    The value to assign to the #time_maintenance_window_end property

  • :additional_details (String)

    The value to assign to the #additional_details property



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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# File 'lib/oci/database/models/db_node.rb', line 143

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

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

  self.db_system_id = attributes[:'dbSystemId'] if attributes[:'dbSystemId']

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

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

  self.vnic_id = attributes[:'vnicId'] if attributes[:'vnicId']

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

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

  self.backup_vnic_id = attributes[:'backupVnicId'] if attributes[:'backupVnicId']

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

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

  self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']

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

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

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

  self.fault_domain = attributes[:'faultDomain'] if attributes[:'faultDomain']

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

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

  self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']

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

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

  self.software_storage_size_in_gb = attributes[:'softwareStorageSizeInGB'] if attributes[:'softwareStorageSizeInGB']

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

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

  self.maintenance_type = attributes[:'maintenanceType'] if attributes[:'maintenanceType']

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

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

  self.time_maintenance_window_start = attributes[:'timeMaintenanceWindowStart'] if attributes[:'timeMaintenanceWindowStart']

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

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

  self.time_maintenance_window_end = attributes[:'timeMaintenanceWindowEnd'] if attributes[:'timeMaintenanceWindowEnd']

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

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

  self.additional_details = attributes[:'additionalDetails'] if attributes[:'additionalDetails']

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

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

Instance Attribute Details

#additional_detailsString

Additional information about the planned maintenance.

Returns:

  • (String)


80
81
82
# File 'lib/oci/database/models/db_node.rb', line 80

def additional_details
  @additional_details
end

#backup_vnic_idString

The OCID of the backup VNIC.

Returns:

  • (String)


43
44
45
# File 'lib/oci/database/models/db_node.rb', line 43

def backup_vnic_id
  @backup_vnic_id
end

#db_system_idString

[Required] The OCID of the DB system.

Returns:

  • (String)


35
36
37
# File 'lib/oci/database/models/db_node.rb', line 35

def db_system_id
  @db_system_id
end

#fault_domainString

The name of the Fault Domain the instance is contained in.

Returns:

  • (String)


55
56
57
# File 'lib/oci/database/models/db_node.rb', line 55

def fault_domain
  @fault_domain
end

#hostnameString

The host name for the database node.

Returns:

  • (String)


51
52
53
# File 'lib/oci/database/models/db_node.rb', line 51

def hostname
  @hostname
end

#idString

[Required] The OCID of the database node.

Returns:

  • (String)


31
32
33
# File 'lib/oci/database/models/db_node.rb', line 31

def id
  @id
end

#lifecycle_stateString

[Required] The current state of the database node.

Returns:

  • (String)


47
48
49
# File 'lib/oci/database/models/db_node.rb', line 47

def lifecycle_state
  @lifecycle_state
end

#maintenance_typeString

The type of database node maintenance.

Returns:

  • (String)


68
69
70
# File 'lib/oci/database/models/db_node.rb', line 68

def maintenance_type
  @maintenance_type
end

#software_storage_size_in_gbInteger

The size (in GB) of the block storage volume allocation for the DB system. This attribute applies only for virtual machine DB systems.

Returns:

  • (Integer)


64
65
66
# File 'lib/oci/database/models/db_node.rb', line 64

def software_storage_size_in_gb
  @software_storage_size_in_gb
end

#time_createdDateTime

[Required] The date and time that the database node was created.

Returns:

  • (DateTime)


59
60
61
# File 'lib/oci/database/models/db_node.rb', line 59

def time_created
  @time_created
end

#time_maintenance_window_endDateTime

End date and time of maintenance window.

Returns:

  • (DateTime)


76
77
78
# File 'lib/oci/database/models/db_node.rb', line 76

def time_maintenance_window_end
  @time_maintenance_window_end
end

#time_maintenance_window_startDateTime

Start date and time of maintenance window.

Returns:

  • (DateTime)


72
73
74
# File 'lib/oci/database/models/db_node.rb', line 72

def time_maintenance_window_start
  @time_maintenance_window_start
end

#vnic_idString

[Required] The OCID of the VNIC.

Returns:

  • (String)


39
40
41
# File 'lib/oci/database/models/db_node.rb', line 39

def vnic_id
  @vnic_id
end

Class Method Details

.attribute_mapObject

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



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/oci/database/models/db_node.rb', line 83

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'db_system_id': :'dbSystemId',
    'vnic_id': :'vnicId',
    'backup_vnic_id': :'backupVnicId',
    'lifecycle_state': :'lifecycleState',
    'hostname': :'hostname',
    'fault_domain': :'faultDomain',
    'time_created': :'timeCreated',
    'software_storage_size_in_gb': :'softwareStorageSizeInGB',
    'maintenance_type': :'maintenanceType',
    'time_maintenance_window_start': :'timeMaintenanceWindowStart',
    'time_maintenance_window_end': :'timeMaintenanceWindowEnd',
    'additional_details': :'additionalDetails'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/oci/database/models/db_node.rb', line 104

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'db_system_id': :'String',
    'vnic_id': :'String',
    'backup_vnic_id': :'String',
    'lifecycle_state': :'String',
    'hostname': :'String',
    'fault_domain': :'String',
    'time_created': :'DateTime',
    'software_storage_size_in_gb': :'Integer',
    'maintenance_type': :'String',
    'time_maintenance_window_start': :'DateTime',
    'time_maintenance_window_end': :'DateTime',
    'additional_details': :'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



250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# File 'lib/oci/database/models/db_node.rb', line 250

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

  self.class == other.class &&
    id == other.id &&
    db_system_id == other.db_system_id &&
    vnic_id == other.vnic_id &&
    backup_vnic_id == other.backup_vnic_id &&
    lifecycle_state == other.lifecycle_state &&
    hostname == other.hostname &&
    fault_domain == other.fault_domain &&
    time_created == other.time_created &&
    software_storage_size_in_gb == other.software_storage_size_in_gb &&
    maintenance_type == other.maintenance_type &&
    time_maintenance_window_start == other.time_maintenance_window_start &&
    time_maintenance_window_end == other.time_maintenance_window_end &&
    additional_details == other.additional_details
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



292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
# File 'lib/oci/database/models/db_node.rb', line 292

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


272
273
274
# File 'lib/oci/database/models/db_node.rb', line 272

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



281
282
283
# File 'lib/oci/database/models/db_node.rb', line 281

def hash
  [id, db_system_id, vnic_id, backup_vnic_id, lifecycle_state, hostname, fault_domain, time_created, software_storage_size_in_gb, maintenance_type, time_maintenance_window_start, time_maintenance_window_end, additional_details].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



325
326
327
328
329
330
331
332
333
334
# File 'lib/oci/database/models/db_node.rb', line 325

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



319
320
321
# File 'lib/oci/database/models/db_node.rb', line 319

def to_s
  to_hash.to_s
end