Class: OCI::Bds::Models::NodeBackup

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/bds/models/node_backup.rb

Overview

The information about the Node's backup.

Constant Summary collapse

BACKUP_TRIGGER_TYPE_ENUM =
[
  BACKUP_TRIGGER_TYPE_MANUAL = 'MANUAL'.freeze,
  BACKUP_TRIGGER_TYPE_SCHEDULED = 'SCHEDULED'.freeze,
  BACKUP_TRIGGER_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
BACKUP_TYPE_ENUM =
[
  BACKUP_TYPE_FULL = 'FULL'.freeze,
  BACKUP_TYPE_INCREMENTAL = 'INCREMENTAL'.freeze,
  BACKUP_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze,
  LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
  LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
  LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
  LIFECYCLE_STATE_PARTIAL = 'PARTIAL'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ NodeBackup

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

  • :display_name (String)

    The value to assign to the #display_name property

  • :node_instance_id (String)

    The value to assign to the #node_instance_id property

  • :node_host_name (String)

    The value to assign to the #node_host_name property

  • :backup_trigger_type (String)

    The value to assign to the #backup_trigger_type property

  • :node_backup_config_id (String)

    The value to assign to the #node_backup_config_id property

  • :backup_type (String)

    The value to assign to the #backup_type property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :time_created (DateTime)

    The value to assign to the #time_created property



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/bds/models/node_backup.rb', line 120

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

  self.display_name = attributes[:'displayName'] if attributes[:'displayName']

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

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

  self.node_instance_id = attributes[:'nodeInstanceId'] if attributes[:'nodeInstanceId']

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

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

  self.node_host_name = attributes[:'nodeHostName'] if attributes[:'nodeHostName']

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

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

  self.backup_trigger_type = attributes[:'backupTriggerType'] if attributes[:'backupTriggerType']

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

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

  self.node_backup_config_id = attributes[:'nodeBackupConfigId'] if attributes[:'nodeBackupConfigId']

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

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

  self.backup_type = attributes[:'backupType'] if attributes[:'backupType']

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

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

  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.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']
end

Instance Attribute Details

#backup_trigger_typeString

[Required] type based on how backup action was initiated.

Returns:

  • (String)


53
54
55
# File 'lib/oci/bds/models/node_backup.rb', line 53

def backup_trigger_type
  @backup_trigger_type
end

#backup_typeString

[Required] Incremental backup type includes only the changes since the last backup. Full backup type includes all changes since the volume was created.

Returns:

  • (String)


61
62
63
# File 'lib/oci/bds/models/node_backup.rb', line 61

def backup_type
  @backup_type
end

#display_nameString

[Required] BDS generated name for the backup. Format is nodeHostName_timeCreated

Returns:

  • (String)


41
42
43
# File 'lib/oci/bds/models/node_backup.rb', line 41

def display_name
  @display_name
end

#idString

[Required] The id of the node backup.

Returns:

  • (String)


37
38
39
# File 'lib/oci/bds/models/node_backup.rb', line 37

def id
  @id
end

#lifecycle_stateString

[Required] The state of the NodeBackup.

Returns:

  • (String)


65
66
67
# File 'lib/oci/bds/models/node_backup.rb', line 65

def lifecycle_state
  @lifecycle_state
end

#node_backup_config_idString

The ID of the nodeBackupConfiguration if the NodeBackup is automatically created by applying the configuration.

Returns:

  • (String)


57
58
59
# File 'lib/oci/bds/models/node_backup.rb', line 57

def node_backup_config_id
  @node_backup_config_id
end

#node_host_nameString

[Required] Host name of the node to which this backup belongs.

Returns:

  • (String)


49
50
51
# File 'lib/oci/bds/models/node_backup.rb', line 49

def node_host_name
  @node_host_name
end

#node_instance_idString

[Required] The instance OCID of the node, which is the resource from which the node backup was acquired.

Returns:

  • (String)


45
46
47
# File 'lib/oci/bds/models/node_backup.rb', line 45

def node_instance_id
  @node_instance_id
end

#time_createdDateTime

[Required] The time the cluster was created, shown as an RFC 3339 formatted datetime string.

Returns:

  • (DateTime)


69
70
71
# File 'lib/oci/bds/models/node_backup.rb', line 69

def time_created
  @time_created
end

Class Method Details

.attribute_mapObject

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



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/oci/bds/models/node_backup.rb', line 72

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'display_name': :'displayName',
    'node_instance_id': :'nodeInstanceId',
    'node_host_name': :'nodeHostName',
    'backup_trigger_type': :'backupTriggerType',
    'node_backup_config_id': :'nodeBackupConfigId',
    'backup_type': :'backupType',
    'lifecycle_state': :'lifecycleState',
    'time_created': :'timeCreated'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/oci/bds/models/node_backup.rb', line 89

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'display_name': :'String',
    'node_instance_id': :'String',
    'node_host_name': :'String',
    'backup_trigger_type': :'String',
    'node_backup_config_id': :'String',
    'backup_type': :'String',
    'lifecycle_state': :'String',
    'time_created': :'DateTime'
    # 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



223
224
225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/oci/bds/models/node_backup.rb', line 223

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

  self.class == other.class &&
    id == other.id &&
    display_name == other.display_name &&
    node_instance_id == other.node_instance_id &&
    node_host_name == other.node_host_name &&
    backup_trigger_type == other.backup_trigger_type &&
    node_backup_config_id == other.node_backup_config_id &&
    backup_type == other.backup_type &&
    lifecycle_state == other.lifecycle_state &&
    time_created == other.time_created
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



261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/oci/bds/models/node_backup.rb', line 261

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


241
242
243
# File 'lib/oci/bds/models/node_backup.rb', line 241

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



250
251
252
# File 'lib/oci/bds/models/node_backup.rb', line 250

def hash
  [id, display_name, node_instance_id, node_host_name, backup_trigger_type, node_backup_config_id, backup_type, lifecycle_state, time_created].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



294
295
296
297
298
299
300
301
302
303
# File 'lib/oci/bds/models/node_backup.rb', line 294

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



288
289
290
# File 'lib/oci/bds/models/node_backup.rb', line 288

def to_s
  to_hash.to_s
end