Class: OCI::Monitoring::MonitoringClient

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/monitoring/monitoring_client.rb

Overview

Use the Monitoring API to manage metric queries and alarms for assessing the health, capacity, and performance of your cloud resources. Endpoints vary by operation. For PostMetricData, use the `telemetry-ingestion` endpoints; for all other operations, use the `telemetry` endpoints. For more information, see the Monitoring documentation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ MonitoringClient

Creates a new MonitoringClient. Notes: If a config is not specified, then the global OCI.config will be used.

This client is not thread-safe

Either a region or an endpoint must be specified. If an endpoint is specified, it will be used instead of the region. A region may be specified in the config or via or the region parameter. If specified in both, then the region parameter will be used.

Parameters:

  • config (Config) (defaults to: nil)

    A Config object.

  • region (String) (defaults to: nil)

    A region used to determine the service endpoint. This will usually correspond to a value in Regions::REGION_ENUM, but may be an arbitrary string.

  • endpoint (String) (defaults to: nil)

    The fully qualified endpoint URL

  • signer (OCI::BaseSigner) (defaults to: nil)

    A signer implementation which can be used by this client. If this is not provided then a signer will be constructed via the provided config. One use case of this parameter is instance principals authentication, so that the instance principals signer can be provided to the client

  • proxy_settings (OCI::ApiClientProxySettings) (defaults to: nil)

    If your environment requires you to use a proxy server for outgoing HTTP requests the details for the proxy can be provided in this parameter

  • retry_config (OCI::Retry::RetryConfig) (defaults to: nil)

    The retry configuration for this service client. This represents the default retry configuration to apply across all operations. This can be overridden on a per-operation basis. The default retry configuration value is nil, which means that an operation will not perform any retries



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/oci/monitoring/monitoring_client.rb', line 58

def initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil)
  # If the signer is an InstancePrincipalsSecurityTokenSigner or SecurityTokenSigner and no config was supplied (they are self-sufficient signers)
  # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals
  # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then
  # pass it to this constructor.
  #
  # If there is no signer (or the signer is not an instance principals signer) and no config was supplied, this is not valid
  # so try and load the config from the default file.
  config = OCI::Config.validate_and_build_config_with_signer(config, signer)

  signer = OCI::Signer.config_file_auth_builder(config) if signer.nil?

  @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings)
  @retry_config = retry_config

  if endpoint
    @endpoint = endpoint + '/20180401'
  else
    region ||= config.region
    region ||= signer.region if signer.respond_to?(:region)
    self.region = region
  end
  logger.info "MonitoringClient endpoint set to '#{@endpoint}'." if logger
end

Instance Attribute Details

#api_clientOCI::ApiClient (readonly)

Client used to make HTTP requests.

Returns:



18
19
20
# File 'lib/oci/monitoring/monitoring_client.rb', line 18

def api_client
  @api_client
end

#endpointString (readonly)

Fully qualified endpoint URL

Returns:

  • (String)


22
23
24
# File 'lib/oci/monitoring/monitoring_client.rb', line 22

def endpoint
  @endpoint
end

#regionString

The region, which will usually correspond to a value in Regions::REGION_ENUM.

Returns:

  • (String)


32
33
34
# File 'lib/oci/monitoring/monitoring_client.rb', line 32

def region
  @region
end

#retry_configOCI::Retry::RetryConfig (readonly)

The default retry configuration to apply to all operations in this service client. This can be overridden on a per-operation basis. The default retry configuration value is nil, which means that an operation will not perform any retries



28
29
30
# File 'lib/oci/monitoring/monitoring_client.rb', line 28

def retry_config
  @retry_config
end

Instance Method Details

#change_alarm_compartment(alarm_id, change_alarm_compartment_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use change_alarm_compartment API.

Moves an alarm into a different compartment within the same tenancy. For more information, see Moving an Alarm.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_request_id (String)

    Customer part of the request identifier token. If you need to contact Oracle about a particular request, please provide the complete request ID.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.

Returns:

  • (Response)

    A Response object with data of type nil



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
# File 'lib/oci/monitoring/monitoring_client.rb', line 131

def change_alarm_compartment(alarm_id, change_alarm_compartment_details, opts = {})
  logger.debug 'Calling operation MonitoringClient#change_alarm_compartment.' if logger

  raise "Missing the required parameter 'alarm_id' when calling change_alarm_compartment." if alarm_id.nil?
  raise "Missing the required parameter 'change_alarm_compartment_details' when calling change_alarm_compartment." if change_alarm_compartment_details.nil?
  raise "Parameter value for 'alarm_id' must not be blank" if OCI::Internal::Util.blank_string?(alarm_id)

  path = '/alarms/{alarmId}/actions/changeCompartment'.sub('{alarmId}', alarm_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(change_alarm_compartment_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#change_alarm_compartment') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#create_alarm(create_alarm_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use create_alarm API.

Creates a new alarm in the specified compartment. For more information, see Creating an Alarm. For important limits information, see Limits on Monitoring.

This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations. Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests, or transactions, per second (TPS) for a given tenancy.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Customer part of the request identifier token. If you need to contact Oracle about a particular request, please provide the complete request ID.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.

Returns:



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
# File 'lib/oci/monitoring/monitoring_client.rb', line 205

def create_alarm(create_alarm_details, opts = {})
  logger.debug 'Calling operation MonitoringClient#create_alarm.' if logger

  raise "Missing the required parameter 'create_alarm_details' when calling create_alarm." if create_alarm_details.nil?

  path = '/alarms'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(create_alarm_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#create_alarm') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Monitoring::Models::Alarm'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#create_alarm_suppression(create_alarm_suppression_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use create_alarm_suppression API.

Creates a new alarm suppression at the specified level (alarm-wide or dimension-specific). For more information, see Adding an Alarm-wide Suppression and Adding a Dimension-Specific Alarm Suppression.

For important limits information, see Limits on Monitoring.

This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations. Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests, or transactions, per second (TPS) for a given tenancy.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Customer part of the request identifier token. If you need to contact Oracle about a particular request, please provide the complete request ID.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.

Returns:



280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/oci/monitoring/monitoring_client.rb', line 280

def create_alarm_suppression(create_alarm_suppression_details, opts = {})
  logger.debug 'Calling operation MonitoringClient#create_alarm_suppression.' if logger

  raise "Missing the required parameter 'create_alarm_suppression_details' when calling create_alarm_suppression." if create_alarm_suppression_details.nil?

  path = '/alarmSuppressions'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(create_alarm_suppression_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#create_alarm_suppression') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Monitoring::Models::AlarmSuppression'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#delete_alarm(alarm_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use delete_alarm API.

Deletes the specified alarm. For more information, see Deleting an Alarm. For important limits information, see Limits on Monitoring.

This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations. Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests, or transactions, per second (TPS) for a given tenancy.

Parameters:

  • alarm_id (String)

    The OCID of an alarm.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_request_id (String)

    Customer part of the request identifier token. If you need to contact Oracle about a particular request, please provide the complete request ID.

Returns:

  • (Response)

    A Response object with data of type nil



351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
# File 'lib/oci/monitoring/monitoring_client.rb', line 351

def delete_alarm(alarm_id, opts = {})
  logger.debug 'Calling operation MonitoringClient#delete_alarm.' if logger

  raise "Missing the required parameter 'alarm_id' when calling delete_alarm." if alarm_id.nil?
  raise "Parameter value for 'alarm_id' must not be blank" if OCI::Internal::Util.blank_string?(alarm_id)

  path = '/alarms/{alarmId}'.sub('{alarmId}', alarm_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#delete_alarm') do
    @api_client.call_api(
      :DELETE,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#delete_alarm_suppression(alarm_suppression_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use delete_alarm_suppression API.

Deletes the specified alarm suppression. For more information, see Removing an Alarm-wide Suppression and Removing a Dimension-Specific Alarm Suppression.

For important limits information, see Limits on Monitoring.

This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations. Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests, or transactions, per second (TPS) for a given tenancy.

Parameters:

  • alarm_suppression_id (String)

    The OCID of the alarm suppression.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Customer part of the request identifier token. If you need to contact Oracle about a particular request, please provide the complete request ID.

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
# File 'lib/oci/monitoring/monitoring_client.rb', line 421

def delete_alarm_suppression(alarm_suppression_id, opts = {})
  logger.debug 'Calling operation MonitoringClient#delete_alarm_suppression.' if logger

  raise "Missing the required parameter 'alarm_suppression_id' when calling delete_alarm_suppression." if alarm_suppression_id.nil?
  raise "Parameter value for 'alarm_suppression_id' must not be blank" if OCI::Internal::Util.blank_string?(alarm_suppression_id)

  path = '/alarmSuppressions/{alarmSuppressionId}'.sub('{alarmSuppressionId}', alarm_suppression_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#delete_alarm_suppression') do
    @api_client.call_api(
      :DELETE,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_alarm(alarm_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use get_alarm API.

Gets the specified alarm. For more information, see Getting an Alarm. For important limits information, see Limits on Monitoring.

This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations. Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests, or transactions, per second (TPS) for a given tenancy.

Parameters:

  • alarm_id (String)

    The OCID of an alarm.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Customer part of the request identifier token. If you need to contact Oracle about a particular request, please provide the complete request ID.

Returns:



487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
# File 'lib/oci/monitoring/monitoring_client.rb', line 487

def get_alarm(alarm_id, opts = {})
  logger.debug 'Calling operation MonitoringClient#get_alarm.' if logger

  raise "Missing the required parameter 'alarm_id' when calling get_alarm." if alarm_id.nil?
  raise "Parameter value for 'alarm_id' must not be blank" if OCI::Internal::Util.blank_string?(alarm_id)

  path = '/alarms/{alarmId}'.sub('{alarmId}', alarm_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#get_alarm') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Monitoring::Models::Alarm'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_alarm_history(alarm_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use get_alarm_history API.

Get the history of the specified alarm. For more information, see Getting History of an Alarm. For important limits information, see Limits on Monitoring.

This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations. Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests, or transactions, per second (TPS) for a given tenancy.

Parameters:

  • alarm_id (String)

    The OCID of an alarm.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Customer part of the request identifier token. If you need to contact Oracle about a particular request, please provide the complete request ID.

  • :alarm_historytype (String)

    The type of history entries to retrieve. State history (STATE_HISTORY), state transition history (STATE_TRANSITION_HISTORY), rule history (RULE_HISTORY) or rule transition history (RULE_TRANSITION_HISTORY). If not specified, entries of all types are retrieved.

    Example: STATE_HISTORY

    Allowed values are: STATE_HISTORY, STATE_TRANSITION_HISTORY, RULE_HISTORY, RULE_TRANSITION_HISTORY

  • :page (String)

    For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

  • :limit (Integer)

    For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see List Pagination.

    Default: 1000

    Example: 500

  • :timestamp_greater_than_or_equal_to (DateTime)

    A filter to return only alarm history entries with timestamps occurring on or after the specified date and time. Format defined by RFC3339.

    Example: 2023-01-01T01:00:00.789Z

  • :timestamp_less_than (DateTime)

    A filter to return only alarm history entries with timestamps occurring before the specified date and time. Format defined by RFC3339.

    Example: 2023-01-02T01:00:00.789Z

Returns:



580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
# File 'lib/oci/monitoring/monitoring_client.rb', line 580

def get_alarm_history(alarm_id, opts = {})
  logger.debug 'Calling operation MonitoringClient#get_alarm_history.' if logger

  raise "Missing the required parameter 'alarm_id' when calling get_alarm_history." if alarm_id.nil?

  if opts[:alarm_historytype] && !%w[STATE_HISTORY STATE_TRANSITION_HISTORY RULE_HISTORY RULE_TRANSITION_HISTORY].include?(opts[:alarm_historytype])
    raise 'Invalid value for "alarm_historytype", must be one of STATE_HISTORY, STATE_TRANSITION_HISTORY, RULE_HISTORY, RULE_TRANSITION_HISTORY.'
  end
  raise "Parameter value for 'alarm_id' must not be blank" if OCI::Internal::Util.blank_string?(alarm_id)

  path = '/alarms/{alarmId}/history'.sub('{alarmId}', alarm_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:alarmHistorytype] = opts[:alarm_historytype] if opts[:alarm_historytype]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:timestampGreaterThanOrEqualTo] = opts[:timestamp_greater_than_or_equal_to] if opts[:timestamp_greater_than_or_equal_to]
  query_params[:timestampLessThan] = opts[:timestamp_less_than] if opts[:timestamp_less_than]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#get_alarm_history') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Monitoring::Models::AlarmHistoryCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_alarm_suppression(alarm_suppression_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use get_alarm_suppression API.

Gets the specified alarm suppression. For more information, see Getting an Alarm-wide Suppression.

For important limits information, see Limits on Monitoring.

This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations. Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests, or transactions, per second (TPS) for a given tenancy.

Parameters:

  • alarm_suppression_id (String)

    The OCID of the alarm suppression.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Customer part of the request identifier token. If you need to contact Oracle about a particular request, please provide the complete request ID.

Returns:



654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
# File 'lib/oci/monitoring/monitoring_client.rb', line 654

def get_alarm_suppression(alarm_suppression_id, opts = {})
  logger.debug 'Calling operation MonitoringClient#get_alarm_suppression.' if logger

  raise "Missing the required parameter 'alarm_suppression_id' when calling get_alarm_suppression." if alarm_suppression_id.nil?
  raise "Parameter value for 'alarm_suppression_id' must not be blank" if OCI::Internal::Util.blank_string?(alarm_suppression_id)

  path = '/alarmSuppressions/{alarmSuppressionId}'.sub('{alarmSuppressionId}', alarm_suppression_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#get_alarm_suppression') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Monitoring::Models::AlarmSuppression'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_alarm_suppressions(opts = {}) ⇒ Response

Note:

Click here to see an example of how to use list_alarm_suppressions API.

Lists alarm suppressions for the specified alarm. For more information, see Listing Alarm Suppressions.

For important limits information, see Limits on Monitoring.

This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations. Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests, or transactions, per second (TPS) for a given tenancy.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Customer part of the request identifier token. If you need to contact Oracle about a particular request, please provide the complete request ID.

  • :alarm_id (String)

    The OCID of the alarm that is the target of the alarm suppression.

  • :display_name (String)

    A filter to return only resources that match the given display name exactly. Use this filter to list an alarm suppression by name. Alternatively, when you know the alarm suppression OCID, use the GetAlarmSuppression operation.

  • :lifecycle_state (String)

    A filter to return only resources that match the given lifecycle state exactly. When not specified, only resources in the ACTIVE lifecycle state are listed.

  • :level (String)

    The level of this alarm suppression. ALARM indicates a suppression of the entire alarm, regardless of dimension. DIMENSION indicates a suppression configured for specified dimensions.

  • :compartment_id (String)

    The OCID of the compartment for searching. Use the tenancy OCID to search in the root compartment.

    If targetType is not specified, searches all suppressions defined under the compartment. If targetType is COMPARTMENT, searches suppressions in the specified compartment only.

    Example: ocid1.compartment.oc1..exampleuniqueID

  • :compartment_id_in_subtree (BOOLEAN)

    When true, returns resources from all compartments and subcompartments. The parameter can only be set to true when compartmentId is the tenancy OCID (the tenancy is the root compartment). A true value requires the user to have tenancy-level permissions. If this requirement is not met, then the call is rejected. When false, returns resources from only the compartment specified in compartmentId. Default is false.

  • :target_type (String)

    The target type to use when listing alarm suppressions. ALARM lists all suppression records for the specified alarm. COMPARTMENT lists all suppression records for the specified compartment or tenancy.

    Allowed values are: ALARM, COMPARTMENT

  • :is_all_suppressions (BOOLEAN)

    Setting this parameter to true requires the query to specify the alarm (alarmId).

    When true, lists all alarm suppressions that affect the specified alarm, including suppressions that target the corresponding compartment or tenancy. When false, lists only the alarm suppressions that target the specified alarm.

    Default is false.

  • :sort_by (String)

    The field to use when sorting returned alarm suppressions. Only one sorting level is provided.

    Example: timeCreated

    Allowed values are: displayName, timeCreated, timeSuppressFrom

  • :sort_order (String)

    The sort order to use when sorting returned alarm suppressions. Ascending (ASC) or descending (DESC).

    Example: ASC

    Allowed values are: ASC, DESC

  • :page (String)

    For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

  • :limit (Integer)

    For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see List Pagination.

    Default: 1000

    Example: 500

Returns:



778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
# File 'lib/oci/monitoring/monitoring_client.rb', line 778

def list_alarm_suppressions(opts = {})
  logger.debug 'Calling operation MonitoringClient#list_alarm_suppressions.' if logger


  if opts[:lifecycle_state] && !OCI::Monitoring::Models::AlarmSuppression::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state])
    raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Monitoring::Models::AlarmSuppression::LIFECYCLE_STATE_ENUM.'
  end

  if opts[:level] && !OCI::Monitoring::Models::AlarmSuppression::LEVEL_ENUM.include?(opts[:level])
    raise 'Invalid value for "level", must be one of the values in OCI::Monitoring::Models::AlarmSuppression::LEVEL_ENUM.'
  end

  if opts[:target_type] && !%w[ALARM COMPARTMENT].include?(opts[:target_type])
    raise 'Invalid value for "target_type", must be one of ALARM, COMPARTMENT.'
  end

  if opts[:sort_by] && !%w[displayName timeCreated timeSuppressFrom].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of displayName, timeCreated, timeSuppressFrom.'
  end

  if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
  end

  path = '/alarmSuppressions'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:alarmId] = opts[:alarm_id] if opts[:alarm_id]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  query_params[:level] = opts[:level] if opts[:level]
  query_params[:compartmentId] = opts[:compartment_id] if opts[:compartment_id]
  query_params[:compartmentIdInSubtree] = opts[:compartment_id_in_subtree] if !opts[:compartment_id_in_subtree].nil?
  query_params[:targetType] = opts[:target_type] if opts[:target_type]
  query_params[:isAllSuppressions] = opts[:is_all_suppressions] if !opts[:is_all_suppressions].nil?
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#list_alarm_suppressions') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Monitoring::Models::AlarmSuppressionCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_alarms(compartment_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use list_alarms API.

Lists the alarms for the specified compartment. For more information, see Listing Alarms. For important limits information, see Limits on Monitoring.

This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations. Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests, or transactions, per second (TPS) for a given tenancy.

Parameters:

  • compartment_id (String)

    The OCID of the compartment containing the resources monitored by the metric that you are searching for. Use tenancyId to search in the root compartment.

    Example: ocid1.compartment.oc1..exampleuniqueID

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Customer part of the request identifier token. If you need to contact Oracle about a particular request, please provide the complete request ID.

  • :page (String)

    For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

  • :limit (Integer)

    For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see List Pagination.

    Default: 1000

    Example: 500

  • :display_name (String)

    A filter to return only resources that match the given display name exactly. Use this filter to list an alarm by name. Alternatively, when you know the alarm OCID, use the GetAlarm operation.

  • :lifecycle_state (String)

    A filter to return only alarms that match the given lifecycle state exactly. When not specified, only alarms in the ACTIVE lifecycle state are listed.

  • :sort_by (String)

    The field to use when sorting returned alarm definitions. Only one sorting level is provided.

    Example: severity

    Allowed values are: displayName, severity

  • :sort_order (String)

    The sort order to use when sorting returned alarm definitions. Ascending (ASC) or descending (DESC).

    Example: ASC

    Allowed values are: ASC, DESC

  • :compartment_id_in_subtree (BOOLEAN)

    When true, returns resources from all compartments and subcompartments. The parameter can only be set to true when compartmentId is the tenancy OCID (the tenancy is the root compartment). A true value requires the user to have tenancy-level permissions. If this requirement is not met, then the call is rejected. When false, returns resources from only the compartment specified in compartmentId. Default is false.

Returns:



911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
# File 'lib/oci/monitoring/monitoring_client.rb', line 911

def list_alarms(compartment_id, opts = {})
  logger.debug 'Calling operation MonitoringClient#list_alarms.' if logger

  raise "Missing the required parameter 'compartment_id' when calling list_alarms." if compartment_id.nil?

  if opts[:lifecycle_state] && !OCI::Monitoring::Models::Alarm::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state])
    raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Monitoring::Models::Alarm::LIFECYCLE_STATE_ENUM.'
  end

  if opts[:sort_by] && !%w[displayName severity].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of displayName, severity.'
  end

  if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
  end

  path = '/alarms'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:compartmentIdInSubtree] = opts[:compartment_id_in_subtree] if !opts[:compartment_id_in_subtree].nil?

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#list_alarms') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'Array<OCI::Monitoring::Models::AlarmSummary>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_alarms_status(compartment_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use list_alarms_status API.

List the status of each alarm in the specified compartment. Status is collective, across all metric streams in the alarm. To list alarm status for each metric stream, use retrieve_dimension_states. Optionally filter by resource or status value.

For more information, see Listing Alarm Statuses. For important limits information, see Limits on Monitoring.

This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations. Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests, or transactions, per second (TPS) for a given tenancy.

Parameters:

  • compartment_id (String)

    The OCID of the compartment containing the resources monitored by the metric that you are searching for. Use tenancyId to search in the root compartment.

    Example: ocid1.compartment.oc1..exampleuniqueID

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Customer part of the request identifier token. If you need to contact Oracle about a particular request, please provide the complete request ID.

  • :compartment_id_in_subtree (BOOLEAN)

    When true, returns resources from all compartments and subcompartments. The parameter can only be set to true when compartmentId is the tenancy OCID (the tenancy is the root compartment). A true value requires the user to have tenancy-level permissions. If this requirement is not met, then the call is rejected. When false, returns resources from only the compartment specified in compartmentId. Default is false.

  • :page (String)

    For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

  • :limit (Integer)

    For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see List Pagination.

    Default: 1000

    Example: 500

  • :display_name (String)

    A filter to return only resources that match the given display name exactly. Use this filter to list an alarm by name. Alternatively, when you know the alarm OCID, use the GetAlarm operation.

  • :sort_by (String)

    The field to use when sorting returned alarm definitions. Only one sorting level is provided.

    Example: severity

    Allowed values are: displayName, severity

  • :sort_order (String)

    The sort order to use when sorting returned alarm definitions. Ascending (ASC) or descending (DESC).

    Example: ASC

    Allowed values are: ASC, DESC

  • :resource_id (String)

    A filter to return only the resource with the specified OCID. The resource must be monitored by the metric that you are searching for.

    Example: ocid1.instance.oc1.phx.exampleuniqueID

  • :service_name (String)

    A filter to return only resources that match the given service name exactly. Use this filter to list all alarms containing metric streams that match the exact service-name dimension.

    Example: logging-analytics

  • :entity_id (String)

    A filter to return only resources that match the given entity OCID exactly. The resource (entity) must be monitored by the metric that you are searching for.

    Example: ocid1.instance.oc1.phx.exampleuniqueID

  • :status (String)

    A filter to return only metric streams that match the specified status. For example, the value "FIRING" returns only firing metric streams.

    Example: FIRING

    Allowed values are: FIRING, OK

Returns:



1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
# File 'lib/oci/monitoring/monitoring_client.rb', line 1056

def list_alarms_status(compartment_id, opts = {})
  logger.debug 'Calling operation MonitoringClient#list_alarms_status.' if logger

  raise "Missing the required parameter 'compartment_id' when calling list_alarms_status." if compartment_id.nil?

  if opts[:sort_by] && !%w[displayName severity].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of displayName, severity.'
  end

  if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
  end

  if opts[:status] && !%w[FIRING OK].include?(opts[:status])
    raise 'Invalid value for "status", must be one of FIRING, OK.'
  end

  path = '/alarms/status'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:compartmentIdInSubtree] = opts[:compartment_id_in_subtree] if !opts[:compartment_id_in_subtree].nil?
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:resourceId] = opts[:resource_id] if opts[:resource_id]
  query_params[:serviceName] = opts[:service_name] if opts[:service_name]
  query_params[:entityId] = opts[:entity_id] if opts[:entity_id]
  query_params[:status] = opts[:status] if opts[:status]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#list_alarms_status') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'Array<OCI::Monitoring::Models::AlarmStatusSummary>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_metrics(compartment_id, list_metrics_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use list_metrics API.

Returns metric definitions that match the criteria specified in the request. Compartment OCID required. For more information, see Listing Metric Definitions. For information about metrics, see Metrics Overview. For important limits information, see Limits on Monitoring.

Transactions Per Second (TPS) per-tenancy limit for this operation: 10.

Parameters:

  • compartment_id (String)

    The OCID of the compartment containing the resources monitored by the metric that you are searching for. Use tenancyId to search in the root compartment.

    Example: ocid1.compartment.oc1..exampleuniqueID

  • list_metrics_details (OCI::Monitoring::Models::ListMetricsDetails)

    The dimensions used to filter metrics.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Customer part of the request identifier token. If you need to contact Oracle about a particular request, please provide the complete request ID.

  • :page (String)

    For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

  • :limit (Integer)

    For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see List Pagination.

    Default: 1000

    Example: 500

  • :compartment_id_in_subtree (BOOLEAN)

    When true, returns resources from all compartments and subcompartments. The parameter can only be set to true when compartmentId is the tenancy OCID (the tenancy is the root compartment). A true value requires the user to have tenancy-level permissions. If this requirement is not met, then the call is rejected. When false, returns resources from only the compartment specified in compartmentId. Default is false.

Returns:



1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
# File 'lib/oci/monitoring/monitoring_client.rb', line 1167

def list_metrics(compartment_id, list_metrics_details, opts = {})
  logger.debug 'Calling operation MonitoringClient#list_metrics.' if logger

  raise "Missing the required parameter 'compartment_id' when calling list_metrics." if compartment_id.nil?
  raise "Missing the required parameter 'list_metrics_details' when calling list_metrics." if list_metrics_details.nil?

  path = '/metrics/actions/listMetrics'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:compartmentIdInSubtree] = opts[:compartment_id_in_subtree] if !opts[:compartment_id_in_subtree].nil?

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(list_metrics_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#list_metrics') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'Array<OCI::Monitoring::Models::Metric>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#loggerLogger

Returns The logger for this client. May be nil.

Returns:

  • (Logger)

    The logger for this client. May be nil.



97
98
99
# File 'lib/oci/monitoring/monitoring_client.rb', line 97

def logger
  @api_client.config.logger
end

#post_metric_data(post_metric_data_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use post_metric_data API.

Publishes raw metric data points to the Monitoring service. For a data point to be posted, its timestamp must be near current time (less than two hours in the past and less than 10 minutes in the future).

For more information about publishing metrics, see Publishing Custom Metrics and Custom Metrics Walkthrough. For information about developing a metric-posting client, see Developer Guide. For an example client, see MonitoringMetricPostExample.java. For important limits information, see Limits on Monitoring.

Per-call limits information follows.

  • Dimensions per metric group*. Maximum: 20. Minimum: 1.

  • Unique metric streams*. Maximum: 50.

  • Transactions Per Second (TPS) per-tenancy limit for this operation: 50.

*A metric group is the combination of a given metric, metric namespace, and tenancy for the purpose of determining limits. A dimension is a qualifier provided in a metric definition. A metric stream is an individual set of aggregated data for a metric with zero or more dimension values. For more information about metric-related concepts, see Monitoring Concepts.

Note: The endpoints for this operation differ from other Monitoring operations. Replace the string telemetry with telemetry-ingestion in the endpoint, as in the following example:

telemetry-ingestion.eu-frankfurt-1.oraclecloud.com

Parameters:

  • post_metric_data_details (OCI::Monitoring::Models::PostMetricDataDetails)

    An array of metric objects containing raw metric data points to be posted to the Monitoring service.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Customer part of the request identifier token. If you need to contact Oracle about a particular request, please provide the complete request ID.

  • :content_encoding (String)

    The optional Content-Encoding header that defines the content encodings that were applied to the payload.

Returns:



1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
# File 'lib/oci/monitoring/monitoring_client.rb', line 1259

def post_metric_data(post_metric_data_details, opts = {})
  logger.debug 'Calling operation MonitoringClient#post_metric_data.' if logger

  raise "Missing the required parameter 'post_metric_data_details' when calling post_metric_data." if post_metric_data_details.nil?

  path = '/metrics'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'content-encoding'] = opts[:content_encoding] if opts[:content_encoding]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(post_metric_data_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#post_metric_data') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Monitoring::Models::PostMetricDataResponseDetails'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#remove_alarm_suppression(alarm_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use remove_alarm_suppression API.

Removes any existing suppression for the specified alarm. For more information, see Removing Suppression from an Alarm. For important limits information, see Limits on Monitoring.

This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations. Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests, or transactions, per second (TPS) for a given tenancy.

Parameters:

  • alarm_id (String)

    The OCID of an alarm.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_request_id (String)

    Customer part of the request identifier token. If you need to contact Oracle about a particular request, please provide the complete request ID.

Returns:

  • (Response)

    A Response object with data of type nil



1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
# File 'lib/oci/monitoring/monitoring_client.rb', line 1329

def remove_alarm_suppression(alarm_id, opts = {})
  logger.debug 'Calling operation MonitoringClient#remove_alarm_suppression.' if logger

  raise "Missing the required parameter 'alarm_id' when calling remove_alarm_suppression." if alarm_id.nil?
  raise "Parameter value for 'alarm_id' must not be blank" if OCI::Internal::Util.blank_string?(alarm_id)

  path = '/alarms/{alarmId}/actions/removeSuppression'.sub('{alarmId}', alarm_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#remove_alarm_suppression') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#retrieve_dimension_states(alarm_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use retrieve_dimension_states API.

Lists the current alarm status of each metric stream, where status is derived from the metric stream's last associated transition. Optionally filter by status value and one or more dimension key-value pairs.

For more information, see Listing Metric Stream Status in an Alarm.

For important limits information, see Limits on Monitoring.

This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations. Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests, or transactions, per second (TPS) for a given tenancy.

Parameters:

  • alarm_id (String)

    The OCID of an alarm.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Customer part of the request identifier token. If you need to contact Oracle about a particular request, please provide the complete request ID.

  • :page (String)

    For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

  • :limit (Integer)

    For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see List Pagination.

    Default: 1000

    Example: 500

  • :retrieve_dimension_states_details (OCI::Monitoring::Models::RetrieveDimensionStatesDetails)

    The configuration details for retrieving the current alarm status of each metric stream.

Returns:



1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
# File 'lib/oci/monitoring/monitoring_client.rb', line 1412

def retrieve_dimension_states(alarm_id, opts = {})
  logger.debug 'Calling operation MonitoringClient#retrieve_dimension_states.' if logger

  raise "Missing the required parameter 'alarm_id' when calling retrieve_dimension_states." if alarm_id.nil?
  raise "Parameter value for 'alarm_id' must not be blank" if OCI::Internal::Util.blank_string?(alarm_id)

  path = '/alarms/{alarmId}/actions/retrieveDimensionStates'.sub('{alarmId}', alarm_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(opts[:retrieve_dimension_states_details])

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#retrieve_dimension_states') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Monitoring::Models::AlarmDimensionStatesCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#summarize_alarm_suppression_history(alarm_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use summarize_alarm_suppression_history API.

Returns history of suppressions for the specified alarm, including both dimension-specific and and alarm-wide suppressions. For more information, see Getting Suppression History for an Alarm.

For important limits information, see Limits on Monitoring.

This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations. Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests, or transactions, per second (TPS) for a given tenancy.

Parameters:

  • alarm_id (String)

    The OCID of an alarm.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Customer part of the request identifier token. If you need to contact Oracle about a particular request, please provide the complete request ID.

  • :page (String)

    For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

  • :limit (Integer)

    For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see List Pagination.

    Default: 1000

    Example: 500

  • :summarize_alarm_suppression_history_details (OCI::Monitoring::Models::SummarizeAlarmSuppressionHistoryDetails)

    summarize history details

Returns:



1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
# File 'lib/oci/monitoring/monitoring_client.rb', line 1493

def summarize_alarm_suppression_history(alarm_id, opts = {})
  logger.debug 'Calling operation MonitoringClient#summarize_alarm_suppression_history.' if logger

  raise "Missing the required parameter 'alarm_id' when calling summarize_alarm_suppression_history." if alarm_id.nil?
  raise "Parameter value for 'alarm_id' must not be blank" if OCI::Internal::Util.blank_string?(alarm_id)

  path = '/alarms/{alarmId}/actions/summarizeAlarmSuppressionHistory'.sub('{alarmId}', alarm_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(opts[:summarize_alarm_suppression_history_details])

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#summarize_alarm_suppression_history') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Monitoring::Models::AlarmSuppressionHistoryItemCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#summarize_metrics_data(compartment_id, summarize_metrics_data_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use summarize_metrics_data API.

Returns aggregated data that match the criteria specified in the request. Compartment OCID required. For more information, see Querying Metric Data and Creating a Query. For important limits information, see Limits on Monitoring.

Transactions Per Second (TPS) per-tenancy limit for this operation: 10.

Parameters:

  • compartment_id (String)

    The OCID of the compartment containing the resources monitored by the metric that you are searching for. Use tenancyId to search in the root compartment.

    Example: ocid1.compartment.oc1..exampleuniqueID

  • summarize_metrics_data_details (OCI::Monitoring::Models::SummarizeMetricsDataDetails)

    The dimensions used to filter for metrics.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Customer part of the request identifier token. If you need to contact Oracle about a particular request, please provide the complete request ID.

  • :compartment_id_in_subtree (BOOLEAN)

    When true, returns resources from all compartments and subcompartments. The parameter can only be set to true when compartmentId is the tenancy OCID (the tenancy is the root compartment). A true value requires the user to have tenancy-level permissions. If this requirement is not met, then the call is rejected. When false, returns resources from only the compartment specified in compartmentId. Default is false.

Returns:



1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
# File 'lib/oci/monitoring/monitoring_client.rb', line 1572

def summarize_metrics_data(compartment_id, summarize_metrics_data_details, opts = {})
  logger.debug 'Calling operation MonitoringClient#summarize_metrics_data.' if logger

  raise "Missing the required parameter 'compartment_id' when calling summarize_metrics_data." if compartment_id.nil?
  raise "Missing the required parameter 'summarize_metrics_data_details' when calling summarize_metrics_data." if summarize_metrics_data_details.nil?

  path = '/metrics/actions/summarizeMetricsData'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:compartmentIdInSubtree] = opts[:compartment_id_in_subtree] if !opts[:compartment_id_in_subtree].nil?

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(summarize_metrics_data_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#summarize_metrics_data') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'Array<OCI::Monitoring::Models::MetricData>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_alarm(alarm_id, update_alarm_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use update_alarm API.

Updates the specified alarm. For more information, see Updating an Alarm. For important limits information, see Limits on Monitoring.

This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations. Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests, or transactions, per second (TPS) for a given tenancy.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_request_id (String)

    Customer part of the request identifier token. If you need to contact Oracle about a particular request, please provide the complete request ID.

Returns:



1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
# File 'lib/oci/monitoring/monitoring_client.rb', line 1645

def update_alarm(alarm_id, update_alarm_details, opts = {})
  logger.debug 'Calling operation MonitoringClient#update_alarm.' if logger

  raise "Missing the required parameter 'alarm_id' when calling update_alarm." if alarm_id.nil?
  raise "Missing the required parameter 'update_alarm_details' when calling update_alarm." if update_alarm_details.nil?
  raise "Parameter value for 'alarm_id' must not be blank" if OCI::Internal::Util.blank_string?(alarm_id)

  path = '/alarms/{alarmId}'.sub('{alarmId}', alarm_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(update_alarm_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#update_alarm') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Monitoring::Models::Alarm'
    )
  end
  # rubocop:enable Metrics/BlockLength
end