Class: OCI::Budget::CostAdClient

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/budget/cost_ad_client.rb

Overview

Use the Budgets API to manage budgets and budget alerts. For more information, see Budgets Overview.

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) ⇒ CostAdClient

Creates a new CostAdClient. 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



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/oci/budget/cost_ad_client.rb', line 55

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 + '/20190111'
  else
    region ||= config.region
    region ||= signer.region if signer.respond_to?(:region)
    self.region = region
  end
  logger.info "CostAdClient endpoint set to '#{@endpoint}'." if logger
end

Instance Attribute Details

#api_clientOCI::ApiClient (readonly)

Client used to make HTTP requests.

Returns:



15
16
17
# File 'lib/oci/budget/cost_ad_client.rb', line 15

def api_client
  @api_client
end

#endpointString (readonly)

Fully qualified endpoint URL

Returns:

  • (String)


19
20
21
# File 'lib/oci/budget/cost_ad_client.rb', line 19

def endpoint
  @endpoint
end

#regionString

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

Returns:

  • (String)


29
30
31
# File 'lib/oci/budget/cost_ad_client.rb', line 29

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



25
26
27
# File 'lib/oci/budget/cost_ad_client.rb', line 25

def retry_config
  @retry_config
end

Instance Method Details

#create_cost_alert_subscription(create_cost_alert_subscription_details, opts = {}) ⇒ Response

Note:

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

Creates a new CostAlert Subscription.

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_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.

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



118
119
120
121
122
123
124
125
126
127
128
129
130
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
# File 'lib/oci/budget/cost_ad_client.rb', line 118

def create_cost_alert_subscription(create_cost_alert_subscription_details, opts = {})
  logger.debug 'Calling operation CostAdClient#create_cost_alert_subscription.' if logger

  raise "Missing the required parameter 'create_cost_alert_subscription_details' when calling create_cost_alert_subscription." if create_cost_alert_subscription_details.nil?

  path = '/costAlertSubscriptions'
  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-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(create_cost_alert_subscription_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'CostAdClient#create_cost_alert_subscription') 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::Budget::Models::CostAlertSubscription'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#create_cost_anomaly_monitor(create_cost_anomaly_monitor_details, opts = {}) ⇒ Response

Note:

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

Creates a new costAnomaly Monitor.

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_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.

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/oci/budget/cost_ad_client.rb', line 180

def create_cost_anomaly_monitor(create_cost_anomaly_monitor_details, opts = {})
  logger.debug 'Calling operation CostAdClient#create_cost_anomaly_monitor.' if logger

  raise "Missing the required parameter 'create_cost_anomaly_monitor_details' when calling create_cost_anomaly_monitor." if create_cost_anomaly_monitor_details.nil?

  path = '/costAnomalyMonitors'
  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-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(create_cost_anomaly_monitor_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'CostAdClient#create_cost_anomaly_monitor') 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::Budget::Models::CostAnomalyMonitor'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#delete_cost_alert_subscription(cost_alert_subscription_id, opts = {}) ⇒ Response

Note:

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

Deletes a specified CostAlertSubscription resource.

Parameters:

  • cost_alert_subscription_id (String)

    The unique costAlertSubscription OCID.

  • 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)

    The client request ID for tracing.

Returns:

  • (Response)

    A Response object with data of type nil



241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# File 'lib/oci/budget/cost_ad_client.rb', line 241

def delete_cost_alert_subscription(cost_alert_subscription_id, opts = {})
  logger.debug 'Calling operation CostAdClient#delete_cost_alert_subscription.' if logger

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

  path = '/costAlertSubscriptions/{costAlertSubscriptionId}'.sub('{costAlertSubscriptionId}', cost_alert_subscription_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: 'CostAdClient#delete_cost_alert_subscription') 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_cost_anomaly_monitor(cost_anomaly_monitor_id, opts = {}) ⇒ Response

Note:

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

Deletes a specified CostAnomalyMonitor resource.

Parameters:

  • cost_anomaly_monitor_id (String)

    The unique costAnomalyMonitor OCID.

  • 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)

    The client request ID for tracing.

Returns:

  • (Response)

    A Response object with data of type nil



301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
# File 'lib/oci/budget/cost_ad_client.rb', line 301

def delete_cost_anomaly_monitor(cost_anomaly_monitor_id, opts = {})
  logger.debug 'Calling operation CostAdClient#delete_cost_anomaly_monitor.' if logger

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

  path = '/costAnomalyMonitors/{costAnomalyMonitorId}'.sub('{costAnomalyMonitorId}', cost_anomaly_monitor_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: 'CostAdClient#delete_cost_anomaly_monitor') 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

#disable_cost_anomaly_monitor(cost_anomaly_monitor_id, opts = {}) ⇒ Response

Note:

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

Disables the cost anomaly monitor. This stops cost anomaly detection for targeted resource(s).

Parameters:

  • cost_anomaly_monitor_id (String)

    The unique costAnomalyMonitor OCID.

  • 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)

    The client request ID for tracing.

  • :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:



367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
# File 'lib/oci/budget/cost_ad_client.rb', line 367

def disable_cost_anomaly_monitor(cost_anomaly_monitor_id, opts = {})
  logger.debug 'Calling operation CostAdClient#disable_cost_anomaly_monitor.' if logger

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

  path = '/costAnomalyMonitors/{costAnomalyMonitorId}/actions/disable'.sub('{costAnomalyMonitorId}', cost_anomaly_monitor_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 = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'CostAdClient#disable_cost_anomaly_monitor') 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::Budget::Models::CostAnomalyMonitor'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#enable_cost_anomaly_monitor(cost_anomaly_monitor_id, opts = {}) ⇒ Response

Note:

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

Enables the cost anomaly monitor. This (re)starts the cost anomaly detection for targeted resource(s).

Parameters:

  • cost_anomaly_monitor_id (String)

    The unique costAnomalyMonitor OCID.

  • 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)

    The client request ID for tracing.

  • :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:



436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
# File 'lib/oci/budget/cost_ad_client.rb', line 436

def enable_cost_anomaly_monitor(cost_anomaly_monitor_id, opts = {})
  logger.debug 'Calling operation CostAdClient#enable_cost_anomaly_monitor.' if logger

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

  path = '/costAnomalyMonitors/{costAnomalyMonitorId}/actions/enable'.sub('{costAnomalyMonitorId}', cost_anomaly_monitor_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 = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'CostAdClient#enable_cost_anomaly_monitor') 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::Budget::Models::CostAnomalyMonitor'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_cost_alert_subscription(cost_alert_subscription_id, opts = {}) ⇒ Response

Note:

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

Gets a CostAlertSubscription by the identifier.

Parameters:

  • cost_alert_subscription_id (String)

    The unique costAlertSubscription OCID.

  • 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)

    The client request ID for tracing.

Returns:



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
524
525
526
527
528
529
# File 'lib/oci/budget/cost_ad_client.rb', line 493

def get_cost_alert_subscription(cost_alert_subscription_id, opts = {})
  logger.debug 'Calling operation CostAdClient#get_cost_alert_subscription.' if logger

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

  path = '/costAlertSubscriptions/{costAlertSubscriptionId}'.sub('{costAlertSubscriptionId}', cost_alert_subscription_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: 'CostAdClient#get_cost_alert_subscription') 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::Budget::Models::CostAlertSubscription'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_cost_anomaly_event(cost_anomaly_event_id, opts = {}) ⇒ Response

Note:

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

Gets a CostAnomalyEvent by the identifier.

Parameters:

  • cost_anomaly_event_id (String)

    The unique costAnomalyEventId OCID.

  • 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)

    The client request ID for tracing.

Returns:



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
574
575
576
577
578
579
580
581
582
583
# File 'lib/oci/budget/cost_ad_client.rb', line 547

def get_cost_anomaly_event(cost_anomaly_event_id, opts = {})
  logger.debug 'Calling operation CostAdClient#get_cost_anomaly_event.' if logger

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

  path = '/costAnomalyEvents/{costAnomalyEventId}'.sub('{costAnomalyEventId}', cost_anomaly_event_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: 'CostAdClient#get_cost_anomaly_event') 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::Budget::Models::CostAnomalyEvent'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_cost_anomaly_monitor(cost_anomaly_monitor_id, opts = {}) ⇒ Response

Note:

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

Gets a CostAnomalyMonitor by the identifier.

Parameters:

  • cost_anomaly_monitor_id (String)

    The unique costAnomalyMonitor OCID.

  • 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)

    The client request ID for tracing.

Returns:



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
626
627
628
629
630
631
632
633
634
635
636
637
# File 'lib/oci/budget/cost_ad_client.rb', line 601

def get_cost_anomaly_monitor(cost_anomaly_monitor_id, opts = {})
  logger.debug 'Calling operation CostAdClient#get_cost_anomaly_monitor.' if logger

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

  path = '/costAnomalyMonitors/{costAnomalyMonitorId}'.sub('{costAnomalyMonitorId}', cost_anomaly_monitor_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: 'CostAdClient#get_cost_anomaly_monitor') 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::Budget::Models::CostAnomalyMonitor'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

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

Note:

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

Gets a list of Cost Alert Subscription in a compartment.

Parameters:

  • compartment_id (String)

    The ID of the compartment in which to list resources.

  • 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

  • :limit (Integer)

    The maximum number of items to return. (default to 25)

  • :page (String)

    The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.

  • :sort_order (String)

    The sort order to use, either 'asc' or 'desc'.

  • :sort_by (String)

    The field to sort by. If not specified, the default is timeCreated. The default sort order for timeCreated is DESC. The default sort order for displayName is ASC in alphanumeric order. (default to timeCreated)

  • :name (String)

    Unique, non-changeable resource name.

  • :lifecycle_state (String)

    The current state of the cost alert subscription.

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



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
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
# File 'lib/oci/budget/cost_ad_client.rb', line 666

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

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

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

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

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

  path = '/costAlertSubscriptions'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:name] = opts[:name] if opts[:name]
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]

  # 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: 'CostAdClient#list_cost_alert_subscriptions') 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::Budget::Models::CostAlertSubscriptionCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

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

Note:

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

Gets a list of Cost Anomaly Event in a compartment.

Parameters:

  • compartment_id (String)

    The ID of the compartment in which to list resources.

  • 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

  • :limit (Integer)

    The maximum number of items to return. (default to 25)

  • :page (String)

    The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.

  • :sort_order (String)

    The sort order to use, either 'asc' or 'desc'.

  • :sort_by (String)

    The field to sort by. If not specified, the default is timeAnomalyEventDate. The default sort order for timeAnomalyEventDate is DESC. The default sort order for costAnomalyName is ASC in alphanumeric order. (default to timeAnomalyEventDate)

  • :name (String)

    Unique, non-changeable resource name.

  • :cost_anomaly_monitor_id (String)

    The cost monitor ocid.

  • :target_tenant_id (Array<String>)

    The target tenantId ocid filter param.

  • :time_anomaly_event_start_date (DateTime)

    startDate for anomaly event date.

  • :time_anomaly_event_end_date (DateTime)

    endDate for anomaly event date.

  • :region (Array<String>)

    region of the anomaly event.

  • :cost_impact (Float)

    cost impact (absolute) of the anomaly event.

  • :cost_impact_percentage (Float)

    cost impact (percentage) of the anomaly event.

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
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
# File 'lib/oci/budget/cost_ad_client.rb', line 755

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

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

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

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

  path = '/costAnomalyEvents'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:name] = opts[:name] if opts[:name]
  query_params[:costAnomalyMonitorId] = opts[:cost_anomaly_monitor_id] if opts[:cost_anomaly_monitor_id]
  query_params[:targetTenantId] = OCI::ApiClient.build_collection_params(opts[:target_tenant_id], :csv) if opts[:target_tenant_id] && !opts[:target_tenant_id].empty?
  query_params[:timeAnomalyEventStartDate] = opts[:time_anomaly_event_start_date] if opts[:time_anomaly_event_start_date]
  query_params[:timeAnomalyEventEndDate] = opts[:time_anomaly_event_end_date] if opts[:time_anomaly_event_end_date]
  query_params[:region] = OCI::ApiClient.build_collection_params(opts[:region], :csv) if opts[:region] && !opts[:region].empty?
  query_params[:costImpact] = opts[:cost_impact] if opts[:cost_impact]
  query_params[:costImpactPercentage] = opts[:cost_impact_percentage] if opts[:cost_impact_percentage]

  # 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: 'CostAdClient#list_cost_anomaly_events') 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::Budget::Models::CostAnomalyEventCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

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

Note:

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

Gets a list of Cost Anomaly Monitors in a compartment.

Parameters:

  • compartment_id (String)

    The ID of the compartment in which to list resources.

  • 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

  • :limit (Integer)

    The maximum number of items to return. (default to 25)

  • :page (String)

    The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.

  • :sort_order (String)

    The sort order to use, either 'asc' or 'desc'.

  • :sort_by (String)

    The field to sort by. If not specified, the default is timeCreated. The default sort order for timeCreated is DESC. The default sort order for displayName is ASC in alphanumeric order. (default to timeCreated)

  • :lifecycle_state (String)

    The current state of the cost monitor.

  • :name (String)

    Unique, non-changeable resource name.

  • :target_tenant_id (Array<String>)

    The target tenantId ocid filter param.

  • :region (Array<String>)

    Cost Anomaly Monitor target resource filter region.

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
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
# File 'lib/oci/budget/cost_ad_client.rb', line 842

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

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

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

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

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

  path = '/costAnomalyMonitors'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  query_params[:name] = opts[:name] if opts[:name]
  query_params[:targetTenantId] = OCI::ApiClient.build_collection_params(opts[:target_tenant_id], :csv) if opts[:target_tenant_id] && !opts[:target_tenant_id].empty?
  query_params[:region] = OCI::ApiClient.build_collection_params(opts[:region], :csv) if opts[:region] && !opts[:region].empty?

  # 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: 'CostAdClient#list_cost_anomaly_monitors') 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::Budget::Models::CostAnomalyMonitorCollection'
    )
  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.



94
95
96
# File 'lib/oci/budget/cost_ad_client.rb', line 94

def logger
  @api_client.config.logger
end

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

Note:

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

Gets a list of Cost Anomaly Events analytics summary - aggregated metrics for a given time period.

Parameters:

  • compartment_id (String)

    The ID of the compartment in which to list resources.

  • 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

  • :limit (Integer)

    The maximum number of items to return. (default to 25)

  • :page (String)

    The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.

  • :sort_order (String)

    The sort order to use, either 'asc' or 'desc'.

  • :sort_by (String)

    The field to sort by. If not specified, the default is timeAnomalyEventDate. The default sort order for timeAnomalyEventDate is DESC. The default sort order for costAnomalyName is ASC in alphanumeric order. (default to timeAnomalyEventDate)

  • :name (String)

    Unique, non-changeable resource name.

  • :cost_anomaly_monitor_id (String)

    The cost monitor ocid.

  • :target_tenant_id (Array<String>)

    The target tenantId ocid filter param.

  • :time_anomaly_event_start_date (DateTime)

    startDate for anomaly event date.

  • :time_anomaly_event_end_date (DateTime)

    endDate for anomaly event date.

  • :region (Array<String>)

    region of the anomaly event.

  • :cost_impact (Float)

    cost impact (absolute) of the anomaly event.

  • :cost_impact_percentage (Float)

    cost impact (percentage) of the anomaly event.

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



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
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
# File 'lib/oci/budget/cost_ad_client.rb', line 933

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

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

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

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

  path = '/costAnomalyEventAnalytics'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:name] = opts[:name] if opts[:name]
  query_params[:costAnomalyMonitorId] = opts[:cost_anomaly_monitor_id] if opts[:cost_anomaly_monitor_id]
  query_params[:targetTenantId] = OCI::ApiClient.build_collection_params(opts[:target_tenant_id], :csv) if opts[:target_tenant_id] && !opts[:target_tenant_id].empty?
  query_params[:timeAnomalyEventStartDate] = opts[:time_anomaly_event_start_date] if opts[:time_anomaly_event_start_date]
  query_params[:timeAnomalyEventEndDate] = opts[:time_anomaly_event_end_date] if opts[:time_anomaly_event_end_date]
  query_params[:region] = OCI::ApiClient.build_collection_params(opts[:region], :csv) if opts[:region] && !opts[:region].empty?
  query_params[:costImpact] = opts[:cost_impact] if opts[:cost_impact]
  query_params[:costImpactPercentage] = opts[:cost_impact_percentage] if opts[:cost_impact_percentage]

  # 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: 'CostAdClient#summarize_cost_anomaly_event_analytics') 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::Budget::Models::CostAnomalyEventAnalyticCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_cost_alert_subscription(cost_alert_subscription_id, update_cost_alert_subscription_details, opts = {}) ⇒ Response

Note:

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

Update a CostAlertSubscription identified by the OCID.

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)

    The client request ID for tracing.

Returns:



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
1045
1046
1047
1048
1049
1050
1051
1052
# File 'lib/oci/budget/cost_ad_client.rb', line 1014

def update_cost_alert_subscription(cost_alert_subscription_id, update_cost_alert_subscription_details, opts = {})
  logger.debug 'Calling operation CostAdClient#update_cost_alert_subscription.' if logger

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

  path = '/costAlertSubscriptions/{costAlertSubscriptionId}'.sub('{costAlertSubscriptionId}', cost_alert_subscription_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_cost_alert_subscription_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'CostAdClient#update_cost_alert_subscription') 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::Budget::Models::CostAlertSubscription'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_cost_anomaly_event(cost_anomaly_event_id, update_cost_anomaly_event_details, opts = {}) ⇒ Response

Note:

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

Update a CostAnomalyEvent identified by the OCID.

Parameters:

  • cost_anomaly_event_id (String)

    The unique costAnomalyEventId OCID.

  • update_cost_anomaly_event_details (OCI::Budget::Models::UpdateCostAnomalyEventDetails)

    The information to be updated.

  • 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)

    The client request ID for tracing.

Returns:



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
1115
# File 'lib/oci/budget/cost_ad_client.rb', line 1077

def update_cost_anomaly_event(cost_anomaly_event_id, update_cost_anomaly_event_details, opts = {})
  logger.debug 'Calling operation CostAdClient#update_cost_anomaly_event.' if logger

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

  path = '/costAnomalyEvents/{costAnomalyEventId}'.sub('{costAnomalyEventId}', cost_anomaly_event_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_cost_anomaly_event_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'CostAdClient#update_cost_anomaly_event') 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::Budget::Models::CostAnomalyEvent'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_cost_anomaly_monitor(cost_anomaly_monitor_id, update_cost_anomaly_monitor_details, opts = {}) ⇒ Response

Note:

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

Update a CostAnomalyMonitor identified by the OCID.

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)

    The client request ID for tracing.

Returns:



1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
# File 'lib/oci/budget/cost_ad_client.rb', line 1140

def update_cost_anomaly_monitor(cost_anomaly_monitor_id, update_cost_anomaly_monitor_details, opts = {})
  logger.debug 'Calling operation CostAdClient#update_cost_anomaly_monitor.' if logger

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

  path = '/costAnomalyMonitors/{costAnomalyMonitorId}'.sub('{costAnomalyMonitorId}', cost_anomaly_monitor_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_cost_anomaly_monitor_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'CostAdClient#update_cost_anomaly_monitor') 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::Budget::Models::CostAnomalyMonitor'
    )
  end
  # rubocop:enable Metrics/BlockLength
end