Class: OCI::ManagementAgent::Models::CreatePrometheusEmitterDataSourceDetails

Inherits:
CreateDataSourceDetails show all
Defined in:
lib/oci/management_agent/models/create_prometheus_emitter_data_source_details.rb

Overview

A Prometheus emitter data source.

Constant Summary

Constants inherited from CreateDataSourceDetails

OCI::ManagementAgent::Models::CreateDataSourceDetails::TYPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from CreateDataSourceDetails

#compartment_id, #name, #type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CreateDataSourceDetails

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ CreatePrometheusEmitterDataSourceDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
167
168
169
170
171
172
173
174
175
176
# File 'lib/oci/management_agent/models/create_prometheus_emitter_data_source_details.rb', line 113

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

  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)


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

def allow_metrics
  @allow_metrics
end

#connection_timeoutInteger

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

Returns:

  • (Integer)


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

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.



51
52
53
# File 'lib/oci/management_agent/models/create_prometheus_emitter_data_source_details.rb', line 51

def metric_dimensions
  @metric_dimensions
end

#namespaceString

[Required] The OCI monitoring namespace to which scraped metrics should be uploaded.

Returns:

  • (String)


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

def namespace
  @namespace
end

#proxy_urlString

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

Returns:

  • (String)


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

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)


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

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)


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

def read_timeout
  @read_timeout
end

#resource_groupString

OCI monitoring resource group to assign the metric to.

Returns:

  • (String)


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

def resource_group
  @resource_group
end

#schedule_minsInteger

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

Returns:

  • (Integer)


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

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/create_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.



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

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'type',
    'name': :'name',
    'compartment_id': :'compartmentId',
    'url': :'url',
    'namespace': :'namespace',
    '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.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/oci/management_agent/models/create_prometheus_emitter_data_source_details.rb', line 75

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'String',
    'name': :'String',
    'compartment_id': :'String',
    'url': :'String',
    'namespace': :'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



185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# File 'lib/oci/management_agent/models/create_prometheus_emitter_data_source_details.rb', line 185

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

  self.class == other.class &&
    type == other.type &&
    name == other.name &&
    compartment_id == other.compartment_id &&
    url == other.url &&
    namespace == other.namespace &&
    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



227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# File 'lib/oci/management_agent/models/create_prometheus_emitter_data_source_details.rb', line 227

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


207
208
209
# File 'lib/oci/management_agent/models/create_prometheus_emitter_data_source_details.rb', line 207

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



216
217
218
# File 'lib/oci/management_agent/models/create_prometheus_emitter_data_source_details.rb', line 216

def hash
  [type, name, compartment_id, url, namespace, 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



260
261
262
263
264
265
266
267
268
269
# File 'lib/oci/management_agent/models/create_prometheus_emitter_data_source_details.rb', line 260

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



254
255
256
# File 'lib/oci/management_agent/models/create_prometheus_emitter_data_source_details.rb', line 254

def to_s
  to_hash.to_s
end