Class: OCI::Opsi::Models::ExadataAsmEntity

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

Overview

ASM entitie for an exadata

Constant Summary

Constants inherited from DatabaseConfigurationMetricGroup

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

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

  • :cluster_name (String)

    The value to assign to the #cluster_name property

  • :software_version (String)

    The value to assign to the #software_version property



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/oci/opsi/models/exadata_asm_entity.rb', line 61

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

  attributes['metricName'] = 'ASM_ENTITY'

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

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

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

  self.software_version = attributes[:'softwareVersion'] if attributes[:'softwareVersion']

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

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

Instance Attribute Details

#cluster_nameString

Cluster name of ASM

Returns:

  • (String)


19
20
21
# File 'lib/oci/opsi/models/exadata_asm_entity.rb', line 19

def cluster_name
  @cluster_name
end

#instance_nameString

Instance name of ASM

Returns:

  • (String)


15
16
17
# File 'lib/oci/opsi/models/exadata_asm_entity.rb', line 15

def instance_name
  @instance_name
end

#software_versionString

Software version

Returns:

  • (String)


23
24
25
# File 'lib/oci/opsi/models/exadata_asm_entity.rb', line 23

def software_version
  @software_version
end

Class Method Details

.attribute_mapObject

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



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/oci/opsi/models/exadata_asm_entity.rb', line 26

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'metric_name': :'metricName',
    'time_collected': :'timeCollected',
    'instance_name': :'instanceName',
    'cluster_name': :'clusterName',
    'software_version': :'softwareVersion'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



39
40
41
42
43
44
45
46
47
48
49
# File 'lib/oci/opsi/models/exadata_asm_entity.rb', line 39

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'metric_name': :'String',
    'time_collected': :'DateTime',
    'instance_name': :'String',
    'cluster_name': :'String',
    'software_version': :'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



97
98
99
100
101
102
103
104
105
106
# File 'lib/oci/opsi/models/exadata_asm_entity.rb', line 97

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 &&
    cluster_name == other.cluster_name &&
    software_version == other.software_version
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



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/oci/opsi/models/exadata_asm_entity.rb', line 131

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


111
112
113
# File 'lib/oci/opsi/models/exadata_asm_entity.rb', line 111

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



120
121
122
# File 'lib/oci/opsi/models/exadata_asm_entity.rb', line 120

def hash
  [metric_name, time_collected, instance_name, cluster_name, software_version].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



164
165
166
167
168
169
170
171
172
173
# File 'lib/oci/opsi/models/exadata_asm_entity.rb', line 164

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



158
159
160
# File 'lib/oci/opsi/models/exadata_asm_entity.rb', line 158

def to_s
  to_hash.to_s
end