Class: OCI::StackMonitoring::Models::JmxUpdateQueryProperties

Inherits:
MetricExtensionUpdateQueryProperties show all
Defined in:
lib/oci/stack_monitoring/models/jmx_update_query_properties.rb

Overview

Query Properties applicable to JMX type of collection method

Constant Summary

Constants inherited from MetricExtensionUpdateQueryProperties

MetricExtensionUpdateQueryProperties::COLLECTION_METHOD_ENUM

Instance Attribute Summary collapse

Attributes inherited from MetricExtensionUpdateQueryProperties

#collection_method

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from MetricExtensionUpdateQueryProperties

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ JmxUpdateQueryProperties

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/oci/stack_monitoring/models/jmx_update_query_properties.rb', line 71

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

  attributes['collectionMethod'] = 'JMX'

  super(attributes)

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

  self.managed_bean_query = attributes[:'managedBeanQuery'] if attributes[:'managedBeanQuery']

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

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

  self.jmx_attributes = attributes[:'jmxAttributes'] if attributes[:'jmxAttributes']

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

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

  self.identity_metric = attributes[:'identityMetric'] if attributes[:'identityMetric']

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

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

  self.auto_row_prefix = attributes[:'autoRowPrefix'] if attributes[:'autoRowPrefix']

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

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

  self.is_metric_service_enabled = attributes[:'isMetricServiceEnabled'] unless attributes[:'isMetricServiceEnabled'].nil?
  self.is_metric_service_enabled = false if is_metric_service_enabled.nil? && !attributes.key?(:'isMetricServiceEnabled') # rubocop:disable Style/StringLiterals

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

  self.is_metric_service_enabled = attributes[:'is_metric_service_enabled'] unless attributes[:'is_metric_service_enabled'].nil?
  self.is_metric_service_enabled = false if is_metric_service_enabled.nil? && !attributes.key?(:'isMetricServiceEnabled') && !attributes.key?(:'is_metric_service_enabled') # rubocop:disable Style/StringLiterals
end

Instance Attribute Details

#auto_row_prefixString

Prefix for an auto generated metric, in case multiple rows with non unique key values are returned

Returns:

  • (String)


26
27
28
# File 'lib/oci/stack_monitoring/models/jmx_update_query_properties.rb', line 26

def auto_row_prefix
  @auto_row_prefix
end

#identity_metricString

Semi-colon separated list of key properties from Managed Bean ObjectName to be used as key metrics

Returns:

  • (String)


22
23
24
# File 'lib/oci/stack_monitoring/models/jmx_update_query_properties.rb', line 22

def identity_metric
  @identity_metric
end

#is_metric_service_enabledBOOLEAN

Indicates if Metric Service is enabled on server domain

Returns:

  • (BOOLEAN)


30
31
32
# File 'lib/oci/stack_monitoring/models/jmx_update_query_properties.rb', line 30

def is_metric_service_enabled
  @is_metric_service_enabled
end

#jmx_attributesString

List of JMX attributes or Metric Service Table columns separated by semi-colon

Returns:

  • (String)


18
19
20
# File 'lib/oci/stack_monitoring/models/jmx_update_query_properties.rb', line 18

def jmx_attributes
  @jmx_attributes
end

#managed_bean_queryString

JMX Managed Bean Query or Metric Service Table name

Returns:

  • (String)


14
15
16
# File 'lib/oci/stack_monitoring/models/jmx_update_query_properties.rb', line 14

def managed_bean_query
  @managed_bean_query
end

Class Method Details

.attribute_mapObject

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



33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/oci/stack_monitoring/models/jmx_update_query_properties.rb', line 33

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'collection_method': :'collectionMethod',
    'managed_bean_query': :'managedBeanQuery',
    'jmx_attributes': :'jmxAttributes',
    'identity_metric': :'identityMetric',
    'auto_row_prefix': :'autoRowPrefix',
    'is_metric_service_enabled': :'isMetricServiceEnabled'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/oci/stack_monitoring/models/jmx_update_query_properties.rb', line 47

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'collection_method': :'String',
    'managed_bean_query': :'String',
    'jmx_attributes': :'String',
    'identity_metric': :'String',
    'auto_row_prefix': :'String',
    'is_metric_service_enabled': :'BOOLEAN'
    # 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



121
122
123
124
125
126
127
128
129
130
131
# File 'lib/oci/stack_monitoring/models/jmx_update_query_properties.rb', line 121

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

  self.class == other.class &&
    collection_method == other.collection_method &&
    managed_bean_query == other.managed_bean_query &&
    jmx_attributes == other.jmx_attributes &&
    identity_metric == other.identity_metric &&
    auto_row_prefix == other.auto_row_prefix &&
    is_metric_service_enabled == other.is_metric_service_enabled
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



156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# File 'lib/oci/stack_monitoring/models/jmx_update_query_properties.rb', line 156

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


136
137
138
# File 'lib/oci/stack_monitoring/models/jmx_update_query_properties.rb', line 136

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



145
146
147
# File 'lib/oci/stack_monitoring/models/jmx_update_query_properties.rb', line 145

def hash
  [collection_method, managed_bean_query, jmx_attributes, identity_metric, auto_row_prefix, is_metric_service_enabled].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



189
190
191
192
193
194
195
196
197
198
# File 'lib/oci/stack_monitoring/models/jmx_update_query_properties.rb', line 189

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



183
184
185
# File 'lib/oci/stack_monitoring/models/jmx_update_query_properties.rb', line 183

def to_s
  to_hash.to_s
end