Class: OCI::ManagementAgent::Models::UpdatePrometheusEmitterDataSourceDetails

Inherits:
UpdateDataSourceDetails show all
Defined in:
lib/oci/management_agent/models/update_prometheus_emitter_data_source_details.rb

Overview

A Prometheus data source.

Constant Summary

Constants inherited from UpdateDataSourceDetails

OCI::ManagementAgent::Models::UpdateDataSourceDetails::TYPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from UpdateDataSourceDetails

#type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from UpdateDataSourceDetails

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ UpdatePrometheusEmitterDataSourceDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



100
101
102
103
104
105
106
107
108
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
# File 'lib/oci/management_agent/models/update_prometheus_emitter_data_source_details.rb', line 100

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

  attributes['type'] = 'PROMETHEUS_EMITTER'

  super(attributes)

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

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

  self.allow_metrics = attributes[:'allowMetrics'] if attributes[:'allowMetrics']
  self.allow_metrics = "*" if allow_metrics.nil? && !attributes.key?(:'allowMetrics') # rubocop:disable Style/StringLiterals

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

  self.allow_metrics = attributes[:'allow_metrics'] if attributes[:'allow_metrics']
  self.allow_metrics = "*" if allow_metrics.nil? && !attributes.key?(:'allowMetrics') && !attributes.key?(:'allow_metrics') # rubocop:disable Style/StringLiterals

  self.proxy_url = attributes[:'proxyUrl'] if attributes[:'proxyUrl']

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

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

  self.connection_timeout = attributes[:'connectionTimeout'] if attributes[:'connectionTimeout']

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

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

  self.read_timeout = attributes[:'readTimeout'] if attributes[:'readTimeout']

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

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

  self.read_data_limit_in_kilobytes = attributes[:'readDataLimitInKilobytes'] if attributes[:'readDataLimitInKilobytes']

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

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

  self.schedule_mins = attributes[:'scheduleMins'] if attributes[:'scheduleMins']

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

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

  self.resource_group = attributes[:'resourceGroup'] if attributes[:'resourceGroup']

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

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

  self.metric_dimensions = attributes[:'metricDimensions'] if attributes[:'metricDimensions']

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

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

Instance Attribute Details

#allow_metricsString

Comma separated metric name list. The complete set of desired scraped metrics. Use this property to limit the set of metrics uploaded if required.

Returns:

  • (String)


19
20
21
# File 'lib/oci/management_agent/models/update_prometheus_emitter_data_source_details.rb', line 19

def allow_metrics
  @allow_metrics
end

#connection_timeoutInteger

Number in milliseconds. The timeout for connecting to the Prometheus Exporter's endpoint.

Returns:

  • (Integer)


27
28
29
# File 'lib/oci/management_agent/models/update_prometheus_emitter_data_source_details.rb', line 27

def connection_timeout
  @connection_timeout
end

#metric_dimensionsArray<OCI::ManagementAgent::Models::MetricDimension>

The names of other user-supplied properties expressed as fixed values to be used as dimensions for every uploaded datapoint.



47
48
49
# File 'lib/oci/management_agent/models/update_prometheus_emitter_data_source_details.rb', line 47

def metric_dimensions
  @metric_dimensions
end

#proxy_urlString

The url of the network proxy that provides access to the Prometheus Exporter's endpoint (url required property).

Returns:

  • (String)


23
24
25
# File 'lib/oci/management_agent/models/update_prometheus_emitter_data_source_details.rb', line 23

def proxy_url
  @proxy_url
end

#read_data_limit_in_kilobytesInteger

Number in kilobytes. The limit on the data being sent, not to exceed the agent's fixed limit of 400 (KB).

Returns:

  • (Integer)


35
36
37
# File 'lib/oci/management_agent/models/update_prometheus_emitter_data_source_details.rb', line 35

def read_data_limit_in_kilobytes
  @read_data_limit_in_kilobytes
end

#read_timeoutInteger

Number in milliseconds. The timeout for reading the response from the Prometheus Exporter's endpoint.

Returns:

  • (Integer)


31
32
33
# File 'lib/oci/management_agent/models/update_prometheus_emitter_data_source_details.rb', line 31

def read_timeout
  @read_timeout
end

#resource_groupString

OCI monitoring resource group to assign the metric to.

Returns:

  • (String)


43
44
45
# File 'lib/oci/management_agent/models/update_prometheus_emitter_data_source_details.rb', line 43

def resource_group
  @resource_group
end

#schedule_minsInteger

Number in minutes. The scraping occurs at the specified interval.

Returns:

  • (Integer)


39
40
41
# File 'lib/oci/management_agent/models/update_prometheus_emitter_data_source_details.rb', line 39

def schedule_mins
  @schedule_mins
end

#urlString

[Required] The url through which the Prometheus Exporter publishes its metrics. (http only)

Returns:

  • (String)


15
16
17
# File 'lib/oci/management_agent/models/update_prometheus_emitter_data_source_details.rb', line 15

def url
  @url
end

Class Method Details

.attribute_mapObject

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



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/oci/management_agent/models/update_prometheus_emitter_data_source_details.rb', line 50

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'type',
    'url': :'url',
    'allow_metrics': :'allowMetrics',
    'proxy_url': :'proxyUrl',
    'connection_timeout': :'connectionTimeout',
    'read_timeout': :'readTimeout',
    'read_data_limit_in_kilobytes': :'readDataLimitInKilobytes',
    'schedule_mins': :'scheduleMins',
    'resource_group': :'resourceGroup',
    'metric_dimensions': :'metricDimensions'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/oci/management_agent/models/update_prometheus_emitter_data_source_details.rb', line 68

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'String',
    'url': :'String',
    'allow_metrics': :'String',
    'proxy_url': :'String',
    'connection_timeout': :'Integer',
    'read_timeout': :'Integer',
    'read_data_limit_in_kilobytes': :'Integer',
    'schedule_mins': :'Integer',
    'resource_group': :'String',
    'metric_dimensions': :'Array<OCI::ManagementAgent::Models::MetricDimension>'
    # 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



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/oci/management_agent/models/update_prometheus_emitter_data_source_details.rb', line 170

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

  self.class == other.class &&
    type == other.type &&
    url == other.url &&
    allow_metrics == other.allow_metrics &&
    proxy_url == other.proxy_url &&
    connection_timeout == other.connection_timeout &&
    read_timeout == other.read_timeout &&
    read_data_limit_in_kilobytes == other.read_data_limit_in_kilobytes &&
    schedule_mins == other.schedule_mins &&
    resource_group == other.resource_group &&
    metric_dimensions == other.metric_dimensions
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



209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/oci/management_agent/models/update_prometheus_emitter_data_source_details.rb', line 209

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


189
190
191
# File 'lib/oci/management_agent/models/update_prometheus_emitter_data_source_details.rb', line 189

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



198
199
200
# File 'lib/oci/management_agent/models/update_prometheus_emitter_data_source_details.rb', line 198

def hash
  [type, url, allow_metrics, proxy_url, connection_timeout, read_timeout, read_data_limit_in_kilobytes, schedule_mins, resource_group, metric_dimensions].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



242
243
244
245
246
247
248
249
250
251
# File 'lib/oci/management_agent/models/update_prometheus_emitter_data_source_details.rb', line 242

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



236
237
238
# File 'lib/oci/management_agent/models/update_prometheus_emitter_data_source_details.rb', line 236

def to_s
  to_hash.to_s
end