Class: OCI::StackMonitoring::Models::AgentExtensionHandlerConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/stack_monitoring/models/agent_extension_handler_configuration.rb

Overview

Specific resource mapping configurations for Agent Extension Handlers.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AgentExtensionHandlerConfiguration

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
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
# File 'lib/oci/stack_monitoring/models/agent_extension_handler_configuration.rb', line 88

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

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

  self.collector_types = attributes[:'collectorTypes'] if attributes[:'collectorTypes']

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

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

  self.metric_upload_interval_in_seconds = attributes[:'metricUploadIntervalInSeconds'] if attributes[:'metricUploadIntervalInSeconds']

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

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

  self.telemetry_resource_group = attributes[:'telemetryResourceGroup'] if attributes[:'telemetryResourceGroup']

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

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

  self.telegraf_resource_name_config = attributes[:'telegrafResourceNameConfig'] if attributes[:'telegrafResourceNameConfig']

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

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

  self.collectd_resource_name_config = attributes[:'collectdResourceNameConfig'] if attributes[:'collectdResourceNameConfig']

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

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

  self.metric_name_config = attributes[:'metricNameConfig'] if attributes[:'metricNameConfig']

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

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

  self.metric_mappings = attributes[:'metricMappings'] if attributes[:'metricMappings']

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

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

  self.handler_properties = attributes[:'handlerProperties'] if attributes[:'handlerProperties']

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

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

Instance Attribute Details

#collectd_resource_name_configOCI::StackMonitoring::Models::CollectdResourceNameConfigurationDetails



29
30
31
# File 'lib/oci/stack_monitoring/models/agent_extension_handler_configuration.rb', line 29

def collectd_resource_name_config
  @collectd_resource_name_config
end

#collector_typesArray<String>

[Required] List of collector/plugin names.

Returns:

  • (Array<String>)


13
14
15
# File 'lib/oci/stack_monitoring/models/agent_extension_handler_configuration.rb', line 13

def collector_types
  @collector_types
end

#handler_propertiesArray<OCI::StackMonitoring::Models::AgentExtensionHandlerConfigurationProperty>

List of handler configuration properties



40
41
42
# File 'lib/oci/stack_monitoring/models/agent_extension_handler_configuration.rb', line 40

def handler_properties
  @handler_properties
end

#metric_mappingsArray<OCI::StackMonitoring::Models::AgentExtensionHandlerMetricMappingDetails>

List of AgentExtensionHandlerMetricMappingDetails.



36
37
38
# File 'lib/oci/stack_monitoring/models/agent_extension_handler_configuration.rb', line 36

def metric_mappings
  @metric_mappings
end

#metric_name_configOCI::StackMonitoring::Models::MetricNameConfigurationDetails



32
33
34
# File 'lib/oci/stack_monitoring/models/agent_extension_handler_configuration.rb', line 32

def metric_name_config
  @metric_name_config
end

#metric_upload_interval_in_secondsInteger

Metric upload interval in seconds. Any metric sent by telegraf/collectd before the configured interval expires will be dropped.

Returns:

  • (Integer)


19
20
21
# File 'lib/oci/stack_monitoring/models/agent_extension_handler_configuration.rb', line 19

def metric_upload_interval_in_seconds
  @metric_upload_interval_in_seconds
end

#telegraf_resource_name_configOCI::StackMonitoring::Models::TelegrafResourceNameConfigurationDetails



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

def telegraf_resource_name_config
  @telegraf_resource_name_config
end

#telemetry_resource_groupString

Resource group string; if not specified, the resource group string will be generated by the handler.

Returns:

  • (String)


23
24
25
# File 'lib/oci/stack_monitoring/models/agent_extension_handler_configuration.rb', line 23

def telemetry_resource_group
  @telemetry_resource_group
end

Class Method Details

.attribute_mapObject

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



43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/oci/stack_monitoring/models/agent_extension_handler_configuration.rb', line 43

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'collector_types': :'collectorTypes',
    'metric_upload_interval_in_seconds': :'metricUploadIntervalInSeconds',
    'telemetry_resource_group': :'telemetryResourceGroup',
    'telegraf_resource_name_config': :'telegrafResourceNameConfig',
    'collectd_resource_name_config': :'collectdResourceNameConfig',
    'metric_name_config': :'metricNameConfig',
    'metric_mappings': :'metricMappings',
    'handler_properties': :'handlerProperties'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/oci/stack_monitoring/models/agent_extension_handler_configuration.rb', line 59

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'collector_types': :'Array<String>',
    'metric_upload_interval_in_seconds': :'Integer',
    'telemetry_resource_group': :'String',
    'telegraf_resource_name_config': :'OCI::StackMonitoring::Models::TelegrafResourceNameConfigurationDetails',
    'collectd_resource_name_config': :'OCI::StackMonitoring::Models::CollectdResourceNameConfigurationDetails',
    'metric_name_config': :'OCI::StackMonitoring::Models::MetricNameConfigurationDetails',
    'metric_mappings': :'Array<OCI::StackMonitoring::Models::AgentExtensionHandlerMetricMappingDetails>',
    'handler_properties': :'Array<OCI::StackMonitoring::Models::AgentExtensionHandlerConfigurationProperty>'
    # 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



150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/oci/stack_monitoring/models/agent_extension_handler_configuration.rb', line 150

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

  self.class == other.class &&
    collector_types == other.collector_types &&
    metric_upload_interval_in_seconds == other.metric_upload_interval_in_seconds &&
    telemetry_resource_group == other.telemetry_resource_group &&
    telegraf_resource_name_config == other.telegraf_resource_name_config &&
    collectd_resource_name_config == other.collectd_resource_name_config &&
    metric_name_config == other.metric_name_config &&
    metric_mappings == other.metric_mappings &&
    handler_properties == other.handler_properties
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



187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/oci/stack_monitoring/models/agent_extension_handler_configuration.rb', line 187

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


167
168
169
# File 'lib/oci/stack_monitoring/models/agent_extension_handler_configuration.rb', line 167

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



176
177
178
# File 'lib/oci/stack_monitoring/models/agent_extension_handler_configuration.rb', line 176

def hash
  [collector_types, metric_upload_interval_in_seconds, telemetry_resource_group, telegraf_resource_name_config, collectd_resource_name_config, metric_name_config, metric_mappings, handler_properties].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



220
221
222
223
224
225
226
227
228
229
# File 'lib/oci/stack_monitoring/models/agent_extension_handler_configuration.rb', line 220

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



214
215
216
# File 'lib/oci/stack_monitoring/models/agent_extension_handler_configuration.rb', line 214

def to_s
  to_hash.to_s
end