Class: OCI::Monitoring::MonitoringClient
- Inherits:
-
Object
- Object
- OCI::Monitoring::MonitoringClient
- 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 PostMetric, use the `telemetry-ingestion` endpoints; for all other operations, use the `telemetry` endpoints. For information about monitoring, see [Monitoring Overview](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm).
Instance Attribute Summary collapse
-
#api_client ⇒ OCI::ApiClient
readonly
Client used to make HTTP requests.
-
#endpoint ⇒ String
readonly
Fully qualified endpoint URL.
-
#region ⇒ String
The region, which will usually correspond to a value in Regions::REGION_ENUM.
-
#retry_config ⇒ OCI::Retry::RetryConfig
readonly
The default retry configuration to apply to all operations in this service client.
Instance Method Summary collapse
-
#change_alarm_compartment(alarm_id, change_alarm_compartment_details, opts = {}) ⇒ Response
Moves an alarm into a different compartment within the same tenancy.
-
#create_alarm(create_alarm_details, opts = {}) ⇒ Response
Creates a new alarm in the specified compartment.
-
#delete_alarm(alarm_id, opts = {}) ⇒ Response
Deletes the specified alarm.
-
#get_alarm(alarm_id, opts = {}) ⇒ Response
Gets the specified alarm.
-
#get_alarm_history(alarm_id, opts = {}) ⇒ Response
Get the history of the specified alarm.
-
#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ MonitoringClient
constructor
Creates a new MonitoringClient.
-
#list_alarms(compartment_id, opts = {}) ⇒ Response
Lists the alarms for the specified compartment.
-
#list_alarms_status(compartment_id, opts = {}) ⇒ Response
List the status of each alarm in the specified compartment.
-
#list_metrics(compartment_id, list_metrics_details, opts = {}) ⇒ Response
Returns metric definitions that match the criteria specified in the request.
-
#logger ⇒ Logger
The logger for this client.
-
#post_metric_data(post_metric_data_details, opts = {}) ⇒ Response
Publishes raw metric data points to the Monitoring service.
-
#remove_alarm_suppression(alarm_id, opts = {}) ⇒ Response
Removes any existing suppression for the specified alarm.
-
#summarize_metrics_data(compartment_id, summarize_metrics_data_details, opts = {}) ⇒ Response
Returns aggregated data that match the criteria specified in the request.
-
#update_alarm(alarm_id, update_alarm_details, opts = {}) ⇒ Response
Updates the specified alarm.
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.
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/oci/monitoring/monitoring_client.rb', line 54 def initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) # If the signer is an InstancePrincipalsSecurityTokenSigner and no config was supplied (which is valid for instance principals) # 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 unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner) config ||= OCI::Config.new if signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner) config.validate unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner) if signer.nil? signer = OCI::Signer.new( config.user, config.fingerprint, config.tenancy, config.key_file, pass_phrase: config.pass_phrase, private_key_content: config.key_content ) end @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_client ⇒ OCI::ApiClient (readonly)
Client used to make HTTP requests.
14 15 16 |
# File 'lib/oci/monitoring/monitoring_client.rb', line 14 def api_client @api_client end |
#endpoint ⇒ String (readonly)
Fully qualified endpoint URL
18 19 20 |
# File 'lib/oci/monitoring/monitoring_client.rb', line 18 def endpoint @endpoint end |
#region ⇒ String
The region, which will usually correspond to a value in Regions::REGION_ENUM.
28 29 30 |
# File 'lib/oci/monitoring/monitoring_client.rb', line 28 def region @region end |
#retry_config ⇒ OCI::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
24 25 26 |
# File 'lib/oci/monitoring/monitoring_client.rb', line 24 def retry_config @retry_config end |
Instance Method Details
#change_alarm_compartment(alarm_id, change_alarm_compartment_details, opts = {}) ⇒ Response
Moves an alarm into a different compartment within the same tenancy.
For information about moving resources between compartments, see [Moving Resources Between Compartments](docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes).
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
# File 'lib/oci/monitoring/monitoring_client.rb', line 137 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.(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
Creates a new alarm in the specified compartment. For important limits information, see [Limits on Monitoring](docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#Limits).
Transactions Per Second (TPS) per-tenancy limit for this operation: 1.
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.(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 |
#delete_alarm(alarm_id, opts = {}) ⇒ Response
Deletes the specified alarm. For important limits information, see [Limits on Monitoring](docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#Limits).
Transactions Per Second (TPS) per-tenancy limit for this operation: 1.
270 271 272 273 274 275 276 277 278 279 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 |
# File 'lib/oci/monitoring/monitoring_client.rb', line 270 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.(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 |
#get_alarm(alarm_id, opts = {}) ⇒ Response
Gets the specified alarm. For important limits information, see [Limits on Monitoring](docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#Limits).
Transactions Per Second (TPS) per-tenancy limit for this operation: 1.
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 |
# File 'lib/oci/monitoring/monitoring_client.rb', line 330 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.(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
Get the history of the specified alarm. For important limits information, see [Limits on Monitoring](docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#Limits).
Transactions Per Second (TPS) per-tenancy limit for this operation: 1.
414 415 416 417 418 419 420 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 458 459 |
# File 'lib/oci/monitoring/monitoring_client.rb', line 414 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].include?(opts[:alarm_historytype]) raise 'Invalid value for "alarm_historytype", must be one of STATE_HISTORY, STATE_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.(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 |
#list_alarms(compartment_id, opts = {}) ⇒ Response
Lists the alarms for the specified compartment. For important limits information, see [Limits on Monitoring](docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#Limits).
Transactions Per Second (TPS) per-tenancy limit for this operation: 1.
518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 |
# File 'lib/oci/monitoring/monitoring_client.rb', line 518 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.(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
List the status of each alarm in the specified compartment. For important limits information, see [Limits on Monitoring](docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#Limits).
Transactions Per Second (TPS) per-tenancy limit for this operation: 1.
630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 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 |
# File 'lib/oci/monitoring/monitoring_client.rb', line 630 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 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] # 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.(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
Returns metric definitions that match the criteria specified in the request. Compartment OCID required. For information about metrics, see [Metrics Overview](docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#MetricsOverview). For important limits information, see [Limits on Monitoring](docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#Limits).
Transactions Per Second (TPS) per-tenancy limit for this operation: 1.
726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 |
# File 'lib/oci/monitoring/monitoring_client.rb', line 726 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.(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 |
#logger ⇒ Logger
Returns The logger for this client. May be nil.
104 105 106 |
# File 'lib/oci/monitoring/monitoring_client.rb', line 104 def logger @api_client.config.logger end |
#post_metric_data(post_metric_data_details, opts = {}) ⇒ Response
Publishes raw metric data points to the Monitoring service. For more information about publishing metrics, see [Publishing Custom Metrics](docs.cloud.oracle.com/iaas/Content/Monitoring/Tasks/publishingcustommetrics.htm). For important limits information, see [Limits on Monitoring](docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#Limits).
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, typically specific to a resource. For more information about metric-related concepts, see [Monitoring Concepts](docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#concepts).
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:
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 |
# File 'lib/oci/monitoring/monitoring_client.rb', line 804 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] # rubocop:enable Style/NegatedIf post_body = @api_client.object_to_http_body(post_metric_data_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(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
Removes any existing suppression for the specified alarm. For important limits information, see [Limits on Monitoring](docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#Limits).
Transactions Per Second (TPS) per-tenancy limit for this operation: 1.
867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 |
# File 'lib/oci/monitoring/monitoring_client.rb', line 867 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.(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 |
#summarize_metrics_data(compartment_id, summarize_metrics_data_details, opts = {}) ⇒ Response
Returns aggregated data that match the criteria specified in the request. Compartment OCID required. For information on metric queries, see [Building Metric Queries](docs.cloud.oracle.com/iaas/Content/Monitoring/Tasks/buildingqueries.htm). For important limits information, see [Limits on Monitoring](docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#Limits).
Transactions Per Second (TPS) per-tenancy limit for this operation: 10.
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 967 968 969 970 971 972 973 974 975 976 977 |
# File 'lib/oci/monitoring/monitoring_client.rb', line 939 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.(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
Updates the specified alarm. For important limits information, see [Limits on Monitoring](docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#Limits).
Transactions Per Second (TPS) per-tenancy limit for this operation: 1.
1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 |
# File 'lib/oci/monitoring/monitoring_client.rb', line 1006 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.(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 |