Class: OCI::Opsi::Models::DBExternalProperties

Inherits:
DatabaseConfigurationMetricGroup show all
Defined in:
lib/oci/opsi/models/db_external_properties.rb

Overview

Configuration parameters defined for external databases.

Constant Summary

Constants inherited from DatabaseConfigurationMetricGroup

OCI::Opsi::Models::DatabaseConfigurationMetricGroup::METRIC_NAME_ENUM

Instance Attribute Summary collapse

Attributes inherited from DatabaseConfigurationMetricGroup

#metric_name, #time_collected

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from DatabaseConfigurationMetricGroup

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ DBExternalProperties

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :time_collected (DateTime)

    The value to assign to the #time_collected proprety

  • :name (String)

    The value to assign to the #name property

  • :log_mode (String)

    The value to assign to the #log_mode property

  • :cdb (String)

    The value to assign to the #cdb property

  • :open_mode (String)

    The value to assign to the #open_mode property

  • :database_role (String)

    The value to assign to the #database_role property

  • :guard_status (String)

    The value to assign to the #guard_status property

  • :platform_name (String)

    The value to assign to the #platform_name property

  • :control_file_type (String)

    The value to assign to the #control_file_type property

  • :switchover_status (String)

    The value to assign to the #switchover_status property

  • :created (DateTime)

    The value to assign to the #created property



109
110
111
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
# File 'lib/oci/opsi/models/db_external_properties.rb', line 109

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

  attributes['metricName'] = 'DB_EXTERNAL_PROPERTIES'

  super(attributes)

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

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

  self.log_mode = attributes[:'logMode'] if attributes[:'logMode']

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

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

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

  self.open_mode = attributes[:'openMode'] if attributes[:'openMode']

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

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

  self.database_role = attributes[:'databaseRole'] if attributes[:'databaseRole']

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

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

  self.guard_status = attributes[:'guardStatus'] if attributes[:'guardStatus']

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

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

  self.platform_name = attributes[:'platformName'] if attributes[:'platformName']

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

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

  self.control_file_type = attributes[:'controlFileType'] if attributes[:'controlFileType']

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

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

  self.switchover_status = attributes[:'switchoverStatus'] if attributes[:'switchoverStatus']

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

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

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

Instance Attribute Details

#cdbString

Indicates if it is a CDB or not. This would be 'yes' or 'no'.

Returns:

  • (String)


22
23
24
# File 'lib/oci/opsi/models/db_external_properties.rb', line 22

def cdb
  @cdb
end

#control_file_typeString

Type of control file.

Returns:

  • (String)


42
43
44
# File 'lib/oci/opsi/models/db_external_properties.rb', line 42

def control_file_type
  @control_file_type
end

#createdDateTime

Creation time.

Returns:

  • (DateTime)


50
51
52
# File 'lib/oci/opsi/models/db_external_properties.rb', line 50

def created
  @created
end

#database_roleString

Current role of the database.

Returns:

  • (String)


30
31
32
# File 'lib/oci/opsi/models/db_external_properties.rb', line 30

def database_role
  @database_role
end

#guard_statusString

Data protection policy.

Returns:

  • (String)


34
35
36
# File 'lib/oci/opsi/models/db_external_properties.rb', line 34

def guard_status
  @guard_status
end

#log_modeString

Archive log mode.

Returns:

  • (String)


18
19
20
# File 'lib/oci/opsi/models/db_external_properties.rb', line 18

def log_mode
  @log_mode
end

#nameString

Name of the database.

Returns:

  • (String)


14
15
16
# File 'lib/oci/opsi/models/db_external_properties.rb', line 14

def name
  @name
end

#open_modeString

Open mode information.

Returns:

  • (String)


26
27
28
# File 'lib/oci/opsi/models/db_external_properties.rb', line 26

def open_mode
  @open_mode
end

#platform_nameString

Platform name of the database, OS with architecture.

Returns:

  • (String)


38
39
40
# File 'lib/oci/opsi/models/db_external_properties.rb', line 38

def platform_name
  @platform_name
end

#switchover_statusString

Indicates whether switchover is allowed.

Returns:

  • (String)


46
47
48
# File 'lib/oci/opsi/models/db_external_properties.rb', line 46

def switchover_status
  @switchover_status
end

Class Method Details

.attribute_mapObject

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



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/oci/opsi/models/db_external_properties.rb', line 53

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'metric_name': :'metricName',
    'time_collected': :'timeCollected',
    'name': :'name',
    'log_mode': :'logMode',
    'cdb': :'cdb',
    'open_mode': :'openMode',
    'database_role': :'databaseRole',
    'guard_status': :'guardStatus',
    'platform_name': :'platformName',
    'control_file_type': :'controlFileType',
    'switchover_status': :'switchoverStatus',
    'created': :'created'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/oci/opsi/models/db_external_properties.rb', line 73

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'metric_name': :'String',
    'time_collected': :'DateTime',
    'name': :'String',
    'log_mode': :'String',
    'cdb': :'String',
    'open_mode': :'String',
    'database_role': :'String',
    'guard_status': :'String',
    'platform_name': :'String',
    'control_file_type': :'String',
    'switchover_status': :'String',
    '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



175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/oci/opsi/models/db_external_properties.rb', line 175

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

  self.class == other.class &&
    metric_name == other.metric_name &&
    time_collected == other.time_collected &&
    name == other.name &&
    log_mode == other.log_mode &&
    cdb == other.cdb &&
    open_mode == other.open_mode &&
    database_role == other.database_role &&
    guard_status == other.guard_status &&
    platform_name == other.platform_name &&
    control_file_type == other.control_file_type &&
    switchover_status == other.switchover_status &&
    created == other.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



216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# File 'lib/oci/opsi/models/db_external_properties.rb', line 216

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


196
197
198
# File 'lib/oci/opsi/models/db_external_properties.rb', line 196

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



205
206
207
# File 'lib/oci/opsi/models/db_external_properties.rb', line 205

def hash
  [metric_name, time_collected, name, log_mode, cdb, open_mode, database_role, guard_status, platform_name, control_file_type, switchover_status, created].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



249
250
251
252
253
254
255
256
257
258
# File 'lib/oci/opsi/models/db_external_properties.rb', line 249

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



243
244
245
# File 'lib/oci/opsi/models/db_external_properties.rb', line 243

def to_s
  to_hash.to_s
end