Class: OCI::StackMonitoring::Models::ImportOciTelemetryResourcesTaskDetails

Inherits:
MonitoredResourceTaskDetails show all
Defined in:
lib/oci/stack_monitoring/models/import_oci_telemetry_resources_task_details.rb

Overview

Request details for importing resources from Telemetry like resources from OCI Native Services and prometheus.

Constant Summary collapse

SOURCE_ENUM =
[
  SOURCE_OCI_TELEMETRY_NATIVE = 'OCI_TELEMETRY_NATIVE'.freeze,
  SOURCE_OCI_TELEMETRY_PROMETHEUS = 'OCI_TELEMETRY_PROMETHEUS'.freeze,
  SOURCE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Constants inherited from MonitoredResourceTaskDetails

MonitoredResourceTaskDetails::TYPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from MonitoredResourceTaskDetails

#type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from MonitoredResourceTaskDetails

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ ImportOciTelemetryResourcesTaskDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# File 'lib/oci/stack_monitoring/models/import_oci_telemetry_resources_task_details.rb', line 175

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

  attributes['type'] = 'IMPORT_OCI_TELEMETRY_RESOURCES'

  super(attributes)

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

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

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

  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.should_use_metrics_flow_for_status = attributes[:'shouldUseMetricsFlowForStatus'] unless attributes[:'shouldUseMetricsFlowForStatus'].nil?
  self.should_use_metrics_flow_for_status = false if should_use_metrics_flow_for_status.nil? && !attributes.key?(:'shouldUseMetricsFlowForStatus') # rubocop:disable Style/StringLiterals

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

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

  self.service_base_url = attributes[:'serviceBaseUrl'] if attributes[:'serviceBaseUrl']

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

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

  self.console_path_prefix = attributes[:'consolePathPrefix'] if attributes[:'consolePathPrefix']

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

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

  self.lifecycle_status_mappings_for_up_status = attributes[:'lifecycleStatusMappingsForUpStatus'] if attributes[:'lifecycleStatusMappingsForUpStatus']

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

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

  self.resource_name_mapping = attributes[:'resourceNameMapping'] if attributes[:'resourceNameMapping']
  self.resource_name_mapping = "resourceName" if resource_name_mapping.nil? && !attributes.key?(:'resourceNameMapping') # rubocop:disable Style/StringLiterals

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

  self.resource_name_mapping = attributes[:'resource_name_mapping'] if attributes[:'resource_name_mapping']
  self.resource_name_mapping = "resourceName" if resource_name_mapping.nil? && !attributes.key?(:'resourceNameMapping') && !attributes.key?(:'resource_name_mapping') # rubocop:disable Style/StringLiterals

  self.external_id_mapping = attributes[:'externalIdMapping'] if attributes[:'externalIdMapping']
  self.external_id_mapping = "resourceId" if external_id_mapping.nil? && !attributes.key?(:'externalIdMapping') # rubocop:disable Style/StringLiterals

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

  self.external_id_mapping = attributes[:'external_id_mapping'] if attributes[:'external_id_mapping']
  self.external_id_mapping = "resourceId" if external_id_mapping.nil? && !attributes.key?(:'externalIdMapping') && !attributes.key?(:'external_id_mapping') # rubocop:disable Style/StringLiterals

  self.resource_type_mapping = attributes[:'resourceTypeMapping'] if attributes[:'resourceTypeMapping']

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

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

  self.resource_name_filter = attributes[:'resourceNameFilter'] if attributes[:'resourceNameFilter']

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

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

  self.resource_type_filter = attributes[:'resourceTypeFilter'] if attributes[:'resourceTypeFilter']

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

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

  self.availability_proxy_metrics = attributes[:'availabilityProxyMetrics'] if attributes[:'availabilityProxyMetrics']

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

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

  self.availability_proxy_metric_collection_interval = attributes[:'availabilityProxyMetricCollectionInterval'] if attributes[:'availabilityProxyMetricCollectionInterval']

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

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

Instance Attribute Details

#availability_proxy_metric_collection_intervalInteger

Metrics collection interval in seconds used when calculating the availability of the resource based on metrics specified using the property 'availabilityProxyMetrics'.

Returns:

  • (Integer)


107
108
109
# File 'lib/oci/stack_monitoring/models/import_oci_telemetry_resources_task_details.rb', line 107

def availability_proxy_metric_collection_interval
  @availability_proxy_metric_collection_interval
end

#availability_proxy_metricsArray<String>

List of metrics to be used to calculate the availability of the resource. Resource is considered to be up if at least one of the specified metrics is available for the resource during the specified interval using the property 'availabilityProxyMetricCollectionIntervalInSeconds'. If no metrics are specified, availability will not be calculated for the resource.

Returns:

  • (Array<String>)


101
102
103
# File 'lib/oci/stack_monitoring/models/import_oci_telemetry_resources_task_details.rb', line 101

def availability_proxy_metrics
  @availability_proxy_metrics
end

#console_path_prefixString

The console path prefix to use for providing service home url page navigation. For example if the prefix provided is 'security/bastion/bastions', the URL used for navigation will be /security/bastion/bastions/>. If not provided, service home page link will not be shown in the stack monitoring home page.

Returns:

  • (String)


56
57
58
# File 'lib/oci/stack_monitoring/models/import_oci_telemetry_resources_task_details.rb', line 56

def console_path_prefix
  @console_path_prefix
end

#external_id_mappingString

The external resource identifier property in the metric dimensions. Resources imported will be using this property value for external id.

Returns:

  • (String)


73
74
75
# File 'lib/oci/stack_monitoring/models/import_oci_telemetry_resources_task_details.rb', line 73

def external_id_mapping
  @external_id_mapping
end

#lifecycle_status_mappings_for_up_statusArray<String>

Lifecycle states of the external resource which reflects the status of the resource being up.

Returns:

  • (Array<String>)


61
62
63
# File 'lib/oci/stack_monitoring/models/import_oci_telemetry_resources_task_details.rb', line 61

def lifecycle_status_mappings_for_up_status
  @lifecycle_status_mappings_for_up_status
end

#namespaceString

[Required] Name space to be used for OCI Native service resources discovery.

Returns:

  • (String)


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

def namespace
  @namespace
end

#resource_groupString

The resource group to use while fetching metrics from telemetry. If not specified, resource group will be skipped in the list metrics request.

Returns:

  • (String)


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

def resource_group
  @resource_group
end

#resource_name_filterString

The resource name filter. Resources matching with the resource name filter will be imported. Regular expressions will be accepted.

Returns:

  • (String)


86
87
88
# File 'lib/oci/stack_monitoring/models/import_oci_telemetry_resources_task_details.rb', line 86

def resource_name_filter
  @resource_name_filter
end

#resource_name_mappingString

The resource name property in the metric dimensions. Resources imported will be using this property value for resource name.

Returns:

  • (String)


67
68
69
# File 'lib/oci/stack_monitoring/models/import_oci_telemetry_resources_task_details.rb', line 67

def resource_name_mapping
  @resource_name_mapping
end

#resource_type_filterString

The resource type filter. Resources matching with the resource type filter will be imported. Regular expressions will be accepted.

Returns:

  • (String)


92
93
94
# File 'lib/oci/stack_monitoring/models/import_oci_telemetry_resources_task_details.rb', line 92

def resource_type_filter
  @resource_type_filter
end

#resource_type_mappingString

The resource type property in the metric dimensions. Resources imported will be using this property value for resource type. If not specified, namespace will be used for resource type.

Returns:

  • (String)


80
81
82
# File 'lib/oci/stack_monitoring/models/import_oci_telemetry_resources_task_details.rb', line 80

def resource_type_mapping
  @resource_type_mapping
end

#service_base_urlString

The base URL of the OCI service to which the resource belongs to. Also this property is applicable only when source is OCI_TELEMETRY_NATIVE.

Returns:

  • (String)


48
49
50
# File 'lib/oci/stack_monitoring/models/import_oci_telemetry_resources_task_details.rb', line 48

def service_base_url
  @service_base_url
end

#should_use_metrics_flow_for_statusBOOLEAN

Flag to indicate whether status is calculated using metrics or LifeCycleState attribute of the resource in OCI service.

Returns:

  • (BOOLEAN)


42
43
44
# File 'lib/oci/stack_monitoring/models/import_oci_telemetry_resources_task_details.rb', line 42

def should_use_metrics_flow_for_status
  @should_use_metrics_flow_for_status
end

#sourceString

[Required] Source from where the metrics pushed to telemetry. Possible values: * OCI_TELEMETRY_NATIVE - The metrics are pushed to telemetry from OCI Native Services. * OCI_TELEMETRY_PROMETHEUS - The metrics are pushed to telemetry from Prometheus.

Returns:

  • (String)


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

def source
  @source
end

Class Method Details

.attribute_mapObject

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



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/oci/stack_monitoring/models/import_oci_telemetry_resources_task_details.rb', line 110

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'type',
    'source': :'source',
    'namespace': :'namespace',
    'resource_group': :'resourceGroup',
    'should_use_metrics_flow_for_status': :'shouldUseMetricsFlowForStatus',
    'service_base_url': :'serviceBaseUrl',
    'console_path_prefix': :'consolePathPrefix',
    'lifecycle_status_mappings_for_up_status': :'lifecycleStatusMappingsForUpStatus',
    'resource_name_mapping': :'resourceNameMapping',
    'external_id_mapping': :'externalIdMapping',
    'resource_type_mapping': :'resourceTypeMapping',
    'resource_name_filter': :'resourceNameFilter',
    'resource_type_filter': :'resourceTypeFilter',
    'availability_proxy_metrics': :'availabilityProxyMetrics',
    'availability_proxy_metric_collection_interval': :'availabilityProxyMetricCollectionInterval'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'String',
    'source': :'String',
    'namespace': :'String',
    'resource_group': :'String',
    'should_use_metrics_flow_for_status': :'BOOLEAN',
    'service_base_url': :'String',
    'console_path_prefix': :'String',
    'lifecycle_status_mappings_for_up_status': :'Array<String>',
    'resource_name_mapping': :'String',
    'external_id_mapping': :'String',
    'resource_type_mapping': :'String',
    'resource_name_filter': :'String',
    'resource_type_filter': :'String',
    'availability_proxy_metrics': :'Array<String>',
    'availability_proxy_metric_collection_interval': :'Integer'
    # 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



288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
# File 'lib/oci/stack_monitoring/models/import_oci_telemetry_resources_task_details.rb', line 288

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

  self.class == other.class &&
    type == other.type &&
    source == other.source &&
    namespace == other.namespace &&
    resource_group == other.resource_group &&
    should_use_metrics_flow_for_status == other.should_use_metrics_flow_for_status &&
    service_base_url == other.service_base_url &&
    console_path_prefix == other.console_path_prefix &&
    lifecycle_status_mappings_for_up_status == other.lifecycle_status_mappings_for_up_status &&
    resource_name_mapping == other.resource_name_mapping &&
    external_id_mapping == other.external_id_mapping &&
    resource_type_mapping == other.resource_type_mapping &&
    resource_name_filter == other.resource_name_filter &&
    resource_type_filter == other.resource_type_filter &&
    availability_proxy_metrics == other.availability_proxy_metrics &&
    availability_proxy_metric_collection_interval == other.availability_proxy_metric_collection_interval
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



332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
# File 'lib/oci/stack_monitoring/models/import_oci_telemetry_resources_task_details.rb', line 332

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


312
313
314
# File 'lib/oci/stack_monitoring/models/import_oci_telemetry_resources_task_details.rb', line 312

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



321
322
323
# File 'lib/oci/stack_monitoring/models/import_oci_telemetry_resources_task_details.rb', line 321

def hash
  [type, source, namespace, resource_group, should_use_metrics_flow_for_status, service_base_url, console_path_prefix, lifecycle_status_mappings_for_up_status, resource_name_mapping, external_id_mapping, resource_type_mapping, resource_name_filter, resource_type_filter, availability_proxy_metrics, availability_proxy_metric_collection_interval].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



365
366
367
368
369
370
371
372
373
374
# File 'lib/oci/stack_monitoring/models/import_oci_telemetry_resources_task_details.rb', line 365

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



359
360
361
# File 'lib/oci/stack_monitoring/models/import_oci_telemetry_resources_task_details.rb', line 359

def to_s
  to_hash.to_s
end