Class: OCI::Opsi::Models::DBExternalInstance

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

Overview

Configuration parameters defined for external databases instance level.

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 = {}) ⇒ DBExternalInstance

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

  • :instance_name (String)

    The value to assign to the #instance_name property

  • :host_name (String)

    The value to assign to the #host_name property

  • :cpu_count (Integer)

    The value to assign to the #cpu_count property

  • :host_memory_capacity (Float)

    The value to assign to the #host_memory_capacity property

  • :version (String)

    The value to assign to the #version property

  • :parallel (String)

    The value to assign to the #parallel property

  • :instance_role (String)

    The value to assign to the #instance_role property

  • :logins (String)

    The value to assign to the #logins property

  • :database_status (String)

    The value to assign to the #database_status property

  • :status (String)

    The value to assign to the #status property

  • :edition (String)

    The value to assign to the #edition property

  • :startup_time (DateTime)

    The value to assign to the #startup_time property



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
176
177
178
179
180
181
182
183
184
# File 'lib/oci/opsi/models/db_external_instance.rb', line 123

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

  attributes['metricName'] = 'DB_EXTERNAL_INSTANCE'

  super(attributes)

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

  self.instance_name = attributes[:'instanceName'] if attributes[:'instanceName']

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

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

  self.host_name = attributes[:'hostName'] if attributes[:'hostName']

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

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

  self.cpu_count = attributes[:'cpuCount'] if attributes[:'cpuCount']

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

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

  self.host_memory_capacity = attributes[:'hostMemoryCapacity'] if attributes[:'hostMemoryCapacity']

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

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

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

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

  self.instance_role = attributes[:'instanceRole'] if attributes[:'instanceRole']

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

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

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

  self.database_status = attributes[:'databaseStatus'] if attributes[:'databaseStatus']

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

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

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

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

  self.startup_time = attributes[:'startupTime'] if attributes[:'startupTime']

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

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

Instance Attribute Details

#cpu_countInteger

Total number of CPUs allocated for the host.

Returns:

  • (Integer)


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

def cpu_count
  @cpu_count
end

#database_statusString

Status of the database.

Returns:

  • (String)


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

def database_status
  @database_status
end

#editionString

The edition of the database.

Returns:

  • (String)


54
55
56
# File 'lib/oci/opsi/models/db_external_instance.rb', line 54

def edition
  @edition
end

#host_memory_capacityFloat

Total amount of usable Physical RAM Memory available in gigabytes.

Returns:

  • (Float)


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

def host_memory_capacity
  @host_memory_capacity
end

#host_nameString

[Required] Host name of the database instance.

Returns:

  • (String)


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

def host_name
  @host_name
end

#instance_nameString

[Required] Name of the database instance.

Returns:

  • (String)


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

def instance_name
  @instance_name
end

#instance_roleString

Role (permissions) of the database instance.

Returns:

  • (String)


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

def instance_role
  @instance_role
end

#loginsString

Indicates if logins are allowed or restricted.

Returns:

  • (String)


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

def logins
  @logins
end

#parallelString

Indicates whether the instance is mounted in cluster database mode (YES) or not (NO).

Returns:

  • (String)


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

def parallel
  @parallel
end

#startup_timeDateTime

Start up time of the database instance.

Returns:

  • (DateTime)


58
59
60
# File 'lib/oci/opsi/models/db_external_instance.rb', line 58

def startup_time
  @startup_time
end

#statusString

Status of the instance.

Returns:

  • (String)


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

def status
  @status
end

#versionString

Database version.

Returns:

  • (String)


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

def version
  @version
end

Class Method Details

.attribute_mapObject

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



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/oci/opsi/models/db_external_instance.rb', line 61

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'metric_name': :'metricName',
    'time_collected': :'timeCollected',
    'instance_name': :'instanceName',
    'host_name': :'hostName',
    'cpu_count': :'cpuCount',
    'host_memory_capacity': :'hostMemoryCapacity',
    'version': :'version',
    'parallel': :'parallel',
    'instance_role': :'instanceRole',
    'logins': :'logins',
    'database_status': :'databaseStatus',
    'status': :'status',
    'edition': :'edition',
    'startup_time': :'startupTime'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'metric_name': :'String',
    'time_collected': :'DateTime',
    'instance_name': :'String',
    'host_name': :'String',
    'cpu_count': :'Integer',
    'host_memory_capacity': :'Float',
    'version': :'String',
    'parallel': :'String',
    'instance_role': :'String',
    'logins': :'String',
    'database_status': :'String',
    'status': :'String',
    'edition': :'String',
    'startup_time': :'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



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# File 'lib/oci/opsi/models/db_external_instance.rb', line 193

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

  self.class == other.class &&
    metric_name == other.metric_name &&
    time_collected == other.time_collected &&
    instance_name == other.instance_name &&
    host_name == other.host_name &&
    cpu_count == other.cpu_count &&
    host_memory_capacity == other.host_memory_capacity &&
    version == other.version &&
    parallel == other.parallel &&
    instance_role == other.instance_role &&
    logins == other.logins &&
    database_status == other.database_status &&
    status == other.status &&
    edition == other.edition &&
    startup_time == other.startup_time
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



236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# File 'lib/oci/opsi/models/db_external_instance.rb', line 236

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


216
217
218
# File 'lib/oci/opsi/models/db_external_instance.rb', line 216

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



225
226
227
# File 'lib/oci/opsi/models/db_external_instance.rb', line 225

def hash
  [metric_name, time_collected, instance_name, host_name, cpu_count, host_memory_capacity, version, parallel, instance_role, logins, database_status, status, edition, startup_time].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



269
270
271
272
273
274
275
276
277
278
# File 'lib/oci/opsi/models/db_external_instance.rb', line 269

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



263
264
265
# File 'lib/oci/opsi/models/db_external_instance.rb', line 263

def to_s
  to_hash.to_s
end