oci 2.5.0 → 2.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -1
  3. data/lib/oci.rb +4 -0
  4. data/lib/oci/auth/federation_client.rb +4 -4
  5. data/lib/oci/auth/signers/instance_principals_security_token_signer.rb +22 -16
  6. data/lib/oci/autoscaling/auto_scaling_client.rb +774 -0
  7. data/lib/oci/autoscaling/auto_scaling_client_composite_operations.rb +24 -0
  8. data/lib/oci/autoscaling/autoscaling.rb +38 -0
  9. data/lib/oci/autoscaling/models/action.rb +182 -0
  10. data/lib/oci/autoscaling/models/auto_scaling_configuration.rb +282 -0
  11. data/lib/oci/autoscaling/models/auto_scaling_configuration_summary.rb +234 -0
  12. data/lib/oci/autoscaling/models/auto_scaling_policy.rb +222 -0
  13. data/lib/oci/autoscaling/models/auto_scaling_policy_summary.rb +179 -0
  14. data/lib/oci/autoscaling/models/capacity.rb +170 -0
  15. data/lib/oci/autoscaling/models/condition.rb +186 -0
  16. data/lib/oci/autoscaling/models/create_auto_scaling_configuration_details.rb +256 -0
  17. data/lib/oci/autoscaling/models/create_auto_scaling_policy_details.rb +196 -0
  18. data/lib/oci/autoscaling/models/create_condition_details.rb +176 -0
  19. data/lib/oci/autoscaling/models/create_threshold_policy_details.rb +166 -0
  20. data/lib/oci/autoscaling/models/instance_pool_resource.rb +148 -0
  21. data/lib/oci/autoscaling/models/metric.rb +186 -0
  22. data/lib/oci/autoscaling/models/resource.rb +177 -0
  23. data/lib/oci/autoscaling/models/threshold.rb +188 -0
  24. data/lib/oci/autoscaling/models/threshold_policy.rb +173 -0
  25. data/lib/oci/autoscaling/models/update_auto_scaling_configuration_details.rb +219 -0
  26. data/lib/oci/autoscaling/models/update_auto_scaling_policy_details.rb +194 -0
  27. data/lib/oci/autoscaling/models/update_condition_details.rb +176 -0
  28. data/lib/oci/autoscaling/models/update_threshold_policy_details.rb +164 -0
  29. data/lib/oci/autoscaling/util.rb +2 -0
  30. data/lib/oci/core/blockstorage_client.rb +1 -1
  31. data/lib/oci/core/compute_client.rb +1 -1
  32. data/lib/oci/core/compute_management_client.rb +135 -1
  33. data/lib/oci/core/compute_management_client_composite_operations.rb +80 -0
  34. data/lib/oci/core/core.rb +8 -0
  35. data/lib/oci/core/models/attach_load_balancer_details.rb +191 -0
  36. data/lib/oci/core/models/create_instance_pool_details.rb +19 -4
  37. data/lib/oci/core/models/detach_load_balancer_details.rb +167 -0
  38. data/lib/oci/core/models/image.rb +14 -1
  39. data/lib/oci/core/models/instance.rb +18 -2
  40. data/lib/oci/core/models/instance_agent_config.rb +154 -0
  41. data/lib/oci/core/models/instance_agent_features.rb +154 -0
  42. data/lib/oci/core/models/instance_pool.rb +19 -4
  43. data/lib/oci/core/models/instance_pool_instance_load_balancer_backend.rb +219 -0
  44. data/lib/oci/core/models/instance_pool_load_balancer_attachment.rb +253 -0
  45. data/lib/oci/core/models/instance_summary.rb +19 -4
  46. data/lib/oci/core/models/launch_instance_agent_config_details.rb +155 -0
  47. data/lib/oci/core/models/launch_instance_details.rb +14 -1
  48. data/lib/oci/core/models/update_instance_agent_config_details.rb +154 -0
  49. data/lib/oci/core/models/update_instance_details.rb +16 -1
  50. data/lib/oci/core/virtual_network_client.rb +1 -1
  51. data/lib/oci/database/database_client.rb +12 -14
  52. data/lib/oci/database/models/autonomous_data_warehouse_connection_strings.rb +3 -1
  53. data/lib/oci/database/models/autonomous_database_connection_strings.rb +3 -1
  54. data/lib/oci/database/models/create_data_guard_association_details.rb +2 -7
  55. data/lib/oci/database/models/create_data_guard_association_to_existing_db_system_details.rb +5 -1
  56. data/lib/oci/database/models/create_data_guard_association_with_new_db_system_details.rb +4 -1
  57. data/lib/oci/database/models/database_summary.rb +1 -1
  58. data/lib/oci/database/models/db_node.rb +15 -1
  59. data/lib/oci/database/models/db_node_summary.rb +15 -1
  60. data/lib/oci/database/models/db_system.rb +15 -1
  61. data/lib/oci/database/models/db_system_summary.rb +15 -1
  62. data/lib/oci/database/models/db_version_summary.rb +1 -1
  63. data/lib/oci/database/models/launch_db_system_base.rb +33 -2
  64. data/lib/oci/database/models/launch_db_system_details.rb +5 -1
  65. data/lib/oci/database/models/launch_db_system_from_backup_details.rb +5 -1
  66. data/lib/oci/database/models/update_db_system_details.rb +1 -1
  67. data/lib/oci/identity/identity.rb +4 -0
  68. data/lib/oci/identity/identity_client.rb +468 -12
  69. data/lib/oci/identity/identity_client_composite_operations.rb +79 -0
  70. data/lib/oci/identity/models/change_tag_namespace_compartment_detail.rb +154 -0
  71. data/lib/oci/identity/models/create_identity_provider_details.rb +2 -1
  72. data/lib/oci/identity/models/mfa_totp_device.rb +279 -0
  73. data/lib/oci/identity/models/mfa_totp_device_summary.rb +267 -0
  74. data/lib/oci/identity/models/mfa_totp_token.rb +155 -0
  75. data/lib/oci/identity/models/tag_namespace_summary.rb +1 -1
  76. data/lib/oci/identity/models/user.rb +18 -4
  77. data/lib/oci/monitoring/models/aggregated_datapoint.rb +166 -0
  78. data/lib/oci/monitoring/models/alarm.rb +538 -0
  79. data/lib/oci/monitoring/models/alarm_history_collection.rb +183 -0
  80. data/lib/oci/monitoring/models/alarm_history_entry.rb +187 -0
  81. data/lib/oci/monitoring/models/alarm_status_summary.rb +277 -0
  82. data/lib/oci/monitoring/models/alarm_summary.rb +386 -0
  83. data/lib/oci/monitoring/models/create_alarm_details.rb +423 -0
  84. data/lib/oci/monitoring/models/datapoint.rb +179 -0
  85. data/lib/oci/monitoring/models/failed_metric_record.rb +166 -0
  86. data/lib/oci/monitoring/models/list_metrics_details.rb +271 -0
  87. data/lib/oci/monitoring/models/metric.rb +197 -0
  88. data/lib/oci/monitoring/models/metric_data.rb +243 -0
  89. data/lib/oci/monitoring/models/metric_data_details.rb +227 -0
  90. data/lib/oci/monitoring/models/post_metric_data_details.rb +194 -0
  91. data/lib/oci/monitoring/models/post_metric_data_response_details.rb +170 -0
  92. data/lib/oci/monitoring/models/summarize_metrics_data_details.rb +229 -0
  93. data/lib/oci/monitoring/models/suppression.rb +196 -0
  94. data/lib/oci/monitoring/models/update_alarm_details.rb +423 -0
  95. data/lib/oci/monitoring/monitoring.rb +37 -0
  96. data/lib/oci/monitoring/monitoring_client.rb +923 -0
  97. data/lib/oci/monitoring/monitoring_client_composite_operations.rb +145 -0
  98. data/lib/oci/monitoring/util.rb +2 -0
  99. data/lib/oci/ons/models/backoff_retry_policy.rb +192 -0
  100. data/lib/oci/ons/models/confirmation_result.rb +221 -0
  101. data/lib/oci/ons/models/create_subscription_details.rb +238 -0
  102. data/lib/oci/ons/models/create_topic_details.rb +209 -0
  103. data/lib/oci/ons/models/delivery_policy.rb +153 -0
  104. data/lib/oci/ons/models/message_details.rb +163 -0
  105. data/lib/oci/ons/models/notification_topic.rb +302 -0
  106. data/lib/oci/ons/models/notification_topic_summary.rb +303 -0
  107. data/lib/oci/ons/models/publish_result.rb +168 -0
  108. data/lib/oci/ons/models/subscription.rb +273 -0
  109. data/lib/oci/ons/models/subscription_summary.rb +300 -0
  110. data/lib/oci/ons/models/topic_attributes_details.rb +184 -0
  111. data/lib/oci/ons/models/update_subscription_details.rb +188 -0
  112. data/lib/oci/ons/notification_control_plane_client.rb +463 -0
  113. data/lib/oci/ons/notification_control_plane_client_composite_operations.rb +24 -0
  114. data/lib/oci/ons/notification_data_plane_client.rb +680 -0
  115. data/lib/oci/ons/notification_data_plane_client_composite_operations.rb +104 -0
  116. data/lib/oci/ons/ons.rb +33 -0
  117. data/lib/oci/ons/util.rb +2 -0
  118. data/lib/oci/regions.rb +5 -0
  119. data/lib/oci/resource_manager/models/apply_job_plan_resolution.rb +189 -0
  120. data/lib/oci/resource_manager/models/config_source.rb +208 -0
  121. data/lib/oci/resource_manager/models/create_config_source_details.rb +187 -0
  122. data/lib/oci/resource_manager/models/create_job_details.rb +225 -0
  123. data/lib/oci/resource_manager/models/create_stack_details.rb +239 -0
  124. data/lib/oci/resource_manager/models/create_zip_upload_config_source_details.rb +166 -0
  125. data/lib/oci/resource_manager/models/failure_details.rb +185 -0
  126. data/lib/oci/resource_manager/models/job.rb +399 -0
  127. data/lib/oci/resource_manager/models/job_summary.rb +311 -0
  128. data/lib/oci/resource_manager/models/log_entry.rb +225 -0
  129. data/lib/oci/resource_manager/models/stack.rb +305 -0
  130. data/lib/oci/resource_manager/models/stack_summary.rb +249 -0
  131. data/lib/oci/resource_manager/models/update_config_source_details.rb +184 -0
  132. data/lib/oci/resource_manager/models/update_job_details.rb +188 -0
  133. data/lib/oci/resource_manager/models/update_stack_details.rb +225 -0
  134. data/lib/oci/resource_manager/models/update_zip_upload_config_source_details.rb +164 -0
  135. data/lib/oci/resource_manager/models/zip_upload_config_source.rb +149 -0
  136. data/lib/oci/resource_manager/resource_manager.rb +36 -0
  137. data/lib/oci/resource_manager/resource_manager_client.rb +1264 -0
  138. data/lib/oci/resource_manager/resource_manager_client_composite_operations.rb +263 -0
  139. data/lib/oci/resource_manager/util.rb +2 -0
  140. data/lib/oci/version.rb +1 -1
  141. metadata +100 -2
@@ -0,0 +1,37 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ module OCI
4
+ module Monitoring
5
+ # Module containing models for requests made to, and responses received from,
6
+ # OCI Monitoring services
7
+ module Models
8
+ end
9
+ end
10
+ end
11
+
12
+ # Require models
13
+ require 'oci/monitoring/models/aggregated_datapoint'
14
+ require 'oci/monitoring/models/alarm'
15
+ require 'oci/monitoring/models/alarm_history_collection'
16
+ require 'oci/monitoring/models/alarm_history_entry'
17
+ require 'oci/monitoring/models/alarm_status_summary'
18
+ require 'oci/monitoring/models/alarm_summary'
19
+ require 'oci/monitoring/models/create_alarm_details'
20
+ require 'oci/monitoring/models/datapoint'
21
+ require 'oci/monitoring/models/failed_metric_record'
22
+ require 'oci/monitoring/models/list_metrics_details'
23
+ require 'oci/monitoring/models/metric'
24
+ require 'oci/monitoring/models/metric_data'
25
+ require 'oci/monitoring/models/metric_data_details'
26
+ require 'oci/monitoring/models/post_metric_data_details'
27
+ require 'oci/monitoring/models/post_metric_data_response_details'
28
+ require 'oci/monitoring/models/summarize_metrics_data_details'
29
+ require 'oci/monitoring/models/suppression'
30
+ require 'oci/monitoring/models/update_alarm_details'
31
+
32
+ # Require generated clients
33
+ require 'oci/monitoring/monitoring_client'
34
+ require 'oci/monitoring/monitoring_client_composite_operations'
35
+
36
+ # Require service utilities
37
+ require 'oci/monitoring/util'
@@ -0,0 +1,923 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'uri'
4
+ require 'logger'
5
+
6
+ # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
7
+ module OCI
8
+ # Use the Monitoring API to manage metric queries and alarms for assessing the health, capacity, and performance of your cloud resources.
9
+ # For information about monitoring, see [Monitoring Overview](/iaas/Content/Monitoring/Concepts/monitoringoverview.htm).
10
+ class Monitoring::MonitoringClient
11
+ # Client used to make HTTP requests.
12
+ # @return [OCI::ApiClient]
13
+ attr_reader :api_client
14
+
15
+ # Fully qualified endpoint URL
16
+ # @return [String]
17
+ attr_reader :endpoint
18
+
19
+ # The default retry configuration to apply to all operations in this service client. This can be overridden
20
+ # on a per-operation basis. The default retry configuration value is `nil`, which means that an operation
21
+ # will not perform any retries
22
+ # @return [OCI::Retry::RetryConfig]
23
+ attr_reader :retry_config
24
+
25
+ # The region, which will usually correspond to a value in {OCI::Regions::REGION_ENUM}.
26
+ # @return [String]
27
+ attr_reader :region
28
+
29
+ # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines, Metrics/PerceivedComplexity
30
+
31
+
32
+ # Creates a new MonitoringClient.
33
+ # Notes:
34
+ # If a config is not specified, then the global OCI.config will be used.
35
+ #
36
+ # This client is not thread-safe
37
+ #
38
+ # Either a region or an endpoint must be specified. If an endpoint is specified, it will be used instead of the
39
+ # region. A region may be specified in the config or via or the region parameter. If specified in both, then the
40
+ # region parameter will be used.
41
+ # @param [Config] config A Config object.
42
+ # @param [String] region A region used to determine the service endpoint. This will usually
43
+ # correspond to a value in {OCI::Regions::REGION_ENUM}, but may be an arbitrary string.
44
+ # @param [String] endpoint The fully qualified endpoint URL
45
+ # @param [OCI::BaseSigner] signer A signer implementation which can be used by this client. If this is not provided then
46
+ # a signer will be constructed via the provided config. One use case of this parameter is instance principals authentication,
47
+ # so that the instance principals signer can be provided to the client
48
+ # @param [OCI::ApiClientProxySettings] proxy_settings If your environment requires you to use a proxy server for outgoing HTTP requests
49
+ # the details for the proxy can be provided in this parameter
50
+ # @param [OCI::Retry::RetryConfig] retry_config The retry configuration for this service client. This represents the default retry configuration to
51
+ # 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
52
+ # will not perform any retries
53
+ def initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil)
54
+ # If the signer is an InstancePrincipalsSecurityTokenSigner and no config was supplied (which is valid for instance principals)
55
+ # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals
56
+ # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then
57
+ # pass it to this constructor.
58
+ #
59
+ # If there is no signer (or the signer is not an instance principals signer) and no config was supplied, this is not valid
60
+ # so try and load the config from the default file.
61
+ config ||= OCI.config unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
62
+ config ||= OCI::Config.new if signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
63
+ config.validate unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
64
+
65
+ if signer.nil?
66
+ signer = OCI::Signer.new(
67
+ config.user,
68
+ config.fingerprint,
69
+ config.tenancy,
70
+ config.key_file,
71
+ pass_phrase: config.pass_phrase,
72
+ private_key_content: config.key_content
73
+ )
74
+ end
75
+
76
+ @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings)
77
+ @retry_config = retry_config
78
+
79
+ if endpoint
80
+ @endpoint = endpoint + '/20180401'
81
+ else
82
+ region ||= config.region
83
+ region ||= signer.region if signer.respond_to?(:region)
84
+ self.region = region
85
+ end
86
+ logger.info "MonitoringClient endpoint set to '#{@endpoint}'." if logger
87
+ end
88
+ # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines, Metrics/PerceivedComplexity
89
+
90
+ # Set the region that will be used to determine the service endpoint.
91
+ # This will usually correspond to a value in {OCI::Regions::REGION_ENUM},
92
+ # but may be an arbitrary string.
93
+ def region=(new_region)
94
+ @region = new_region
95
+
96
+ raise 'A region must be specified.' unless @region
97
+
98
+ @endpoint = OCI::Regions.get_service_endpoint(@region, :MonitoringClient) + '/20180401'
99
+ logger.info "MonitoringClient endpoint set to '#{@endpoint} from region #{@region}'." if logger
100
+ end
101
+
102
+ # @return [Logger] The logger for this client. May be nil.
103
+ def logger
104
+ @api_client.config.logger
105
+ end
106
+
107
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
108
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
109
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
110
+
111
+
112
+ # Creates a new alarm in the specified compartment.
113
+ #
114
+ # @param [OCI::Monitoring::Models::CreateAlarmDetails] create_alarm_details Document for creating an alarm.
115
+ # @param [Hash] opts the optional parameters
116
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
117
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
118
+ # @option opts [String] :opc_request_id Customer part of the request identifier token. If you need to contact Oracle about a particular
119
+ # request, please provide the complete request ID.
120
+ #
121
+ # @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
122
+ # server error without risk of executing that same action again. Retry tokens expire after 24
123
+ # hours, but can be invalidated before then due to conflicting operations. For example, if a resource
124
+ # has been deleted and purged from the system, then a retry of the original creation request
125
+ # might be rejected.
126
+ #
127
+ # @return [Response] A Response object with data of type {OCI::Monitoring::Models::Alarm Alarm}
128
+ def create_alarm(create_alarm_details, opts = {})
129
+ logger.debug 'Calling operation MonitoringClient#create_alarm.' if logger
130
+
131
+ raise "Missing the required parameter 'create_alarm_details' when calling create_alarm." if create_alarm_details.nil?
132
+
133
+ path = '/alarms'
134
+ operation_signing_strategy = :standard
135
+
136
+ # rubocop:disable Style/NegatedIf
137
+ # Query Params
138
+ query_params = {}
139
+
140
+ # Header Params
141
+ header_params = {}
142
+ header_params[:accept] = 'application/json'
143
+ header_params[:'content-type'] = 'application/json'
144
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
145
+ header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
146
+ # rubocop:enable Style/NegatedIf
147
+ header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token
148
+
149
+ post_body = @api_client.object_to_http_body(create_alarm_details)
150
+
151
+ # rubocop:disable Metrics/BlockLength
152
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#create_alarm') do
153
+ @api_client.call_api(
154
+ :POST,
155
+ path,
156
+ endpoint,
157
+ header_params: header_params,
158
+ query_params: query_params,
159
+ operation_signing_strategy: operation_signing_strategy,
160
+ body: post_body,
161
+ return_type: 'OCI::Monitoring::Models::Alarm'
162
+ )
163
+ end
164
+ # rubocop:enable Metrics/BlockLength
165
+ end
166
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
167
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
168
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
169
+
170
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
171
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
172
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
173
+
174
+
175
+ # Deletes the specified alarm.
176
+ #
177
+ # @param [String] alarm_id The [OCID](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm) of an alarm.
178
+ #
179
+ # @param [Hash] opts the optional parameters
180
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
181
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
182
+ # @option opts [String] :opc_request_id Customer part of the request identifier token. If you need to contact Oracle about a particular
183
+ # request, please provide the complete request ID.
184
+ #
185
+ # @return [Response] A Response object with data of type nil
186
+ def delete_alarm(alarm_id, opts = {})
187
+ logger.debug 'Calling operation MonitoringClient#delete_alarm.' if logger
188
+
189
+ raise "Missing the required parameter 'alarm_id' when calling delete_alarm." if alarm_id.nil?
190
+ raise "Parameter value for 'alarm_id' must not be blank" if OCI::Internal::Util.blank_string?(alarm_id)
191
+
192
+ path = '/alarms/{alarmId}'.sub('{alarmId}', alarm_id.to_s)
193
+ operation_signing_strategy = :standard
194
+
195
+ # rubocop:disable Style/NegatedIf
196
+ # Query Params
197
+ query_params = {}
198
+
199
+ # Header Params
200
+ header_params = {}
201
+ header_params[:accept] = 'application/json'
202
+ header_params[:'content-type'] = 'application/json'
203
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
204
+ # rubocop:enable Style/NegatedIf
205
+
206
+ post_body = nil
207
+
208
+ # rubocop:disable Metrics/BlockLength
209
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#delete_alarm') do
210
+ @api_client.call_api(
211
+ :DELETE,
212
+ path,
213
+ endpoint,
214
+ header_params: header_params,
215
+ query_params: query_params,
216
+ operation_signing_strategy: operation_signing_strategy,
217
+ body: post_body
218
+ )
219
+ end
220
+ # rubocop:enable Metrics/BlockLength
221
+ end
222
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
223
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
224
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
225
+
226
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
227
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
228
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
229
+
230
+
231
+ # Gets the specified alarm.
232
+ #
233
+ # @param [String] alarm_id The [OCID](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm) of an alarm.
234
+ #
235
+ # @param [Hash] opts the optional parameters
236
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
237
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
238
+ # @option opts [String] :opc_request_id Customer part of the request identifier token. If you need to contact Oracle about a particular
239
+ # request, please provide the complete request ID.
240
+ #
241
+ # @return [Response] A Response object with data of type {OCI::Monitoring::Models::Alarm Alarm}
242
+ def get_alarm(alarm_id, opts = {})
243
+ logger.debug 'Calling operation MonitoringClient#get_alarm.' if logger
244
+
245
+ raise "Missing the required parameter 'alarm_id' when calling get_alarm." if alarm_id.nil?
246
+ raise "Parameter value for 'alarm_id' must not be blank" if OCI::Internal::Util.blank_string?(alarm_id)
247
+
248
+ path = '/alarms/{alarmId}'.sub('{alarmId}', alarm_id.to_s)
249
+ operation_signing_strategy = :standard
250
+
251
+ # rubocop:disable Style/NegatedIf
252
+ # Query Params
253
+ query_params = {}
254
+
255
+ # Header Params
256
+ header_params = {}
257
+ header_params[:accept] = 'application/json'
258
+ header_params[:'content-type'] = 'application/json'
259
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
260
+ # rubocop:enable Style/NegatedIf
261
+
262
+ post_body = nil
263
+
264
+ # rubocop:disable Metrics/BlockLength
265
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#get_alarm') do
266
+ @api_client.call_api(
267
+ :GET,
268
+ path,
269
+ endpoint,
270
+ header_params: header_params,
271
+ query_params: query_params,
272
+ operation_signing_strategy: operation_signing_strategy,
273
+ body: post_body,
274
+ return_type: 'OCI::Monitoring::Models::Alarm'
275
+ )
276
+ end
277
+ # rubocop:enable Metrics/BlockLength
278
+ end
279
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
280
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
281
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
282
+
283
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
284
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
285
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
286
+
287
+
288
+ # Get the history of the specified alarm.
289
+ #
290
+ # @param [String] alarm_id The [OCID](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm) of an alarm.
291
+ #
292
+ # @param [Hash] opts the optional parameters
293
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
294
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
295
+ # @option opts [String] :opc_request_id Customer part of the request identifier token. If you need to contact Oracle about a particular
296
+ # request, please provide the complete request ID.
297
+ #
298
+ # @option opts [String] :alarm_historytype The type of history entries to retrieve. State history (STATE_HISTORY) or state transition history (STATE_TRANSITION_HISTORY).
299
+ # If not specified, entries of both types are retrieved.
300
+ #
301
+ # Example: `STATE_HISTORY`
302
+ #
303
+ # Allowed values are: STATE_HISTORY, STATE_TRANSITION_HISTORY
304
+ # @option opts [String] :page For list pagination. The value of the `opc-next-page` response header from the previous \"List\" call.
305
+ # For important details about how pagination works, see [List Pagination](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/API/Concepts/usingapi.htm#nine).
306
+ #
307
+ # @option opts [Integer] :limit For list pagination. The maximum number of results per page, or items to return in a paginated \"List\" call.
308
+ # 1 is the minimum, 1000 is the maximum.
309
+ # For important details about how pagination works, see [List Pagination](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/API/Concepts/usingapi.htm#nine).
310
+ #
311
+ # Default: 1000
312
+ #
313
+ # Example: 500
314
+ #
315
+ # @option opts [DateTime] :timestamp_greater_than_or_equal_to A filter to return only alarm history entries with timestamps occurring on or after the specified date and time. Format defined by RFC3339.
316
+ #
317
+ # Example: `2019-01-01T01:00:00.789Z`
318
+ #
319
+ # @option opts [DateTime] :timestamp_less_than A filter to return only alarm history entries with timestamps occurring before the specified date and time. Format defined by RFC3339.
320
+ #
321
+ # Example: `2019-01-02T01:00:00.789Z`
322
+ #
323
+ # @return [Response] A Response object with data of type {OCI::Monitoring::Models::AlarmHistoryCollection AlarmHistoryCollection}
324
+ def get_alarm_history(alarm_id, opts = {})
325
+ logger.debug 'Calling operation MonitoringClient#get_alarm_history.' if logger
326
+
327
+ raise "Missing the required parameter 'alarm_id' when calling get_alarm_history." if alarm_id.nil?
328
+
329
+ if opts[:alarm_historytype] && !%w[STATE_HISTORY STATE_TRANSITION_HISTORY].include?(opts[:alarm_historytype])
330
+ raise 'Invalid value for "alarm_historytype", must be one of STATE_HISTORY, STATE_TRANSITION_HISTORY.'
331
+ end
332
+ raise "Parameter value for 'alarm_id' must not be blank" if OCI::Internal::Util.blank_string?(alarm_id)
333
+
334
+ path = '/alarms/{alarmId}/history'.sub('{alarmId}', alarm_id.to_s)
335
+ operation_signing_strategy = :standard
336
+
337
+ # rubocop:disable Style/NegatedIf
338
+ # Query Params
339
+ query_params = {}
340
+ query_params[:alarmHistorytype] = opts[:alarm_historytype] if opts[:alarm_historytype]
341
+ query_params[:page] = opts[:page] if opts[:page]
342
+ query_params[:limit] = opts[:limit] if opts[:limit]
343
+ query_params[:timestampGreaterThanOrEqualTo] = opts[:timestamp_greater_than_or_equal_to] if opts[:timestamp_greater_than_or_equal_to]
344
+ query_params[:timestampLessThan] = opts[:timestamp_less_than] if opts[:timestamp_less_than]
345
+
346
+ # Header Params
347
+ header_params = {}
348
+ header_params[:accept] = 'application/json'
349
+ header_params[:'content-type'] = 'application/json'
350
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
351
+ # rubocop:enable Style/NegatedIf
352
+
353
+ post_body = nil
354
+
355
+ # rubocop:disable Metrics/BlockLength
356
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#get_alarm_history') do
357
+ @api_client.call_api(
358
+ :GET,
359
+ path,
360
+ endpoint,
361
+ header_params: header_params,
362
+ query_params: query_params,
363
+ operation_signing_strategy: operation_signing_strategy,
364
+ body: post_body,
365
+ return_type: 'OCI::Monitoring::Models::AlarmHistoryCollection'
366
+ )
367
+ end
368
+ # rubocop:enable Metrics/BlockLength
369
+ end
370
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
371
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
372
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
373
+
374
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
375
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
376
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
377
+
378
+
379
+ # Lists the alarms for the specified compartment.
380
+ #
381
+ # @param [String] compartment_id The [OCID](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the
382
+ # resources monitored by the metric that you are searching for. Use tenancyId to search in
383
+ # the root compartment.
384
+ #
385
+ # @param [Hash] opts the optional parameters
386
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
387
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
388
+ # @option opts [String] :opc_request_id Customer part of the request identifier token. If you need to contact Oracle about a particular
389
+ # request, please provide the complete request ID.
390
+ #
391
+ # @option opts [String] :page For list pagination. The value of the `opc-next-page` response header from the previous \"List\" call.
392
+ # For important details about how pagination works, see [List Pagination](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/API/Concepts/usingapi.htm#nine).
393
+ #
394
+ # @option opts [Integer] :limit For list pagination. The maximum number of results per page, or items to return in a paginated \"List\" call.
395
+ # 1 is the minimum, 1000 is the maximum.
396
+ # For important details about how pagination works, see [List Pagination](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/API/Concepts/usingapi.htm#nine).
397
+ #
398
+ # Default: 1000
399
+ #
400
+ # Example: 500
401
+ #
402
+ # @option opts [String] :display_name A filter to return only resources that match the given display name exactly.
403
+ # Use this filter to list an alarm by name. Alternatively, when you know the alarm OCID, use the GetAlarm operation.
404
+ #
405
+ # @option opts [String] :lifecycle_state 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.
406
+ #
407
+ # @option opts [String] :sort_by The field to use when sorting returned alarm definitions. Only one sorting level is provided.
408
+ #
409
+ # Example: `severity`
410
+ #
411
+ # Allowed values are: displayName, severity
412
+ # @option opts [String] :sort_order The sort order to use when sorting returned alarm definitions. Ascending (ASC) or descending (DESC).
413
+ #
414
+ # Example: `ASC`
415
+ #
416
+ # Allowed values are: ASC, DESC
417
+ # @option opts [BOOLEAN] :compartment_id_in_subtree When true, returns resources from all compartments and subcompartments. The parameter can
418
+ # only be set to true when compartmentId is the tenancy OCID (the tenancy is the root compartment).
419
+ # A true value requires the user to have tenancy-level permissions. If this requirement is not met,
420
+ # then the call is rejected. When false, returns resources from only the compartment specified in
421
+ # compartmentId. Default is false.
422
+ #
423
+ # @return [Response] A Response object with data of type Array<{OCI::Monitoring::Models::AlarmSummary AlarmSummary}>
424
+ def list_alarms(compartment_id, opts = {})
425
+ logger.debug 'Calling operation MonitoringClient#list_alarms.' if logger
426
+
427
+ raise "Missing the required parameter 'compartment_id' when calling list_alarms." if compartment_id.nil?
428
+
429
+ if opts[:lifecycle_state] && !OCI::Monitoring::Models::Alarm::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state])
430
+ raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Monitoring::Models::Alarm::LIFECYCLE_STATE_ENUM.'
431
+ end
432
+
433
+ if opts[:sort_by] && !%w[displayName severity].include?(opts[:sort_by])
434
+ raise 'Invalid value for "sort_by", must be one of displayName, severity.'
435
+ end
436
+
437
+ if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
438
+ raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
439
+ end
440
+
441
+ path = '/alarms'
442
+ operation_signing_strategy = :standard
443
+
444
+ # rubocop:disable Style/NegatedIf
445
+ # Query Params
446
+ query_params = {}
447
+ query_params[:compartmentId] = compartment_id
448
+ query_params[:page] = opts[:page] if opts[:page]
449
+ query_params[:limit] = opts[:limit] if opts[:limit]
450
+ query_params[:displayName] = opts[:display_name] if opts[:display_name]
451
+ query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
452
+ query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
453
+ query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
454
+ query_params[:compartmentIdInSubtree] = opts[:compartment_id_in_subtree] if !opts[:compartment_id_in_subtree].nil?
455
+
456
+ # Header Params
457
+ header_params = {}
458
+ header_params[:accept] = 'application/json'
459
+ header_params[:'content-type'] = 'application/json'
460
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
461
+ # rubocop:enable Style/NegatedIf
462
+
463
+ post_body = nil
464
+
465
+ # rubocop:disable Metrics/BlockLength
466
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#list_alarms') do
467
+ @api_client.call_api(
468
+ :GET,
469
+ path,
470
+ endpoint,
471
+ header_params: header_params,
472
+ query_params: query_params,
473
+ operation_signing_strategy: operation_signing_strategy,
474
+ body: post_body,
475
+ return_type: 'Array<OCI::Monitoring::Models::AlarmSummary>'
476
+ )
477
+ end
478
+ # rubocop:enable Metrics/BlockLength
479
+ end
480
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
481
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
482
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
483
+
484
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
485
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
486
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
487
+
488
+
489
+ # List the status of each alarm in the specified compartment.
490
+ #
491
+ # @param [String] compartment_id The [OCID](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the
492
+ # resources monitored by the metric that you are searching for. Use tenancyId to search in
493
+ # the root compartment.
494
+ #
495
+ # @param [Hash] opts the optional parameters
496
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
497
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
498
+ # @option opts [String] :opc_request_id Customer part of the request identifier token. If you need to contact Oracle about a particular
499
+ # request, please provide the complete request ID.
500
+ #
501
+ # @option opts [BOOLEAN] :compartment_id_in_subtree When true, returns resources from all compartments and subcompartments. The parameter can
502
+ # only be set to true when compartmentId is the tenancy OCID (the tenancy is the root compartment).
503
+ # A true value requires the user to have tenancy-level permissions. If this requirement is not met,
504
+ # then the call is rejected. When false, returns resources from only the compartment specified in
505
+ # compartmentId. Default is false.
506
+ #
507
+ # @option opts [String] :page For list pagination. The value of the `opc-next-page` response header from the previous \"List\" call.
508
+ # For important details about how pagination works, see [List Pagination](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/API/Concepts/usingapi.htm#nine).
509
+ #
510
+ # @option opts [Integer] :limit For list pagination. The maximum number of results per page, or items to return in a paginated \"List\" call.
511
+ # 1 is the minimum, 1000 is the maximum.
512
+ # For important details about how pagination works, see [List Pagination](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/API/Concepts/usingapi.htm#nine).
513
+ #
514
+ # Default: 1000
515
+ #
516
+ # Example: 500
517
+ #
518
+ # @option opts [String] :display_name A filter to return only resources that match the given display name exactly.
519
+ # Use this filter to list an alarm by name. Alternatively, when you know the alarm OCID, use the GetAlarm operation.
520
+ #
521
+ # @option opts [String] :sort_by The field to use when sorting returned alarm definitions. Only one sorting level is provided.
522
+ #
523
+ # Example: `severity`
524
+ #
525
+ # Allowed values are: displayName, severity
526
+ # @option opts [String] :sort_order The sort order to use when sorting returned alarm definitions. Ascending (ASC) or descending (DESC).
527
+ #
528
+ # Example: `ASC`
529
+ #
530
+ # Allowed values are: ASC, DESC
531
+ # @return [Response] A Response object with data of type Array<{OCI::Monitoring::Models::AlarmStatusSummary AlarmStatusSummary}>
532
+ def list_alarms_status(compartment_id, opts = {})
533
+ logger.debug 'Calling operation MonitoringClient#list_alarms_status.' if logger
534
+
535
+ raise "Missing the required parameter 'compartment_id' when calling list_alarms_status." if compartment_id.nil?
536
+
537
+ if opts[:sort_by] && !%w[displayName severity].include?(opts[:sort_by])
538
+ raise 'Invalid value for "sort_by", must be one of displayName, severity.'
539
+ end
540
+
541
+ if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
542
+ raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
543
+ end
544
+
545
+ path = '/alarms/status'
546
+ operation_signing_strategy = :standard
547
+
548
+ # rubocop:disable Style/NegatedIf
549
+ # Query Params
550
+ query_params = {}
551
+ query_params[:compartmentId] = compartment_id
552
+ query_params[:compartmentIdInSubtree] = opts[:compartment_id_in_subtree] if !opts[:compartment_id_in_subtree].nil?
553
+ query_params[:page] = opts[:page] if opts[:page]
554
+ query_params[:limit] = opts[:limit] if opts[:limit]
555
+ query_params[:displayName] = opts[:display_name] if opts[:display_name]
556
+ query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
557
+ query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
558
+
559
+ # Header Params
560
+ header_params = {}
561
+ header_params[:accept] = 'application/json'
562
+ header_params[:'content-type'] = 'application/json'
563
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
564
+ # rubocop:enable Style/NegatedIf
565
+
566
+ post_body = nil
567
+
568
+ # rubocop:disable Metrics/BlockLength
569
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#list_alarms_status') do
570
+ @api_client.call_api(
571
+ :GET,
572
+ path,
573
+ endpoint,
574
+ header_params: header_params,
575
+ query_params: query_params,
576
+ operation_signing_strategy: operation_signing_strategy,
577
+ body: post_body,
578
+ return_type: 'Array<OCI::Monitoring::Models::AlarmStatusSummary>'
579
+ )
580
+ end
581
+ # rubocop:enable Metrics/BlockLength
582
+ end
583
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
584
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
585
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
586
+
587
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
588
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
589
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
590
+
591
+
592
+ # Returns metric definitions that match the criteria specified in the request. Compartment OCID required.
593
+ # For information about metrics, see [Metrics Overview](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#MetricsOverview).
594
+ #
595
+ # @param [String] compartment_id The [OCID](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the
596
+ # resources monitored by the metric that you are searching for. Use tenancyId to search in
597
+ # the root compartment.
598
+ #
599
+ # @param [OCI::Monitoring::Models::ListMetricsDetails] list_metrics_details The dimensions used to filter metrics.
600
+ # @param [Hash] opts the optional parameters
601
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
602
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
603
+ # @option opts [String] :opc_request_id Customer part of the request identifier token. If you need to contact Oracle about a particular
604
+ # request, please provide the complete request ID.
605
+ #
606
+ # @option opts [String] :page For list pagination. The value of the `opc-next-page` response header from the previous \"List\" call.
607
+ # For important details about how pagination works, see [List Pagination](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/API/Concepts/usingapi.htm#nine).
608
+ #
609
+ # @option opts [Integer] :limit For list pagination. The maximum number of results per page, or items to return in a paginated \"List\" call.
610
+ # 1 is the minimum, 1000 is the maximum.
611
+ # For important details about how pagination works, see [List Pagination](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/API/Concepts/usingapi.htm#nine).
612
+ #
613
+ # Default: 1000
614
+ #
615
+ # Example: 500
616
+ #
617
+ # @option opts [BOOLEAN] :compartment_id_in_subtree When true, returns resources from all compartments and subcompartments. The parameter can
618
+ # only be set to true when compartmentId is the tenancy OCID (the tenancy is the root compartment).
619
+ # A true value requires the user to have tenancy-level permissions. If this requirement is not met,
620
+ # then the call is rejected. When false, returns resources from only the compartment specified in
621
+ # compartmentId. Default is false.
622
+ #
623
+ # @return [Response] A Response object with data of type Array<{OCI::Monitoring::Models::Metric Metric}>
624
+ def list_metrics(compartment_id, list_metrics_details, opts = {})
625
+ logger.debug 'Calling operation MonitoringClient#list_metrics.' if logger
626
+
627
+ raise "Missing the required parameter 'compartment_id' when calling list_metrics." if compartment_id.nil?
628
+ raise "Missing the required parameter 'list_metrics_details' when calling list_metrics." if list_metrics_details.nil?
629
+
630
+ path = '/metrics/actions/listMetrics'
631
+ operation_signing_strategy = :standard
632
+
633
+ # rubocop:disable Style/NegatedIf
634
+ # Query Params
635
+ query_params = {}
636
+ query_params[:compartmentId] = compartment_id
637
+ query_params[:page] = opts[:page] if opts[:page]
638
+ query_params[:limit] = opts[:limit] if opts[:limit]
639
+ query_params[:compartmentIdInSubtree] = opts[:compartment_id_in_subtree] if !opts[:compartment_id_in_subtree].nil?
640
+
641
+ # Header Params
642
+ header_params = {}
643
+ header_params[:accept] = 'application/json'
644
+ header_params[:'content-type'] = 'application/json'
645
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
646
+ # rubocop:enable Style/NegatedIf
647
+
648
+ post_body = @api_client.object_to_http_body(list_metrics_details)
649
+
650
+ # rubocop:disable Metrics/BlockLength
651
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#list_metrics') do
652
+ @api_client.call_api(
653
+ :POST,
654
+ path,
655
+ endpoint,
656
+ header_params: header_params,
657
+ query_params: query_params,
658
+ operation_signing_strategy: operation_signing_strategy,
659
+ body: post_body,
660
+ return_type: 'Array<OCI::Monitoring::Models::Metric>'
661
+ )
662
+ end
663
+ # rubocop:enable Metrics/BlockLength
664
+ end
665
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
666
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
667
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
668
+
669
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
670
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
671
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
672
+
673
+
674
+ # Publishes raw metric data points to the Monitoring service.
675
+ # For more information about publishing metrics, see [Publishing Custom Metrics](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/Monitoring/Tasks/publishingcustommetrics.htm).
676
+ #
677
+ # 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:
678
+ #
679
+ # https://telemetry-ingestion.eu-frankfurt-1.oraclecloud.com
680
+ #
681
+ # @param [OCI::Monitoring::Models::PostMetricDataDetails] post_metric_data_details An array of metric objects containing raw metric data points to be posted to the Monitoring service.
682
+ #
683
+ # @param [Hash] opts the optional parameters
684
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
685
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
686
+ # @option opts [String] :opc_request_id Customer part of the request identifier token. If you need to contact Oracle about a particular
687
+ # request, please provide the complete request ID.
688
+ #
689
+ # @return [Response] A Response object with data of type {OCI::Monitoring::Models::PostMetricDataResponseDetails PostMetricDataResponseDetails}
690
+ def post_metric_data(post_metric_data_details, opts = {})
691
+ logger.debug 'Calling operation MonitoringClient#post_metric_data.' if logger
692
+
693
+ raise "Missing the required parameter 'post_metric_data_details' when calling post_metric_data." if post_metric_data_details.nil?
694
+
695
+ path = '/metrics'
696
+ operation_signing_strategy = :standard
697
+
698
+ # rubocop:disable Style/NegatedIf
699
+ # Query Params
700
+ query_params = {}
701
+
702
+ # Header Params
703
+ header_params = {}
704
+ header_params[:accept] = 'application/json'
705
+ header_params[:'content-type'] = 'application/json'
706
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
707
+ # rubocop:enable Style/NegatedIf
708
+
709
+ post_body = @api_client.object_to_http_body(post_metric_data_details)
710
+
711
+ # rubocop:disable Metrics/BlockLength
712
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#post_metric_data') do
713
+ @api_client.call_api(
714
+ :POST,
715
+ path,
716
+ endpoint,
717
+ header_params: header_params,
718
+ query_params: query_params,
719
+ operation_signing_strategy: operation_signing_strategy,
720
+ body: post_body,
721
+ return_type: 'OCI::Monitoring::Models::PostMetricDataResponseDetails'
722
+ )
723
+ end
724
+ # rubocop:enable Metrics/BlockLength
725
+ end
726
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
727
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
728
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
729
+
730
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
731
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
732
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
733
+
734
+
735
+ # Removes any existing suppression for the specified alarm.
736
+ #
737
+ # @param [String] alarm_id The [OCID](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm) of an alarm.
738
+ #
739
+ # @param [Hash] opts the optional parameters
740
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
741
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
742
+ # @option opts [String] :opc_request_id Customer part of the request identifier token. If you need to contact Oracle about a particular
743
+ # request, please provide the complete request ID.
744
+ #
745
+ # @return [Response] A Response object with data of type nil
746
+ def remove_alarm_suppression(alarm_id, opts = {})
747
+ logger.debug 'Calling operation MonitoringClient#remove_alarm_suppression.' if logger
748
+
749
+ raise "Missing the required parameter 'alarm_id' when calling remove_alarm_suppression." if alarm_id.nil?
750
+ raise "Parameter value for 'alarm_id' must not be blank" if OCI::Internal::Util.blank_string?(alarm_id)
751
+
752
+ path = '/alarms/{alarmId}/actions/removeSuppression'.sub('{alarmId}', alarm_id.to_s)
753
+ operation_signing_strategy = :standard
754
+
755
+ # rubocop:disable Style/NegatedIf
756
+ # Query Params
757
+ query_params = {}
758
+
759
+ # Header Params
760
+ header_params = {}
761
+ header_params[:accept] = 'application/json'
762
+ header_params[:'content-type'] = 'application/json'
763
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
764
+ # rubocop:enable Style/NegatedIf
765
+
766
+ post_body = nil
767
+
768
+ # rubocop:disable Metrics/BlockLength
769
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#remove_alarm_suppression') do
770
+ @api_client.call_api(
771
+ :POST,
772
+ path,
773
+ endpoint,
774
+ header_params: header_params,
775
+ query_params: query_params,
776
+ operation_signing_strategy: operation_signing_strategy,
777
+ body: post_body
778
+ )
779
+ end
780
+ # rubocop:enable Metrics/BlockLength
781
+ end
782
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
783
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
784
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
785
+
786
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
787
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
788
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
789
+
790
+
791
+ # Returns aggregated data that match the criteria specified in the request. Compartment OCID required.
792
+ # For information on metric queries, see [Building Metric Queries](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/Monitoring/Tasks/buildingqueries.htm).
793
+ #
794
+ # @param [String] compartment_id The [OCID](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the
795
+ # resources monitored by the metric that you are searching for. Use tenancyId to search in
796
+ # the root compartment.
797
+ #
798
+ # @param [OCI::Monitoring::Models::SummarizeMetricsDataDetails] summarize_metrics_data_details The dimensions used to filter for metrics.
799
+ # @param [Hash] opts the optional parameters
800
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
801
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
802
+ # @option opts [String] :opc_request_id Customer part of the request identifier token. If you need to contact Oracle about a particular
803
+ # request, please provide the complete request ID.
804
+ #
805
+ # @option opts [BOOLEAN] :compartment_id_in_subtree When true, returns resources from all compartments and subcompartments. The parameter can
806
+ # only be set to true when compartmentId is the tenancy OCID (the tenancy is the root compartment).
807
+ # A true value requires the user to have tenancy-level permissions. If this requirement is not met,
808
+ # then the call is rejected. When false, returns resources from only the compartment specified in
809
+ # compartmentId. Default is false.
810
+ #
811
+ # @return [Response] A Response object with data of type Array<{OCI::Monitoring::Models::MetricData MetricData}>
812
+ def summarize_metrics_data(compartment_id, summarize_metrics_data_details, opts = {})
813
+ logger.debug 'Calling operation MonitoringClient#summarize_metrics_data.' if logger
814
+
815
+ raise "Missing the required parameter 'compartment_id' when calling summarize_metrics_data." if compartment_id.nil?
816
+ raise "Missing the required parameter 'summarize_metrics_data_details' when calling summarize_metrics_data." if summarize_metrics_data_details.nil?
817
+
818
+ path = '/metrics/actions/summarizeMetricsData'
819
+ operation_signing_strategy = :standard
820
+
821
+ # rubocop:disable Style/NegatedIf
822
+ # Query Params
823
+ query_params = {}
824
+ query_params[:compartmentId] = compartment_id
825
+ query_params[:compartmentIdInSubtree] = opts[:compartment_id_in_subtree] if !opts[:compartment_id_in_subtree].nil?
826
+
827
+ # Header Params
828
+ header_params = {}
829
+ header_params[:accept] = 'application/json'
830
+ header_params[:'content-type'] = 'application/json'
831
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
832
+ # rubocop:enable Style/NegatedIf
833
+
834
+ post_body = @api_client.object_to_http_body(summarize_metrics_data_details)
835
+
836
+ # rubocop:disable Metrics/BlockLength
837
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#summarize_metrics_data') do
838
+ @api_client.call_api(
839
+ :POST,
840
+ path,
841
+ endpoint,
842
+ header_params: header_params,
843
+ query_params: query_params,
844
+ operation_signing_strategy: operation_signing_strategy,
845
+ body: post_body,
846
+ return_type: 'Array<OCI::Monitoring::Models::MetricData>'
847
+ )
848
+ end
849
+ # rubocop:enable Metrics/BlockLength
850
+ end
851
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
852
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
853
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
854
+
855
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
856
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
857
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
858
+
859
+
860
+ # Updates the specified alarm.
861
+ #
862
+ # @param [String] alarm_id The [OCID](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm) of an alarm.
863
+ #
864
+ # @param [OCI::Monitoring::Models::UpdateAlarmDetails] update_alarm_details Document for updating an alarm.
865
+ # @param [Hash] opts the optional parameters
866
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
867
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
868
+ # @option opts [String] :opc_request_id Customer part of the request identifier token. If you need to contact Oracle about a particular
869
+ # request, please provide the complete request ID.
870
+ #
871
+ # @return [Response] A Response object with data of type {OCI::Monitoring::Models::Alarm Alarm}
872
+ def update_alarm(alarm_id, update_alarm_details, opts = {})
873
+ logger.debug 'Calling operation MonitoringClient#update_alarm.' if logger
874
+
875
+ raise "Missing the required parameter 'alarm_id' when calling update_alarm." if alarm_id.nil?
876
+ raise "Missing the required parameter 'update_alarm_details' when calling update_alarm." if update_alarm_details.nil?
877
+ raise "Parameter value for 'alarm_id' must not be blank" if OCI::Internal::Util.blank_string?(alarm_id)
878
+
879
+ path = '/alarms/{alarmId}'.sub('{alarmId}', alarm_id.to_s)
880
+ operation_signing_strategy = :standard
881
+
882
+ # rubocop:disable Style/NegatedIf
883
+ # Query Params
884
+ query_params = {}
885
+
886
+ # Header Params
887
+ header_params = {}
888
+ header_params[:accept] = 'application/json'
889
+ header_params[:'content-type'] = 'application/json'
890
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
891
+ # rubocop:enable Style/NegatedIf
892
+
893
+ post_body = @api_client.object_to_http_body(update_alarm_details)
894
+
895
+ # rubocop:disable Metrics/BlockLength
896
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'MonitoringClient#update_alarm') do
897
+ @api_client.call_api(
898
+ :PUT,
899
+ path,
900
+ endpoint,
901
+ header_params: header_params,
902
+ query_params: query_params,
903
+ operation_signing_strategy: operation_signing_strategy,
904
+ body: post_body,
905
+ return_type: 'OCI::Monitoring::Models::Alarm'
906
+ )
907
+ end
908
+ # rubocop:enable Metrics/BlockLength
909
+ end
910
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
911
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
912
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
913
+
914
+ private
915
+
916
+ def applicable_retry_config(opts = {})
917
+ return @retry_config unless opts.key?(:retry_config)
918
+
919
+ opts[:retry_config]
920
+ end
921
+ end
922
+ end
923
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength