Class: OCI::UsageApi::UsageapiClient

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/usage_api/usageapi_client.rb

Overview

Use the Usage API to view your Oracle Cloud usage and costs. The API allows you to request data that meets the specified filter criteria, and to group that data by the chosen dimension. The Usage API is used by the Cost Analysis and Carbon Emissions Analysis tools in the Console. See Cost Analysis Overview and Using the Usage API for more information.

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

Creates a new UsageapiClient. 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/usage_api/usageapi_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 + '/20200107'
  else
    region ||= config.region
    region ||= signer.region if signer.respond_to?(:region)
    self.region = region
  end
  logger.info "UsageapiClient 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/usage_api/usageapi_client.rb', line 15

def api_client
  @api_client
end

#endpointString (readonly)

Fully qualified endpoint URL

Returns:

  • (String)


19
20
21
# File 'lib/oci/usage_api/usageapi_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/usage_api/usageapi_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/usage_api/usageapi_client.rb', line 25

def retry_config
  @retry_config
end

Instance Method Details

#create_custom_table(create_custom_table_details, opts = {}) ⇒ Response

Note:

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

Returns the created custom table.

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)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :opc_retry_token (String)

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

Returns:



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
156
157
# File 'lib/oci/usage_api/usageapi_client.rb', line 120

def create_custom_table(create_custom_table_details, opts = {})
  logger.debug 'Calling operation UsageapiClient#create_custom_table.' if logger

  raise "Missing the required parameter 'create_custom_table_details' when calling create_custom_table." if create_custom_table_details.nil?

  path = '/customTables'
  operation_signing_strategy = :standard

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

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

  post_body = @api_client.object_to_http_body(create_custom_table_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'UsageapiClient#create_custom_table') 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::UsageApi::Models::CustomTable'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#create_email_recipients_group(create_email_recipients_group_details, subscription_id, opts = {}) ⇒ Response

Note:

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

Add a list of email recipients that can receive usage statements for the 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_request_id (String)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :opc_retry_token (String)

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

Returns:



185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/oci/usage_api/usageapi_client.rb', line 185

def create_email_recipients_group(create_email_recipients_group_details, subscription_id, opts = {})
  logger.debug 'Calling operation UsageapiClient#create_email_recipients_group.' if logger

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

  path = '/usageStatements/{subscriptionId}/emailRecipientsGroups'.sub('{subscriptionId}', 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]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(create_email_recipients_group_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'UsageapiClient#create_email_recipients_group') 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::UsageApi::Models::EmailRecipientsGroup'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#create_query(create_query_details, opts = {}) ⇒ Response

Note:

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

Returns the created query.

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)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :opc_retry_token (String)

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

Returns:



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
278
279
280
281
282
283
284
285
286
287
288
# File 'lib/oci/usage_api/usageapi_client.rb', line 251

def create_query(create_query_details, opts = {})
  logger.debug 'Calling operation UsageapiClient#create_query.' if logger

  raise "Missing the required parameter 'create_query_details' when calling create_query." if create_query_details.nil?

  path = '/queries'
  operation_signing_strategy = :standard

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

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

  post_body = @api_client.object_to_http_body(create_query_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'UsageapiClient#create_query') 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::UsageApi::Models::Query'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#create_schedule(create_schedule_details, opts = {}) ⇒ Response

Note:

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

Returns the created schedule.

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)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :opc_retry_token (String)

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

Returns:



315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
# File 'lib/oci/usage_api/usageapi_client.rb', line 315

def create_schedule(create_schedule_details, opts = {})
  logger.debug 'Calling operation UsageapiClient#create_schedule.' if logger

  raise "Missing the required parameter 'create_schedule_details' when calling create_schedule." if create_schedule_details.nil?

  path = '/schedules'
  operation_signing_strategy = :standard

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

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

  post_body = @api_client.object_to_http_body(create_schedule_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'UsageapiClient#create_schedule') 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::UsageApi::Models::Schedule'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#create_usage_carbon_emissions_query(create_usage_carbon_emissions_query_details, opts = {}) ⇒ Response

Note:

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

Returns the created usage carbon emissions query.

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)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :opc_retry_token (String)

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

Returns:



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
407
408
409
410
411
412
413
414
415
416
# File 'lib/oci/usage_api/usageapi_client.rb', line 379

def create_usage_carbon_emissions_query(create_usage_carbon_emissions_query_details, opts = {})
  logger.debug 'Calling operation UsageapiClient#create_usage_carbon_emissions_query.' if logger

  raise "Missing the required parameter 'create_usage_carbon_emissions_query_details' when calling create_usage_carbon_emissions_query." if create_usage_carbon_emissions_query_details.nil?

  path = '/usageCarbonEmissionsQueries'
  operation_signing_strategy = :standard

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

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

  post_body = @api_client.object_to_http_body(create_usage_carbon_emissions_query_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'UsageapiClient#create_usage_carbon_emissions_query') 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::UsageApi::Models::UsageCarbonEmissionsQuery'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#delete_custom_table(custom_table_id, opts = {}) ⇒ Response

Note:

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

Delete a saved custom table by the OCID.

Parameters:

  • custom_table_id (String)

    The custom table unique 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)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :if_match (String)

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

Returns:

  • (Response)

    A Response object with data of type nil



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
476
477
478
479
# File 'lib/oci/usage_api/usageapi_client.rb', line 443

def delete_custom_table(custom_table_id, opts = {})
  logger.debug 'Calling operation UsageapiClient#delete_custom_table.' if logger

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

  path = '/customTables/{customTableId}'.sub('{customTableId}', custom_table_id.to_s)
  operation_signing_strategy = :standard

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

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

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'UsageapiClient#delete_custom_table') 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_email_recipients_group(email_recipients_group_id, subscription_id, compartment_id, opts = {}) ⇒ Response

Note:

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

Delete the email recipients group for the usage statement subscription.

Parameters:

  • email_recipients_group_id (String)

    The email recipient group OCID.

  • subscription_id (String)

    The UsageStatement Subscription unique OCID.

  • compartment_id (String)

    The compartment ID 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

  • :opc_request_id (String)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :if_match (String)

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

Returns:

  • (Response)

    A Response object with data of type nil



508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
# File 'lib/oci/usage_api/usageapi_client.rb', line 508

def delete_email_recipients_group(email_recipients_group_id, subscription_id, compartment_id, opts = {})
  logger.debug 'Calling operation UsageapiClient#delete_email_recipients_group.' if logger

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

  path = '/usageStatements/{subscriptionId}/emailRecipientsGroups/{emailRecipientsGroupId}'.sub('{emailRecipientsGroupId}', email_recipients_group_id.to_s).sub('{subscriptionId}', subscription_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id

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

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'UsageapiClient#delete_email_recipients_group') 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_query(query_id, opts = {}) ⇒ Response

Note:

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

Delete a saved query by the OCID.

Parameters:

  • query_id (String)

    The query unique 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)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :if_match (String)

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

Returns:

  • (Response)

    A Response object with data of type nil



575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
# File 'lib/oci/usage_api/usageapi_client.rb', line 575

def delete_query(query_id, opts = {})
  logger.debug 'Calling operation UsageapiClient#delete_query.' if logger

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

  path = '/queries/{queryId}'.sub('{queryId}', query_id.to_s)
  operation_signing_strategy = :standard

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

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

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'UsageapiClient#delete_query') 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_schedule(schedule_id, opts = {}) ⇒ Response

Note:

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

Delete a saved scheduled report by the OCID.

Parameters:

  • schedule_id (String)

    The schedule unique 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)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :if_match (String)

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

Returns:

  • (Response)

    A Response object with data of type nil



638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
# File 'lib/oci/usage_api/usageapi_client.rb', line 638

def delete_schedule(schedule_id, opts = {})
  logger.debug 'Calling operation UsageapiClient#delete_schedule.' if logger

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

  path = '/schedules/{scheduleId}'.sub('{scheduleId}', schedule_id.to_s)
  operation_signing_strategy = :standard

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

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

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'UsageapiClient#delete_schedule') 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_usage_carbon_emissions_query(usage_carbon_emissions_query_id, opts = {}) ⇒ Response

Note:

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

Delete a usage carbon emissions saved query by the OCID.

Parameters:

  • usage_carbon_emissions_query_id (String)

    The query unique 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)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :if_match (String)

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

Returns:

  • (Response)

    A Response object with data of type nil



701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
# File 'lib/oci/usage_api/usageapi_client.rb', line 701

def delete_usage_carbon_emissions_query(usage_carbon_emissions_query_id, opts = {})
  logger.debug 'Calling operation UsageapiClient#delete_usage_carbon_emissions_query.' if logger

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

  path = '/usageCarbonEmissionsQueries/{usageCarbonEmissionsQueryId}'.sub('{usageCarbonEmissionsQueryId}', usage_carbon_emissions_query_id.to_s)
  operation_signing_strategy = :standard

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

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

  post_body = nil

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

#get_custom_table(custom_table_id, opts = {}) ⇒ Response

Note:

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

Returns the saved custom table.

Parameters:

  • custom_table_id (String)

    The custom table unique 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)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

Returns:



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
# File 'lib/oci/usage_api/usageapi_client.rb', line 758

def get_custom_table(custom_table_id, opts = {})
  logger.debug 'Calling operation UsageapiClient#get_custom_table.' if logger

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

  path = '/customTables/{customTableId}'.sub('{customTableId}', custom_table_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: 'UsageapiClient#get_custom_table') 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::UsageApi::Models::CustomTable'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_email_recipients_group(email_recipients_group_id, subscription_id, compartment_id, opts = {}) ⇒ Response

Note:

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

Return the saved usage statement email recipient group.

Parameters:

  • email_recipients_group_id (String)

    The email recipient group OCID.

  • subscription_id (String)

    The UsageStatement Subscription unique OCID.

  • compartment_id (String)

    The compartment ID 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

  • :opc_request_id (String)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

Returns:



817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
# File 'lib/oci/usage_api/usageapi_client.rb', line 817

def get_email_recipients_group(email_recipients_group_id, subscription_id, compartment_id, opts = {})
  logger.debug 'Calling operation UsageapiClient#get_email_recipients_group.' if logger

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

  path = '/usageStatements/{subscriptionId}/emailRecipientsGroups/{emailRecipientsGroupId}'.sub('{emailRecipientsGroupId}', email_recipients_group_id.to_s).sub('{subscriptionId}', subscription_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id

  # 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: 'UsageapiClient#get_email_recipients_group') 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::UsageApi::Models::EmailRecipientsGroup'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_query(query_id, opts = {}) ⇒ Response

Note:

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

Returns the saved query.

Parameters:

  • query_id (String)

    The query unique 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)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

Returns:



878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
# File 'lib/oci/usage_api/usageapi_client.rb', line 878

def get_query(query_id, opts = {})
  logger.debug 'Calling operation UsageapiClient#get_query.' if logger

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

  path = '/queries/{queryId}'.sub('{queryId}', query_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: 'UsageapiClient#get_query') 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::UsageApi::Models::Query'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_schedule(schedule_id, opts = {}) ⇒ Response

Note:

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

Returns the saved schedule.

Parameters:

  • schedule_id (String)

    The schedule unique 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)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

Returns:



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
# File 'lib/oci/usage_api/usageapi_client.rb', line 935

def get_schedule(schedule_id, opts = {})
  logger.debug 'Calling operation UsageapiClient#get_schedule.' if logger

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

  path = '/schedules/{scheduleId}'.sub('{scheduleId}', schedule_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: 'UsageapiClient#get_schedule') 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::UsageApi::Models::Schedule'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_scheduled_run(scheduled_run_id, opts = {}) ⇒ Response

Note:

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

Returns the saved schedule run.

Parameters:

  • scheduled_run_id (String)

    The scheduledRun unique 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)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

Returns:



992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
# File 'lib/oci/usage_api/usageapi_client.rb', line 992

def get_scheduled_run(scheduled_run_id, opts = {})
  logger.debug 'Calling operation UsageapiClient#get_scheduled_run.' if logger

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

  path = '/scheduledRuns/{scheduledRunId}'.sub('{scheduledRunId}', scheduled_run_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: 'UsageapiClient#get_scheduled_run') 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::UsageApi::Models::ScheduledRun'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_usage_carbon_emissions_query(usage_carbon_emissions_query_id, opts = {}) ⇒ Response

Note:

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

Returns the usage carbon emissions saved query.

Parameters:

  • usage_carbon_emissions_query_id (String)

    The query unique 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)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

Returns:



1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
# File 'lib/oci/usage_api/usageapi_client.rb', line 1049

def get_usage_carbon_emissions_query(usage_carbon_emissions_query_id, opts = {})
  logger.debug 'Calling operation UsageapiClient#get_usage_carbon_emissions_query.' if logger

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

  path = '/usageCarbonEmissionsQueries/{usageCarbonEmissionsQueryId}'.sub('{usageCarbonEmissionsQueryId}', usage_carbon_emissions_query_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: 'UsageapiClient#get_usage_carbon_emissions_query') 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::UsageApi::Models::UsageCarbonEmissionsQuery'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_custom_tables(compartment_id, saved_report_id, opts = {}) ⇒ Response

Note:

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

Returns the saved custom table list.

Allowed values are: displayName

Parameters:

  • compartment_id (String)

    The compartment ID in which to list resources.

  • saved_report_id (String)

    The saved report ID 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

  • :opc_request_id (String)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :limit (Integer)

    The maximumimum 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_by (String)

    The field to sort by. If not specified, the default is displayName. (default to displayName)

  • :sort_order (String)

    The sort order to use, whether 'asc' or 'desc'. (default to ASC) Allowed values are: ASC, DESC

Returns:



1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
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
# File 'lib/oci/usage_api/usageapi_client.rb', line 1116

def list_custom_tables(compartment_id, saved_report_id, opts = {})
  logger.debug 'Calling operation UsageapiClient#list_custom_tables.' if logger

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

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

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

  path = '/customTables'
  operation_signing_strategy = :standard

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

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

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'UsageapiClient#list_custom_tables') 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::UsageApi::Models::CustomTableCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_email_recipients_groups(subscription_id, compartment_id, opts = {}) ⇒ Response

Note:

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

Return the saved usage statement email recipient group.

Allowed values are: displayName

Parameters:

  • subscription_id (String)

    The UsageStatement Subscription unique OCID.

  • compartment_id (String)

    The compartment ID 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

  • :opc_request_id (String)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :limit (Integer)

    The maximumimum 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.

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

  • :sort_by (String)

    The field to sort by. If not specified, the default is displayName. (default to displayName)

  • :sort_order (String)

    The sort order to use, whether 'asc' or 'desc'. (default to ASC) Allowed values are: ASC, DESC

Returns:



1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
# File 'lib/oci/usage_api/usageapi_client.rb', line 1203

def list_email_recipients_groups(subscription_id, compartment_id, opts = {})
  logger.debug 'Calling operation UsageapiClient#list_email_recipients_groups.' if logger

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

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

  if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
  end
  raise "Parameter value for 'subscription_id' must not be blank" if OCI::Internal::Util.blank_string?(subscription_id)

  path = '/usageStatements/{subscriptionId}/emailRecipientsGroups'.sub('{subscriptionId}', subscription_id.to_s)
  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[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  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: 'UsageapiClient#list_email_recipients_groups') 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::UsageApi::Models::EmailRecipientsGroupCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

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

Note:

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

Returns the saved query list.

Allowed values are: displayName

Parameters:

  • compartment_id (String)

    The compartment ID 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

  • :opc_request_id (String)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :limit (Integer)

    The maximumimum 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_by (String)

    The field to sort by. If not specified, the default is displayName. (default to displayName)

  • :sort_order (String)

    The sort order to use, whether 'asc' or 'desc'. (default to ASC) Allowed values are: ASC, DESC

Returns:



1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
# File 'lib/oci/usage_api/usageapi_client.rb', line 1285

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

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

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

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

  path = '/queries'
  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[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]

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

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'UsageapiClient#list_queries') 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::UsageApi::Models::QueryCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_scheduled_runs(schedule_id, opts = {}) ⇒ Response

Note:

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

Returns schedule history list.

Allowed values are: timeCreated

Parameters:

  • schedule_id (String)

    The unique ID of a schedule.

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

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :page (String)

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

  • :limit (Integer)

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

  • :sort_by (String)

    The field to sort by. If not specified, the default is timeCreated. (default to timeCreated)

  • :sort_order (String)

    The sort order to use, whether 'asc' or 'desc'. (default to ASC) Allowed values are: ASC, DESC

Returns:



1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
# File 'lib/oci/usage_api/usageapi_client.rb', line 1363

def list_scheduled_runs(schedule_id, opts = {})
  logger.debug 'Calling operation UsageapiClient#list_scheduled_runs.' if logger

  raise "Missing the required parameter 'schedule_id' when calling list_scheduled_runs." if schedule_id.nil?

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

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

  path = '/scheduledRuns'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:scheduleId] = schedule_id
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]

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

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'UsageapiClient#list_scheduled_runs') 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::UsageApi::Models::ScheduledRunCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

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

Note:

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

Returns the saved schedule list.

Allowed values are: name, timeCreated

Parameters:

  • compartment_id (String)

    The compartment ID 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

  • :opc_request_id (String)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :page (String)

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

  • :limit (Integer)

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

  • :sort_by (String)

    The field to sort by. If not specified, the default is timeCreated. (default to timeCreated)

  • :sort_order (String)

    The sort order to use, whether 'asc' or 'desc'. (default to ASC) Allowed values are: ASC, DESC

  • :name (String)

    Query parameter for filtering by name

Returns:



1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
# File 'lib/oci/usage_api/usageapi_client.rb', line 1443

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

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

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

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

  path = '/schedules'
  operation_signing_strategy = :standard

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

  # 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: 'UsageapiClient#list_schedules') 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::UsageApi::Models::ScheduleCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

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

Note:

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

Returns the usage carbon emissions saved query list.

Allowed values are: displayName

Parameters:

  • compartment_id (String)

    The compartment ID 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

  • :opc_request_id (String)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :limit (Integer)

    The maximumimum 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_by (String)

    The field to sort by. If not specified, the default is displayName. (default to displayName)

  • :sort_order (String)

    The sort order to use, whether 'asc' or 'desc'. (default to ASC) Allowed values are: ASC, DESC

Returns:



1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
# File 'lib/oci/usage_api/usageapi_client.rb', line 1522

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

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

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

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

  path = '/usageCarbonEmissionsQueries'
  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[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]

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

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'UsageapiClient#list_usage_carbon_emissions_queries') 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::UsageApi::Models::UsageCarbonEmissionsQueryCollection'
    )
  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/usage_api/usageapi_client.rb', line 94

def logger
  @api_client.config.logger
end

#request_average_carbon_emission(sku_part_number, opts = {}) ⇒ Response

Note:

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

Returns the average carbon emissions summary by SKU.

Parameters:

  • sku_part_number (String)

    The SKU part number.

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

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

Returns:



1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
# File 'lib/oci/usage_api/usageapi_client.rb', line 1591

def request_average_carbon_emission(sku_part_number, opts = {})
  logger.debug 'Calling operation UsageapiClient#request_average_carbon_emission.' if logger

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

  path = '/averageCarbonEmissions/{skuPartNumber}'.sub('{skuPartNumber}', sku_part_number.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: 'UsageapiClient#request_average_carbon_emission') 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::UsageApi::Models::AverageCarbonEmission'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#request_clean_energy_usage(region, opts = {}) ⇒ Response

Note:

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

Returns the clean energy usage summary by region.

Parameters:

  • region (String)

    The region.

  • 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

  • :ad (String)

    The availability domain.

  • :opc_request_id (String)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

Returns:



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

def request_clean_energy_usage(region, opts = {})
  logger.debug 'Calling operation UsageapiClient#request_clean_energy_usage.' if logger

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

  path = '/cleanEnergyUsages/{region}'.sub('{region}', region.to_s)
  operation_signing_strategy = :standard

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

  # 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: 'UsageapiClient#request_clean_energy_usage') 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::UsageApi::Models::CleanEnergyUsage'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#request_summarized_configurations(tenant_id, opts = {}) ⇒ Response

Note:

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

Returns the configurations list for the UI drop-down list.

Parameters:

  • tenant_id (String)

    tenant id

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

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

Returns:



1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
# File 'lib/oci/usage_api/usageapi_client.rb', line 1707

def request_summarized_configurations(tenant_id, opts = {})
  logger.debug 'Calling operation UsageapiClient#request_summarized_configurations.' if logger

  raise "Missing the required parameter 'tenant_id' when calling request_summarized_configurations." if tenant_id.nil?

  path = '/configuration'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:tenantId] = tenant_id

  # 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: 'UsageapiClient#request_summarized_configurations') 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::UsageApi::Models::ConfigurationAggregation'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#request_summarized_usages(request_summarized_usages_details, opts = {}) ⇒ Response

Note:

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

Returns usage for the given account.

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)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :page (String)

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

  • :limit (Integer)

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

Returns:



1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
# File 'lib/oci/usage_api/usageapi_client.rb', line 1769

def request_summarized_usages(request_summarized_usages_details, opts = {})
  logger.debug 'Calling operation UsageapiClient#request_summarized_usages.' if logger

  raise "Missing the required parameter 'request_summarized_usages_details' when calling request_summarized_usages." if request_summarized_usages_details.nil?

  path = '/usage'
  operation_signing_strategy = :standard

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

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

  post_body = @api_client.object_to_http_body(request_summarized_usages_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'UsageapiClient#request_summarized_usages') 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::UsageApi::Models::UsageAggregation'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#request_usage_carbon_emission_config(tenant_id, opts = {}) ⇒ Response

Note:

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

Returns the configuration list for the UI drop-down list of carbon emission console.

Parameters:

  • tenant_id (String)

    tenant id

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

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

Returns:



1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
# File 'lib/oci/usage_api/usageapi_client.rb', line 1827

def request_usage_carbon_emission_config(tenant_id, opts = {})
  logger.debug 'Calling operation UsageapiClient#request_usage_carbon_emission_config.' if logger

  raise "Missing the required parameter 'tenant_id' when calling request_usage_carbon_emission_config." if tenant_id.nil?

  path = '/usageCarbonEmissionsConfig'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:tenantId] = tenant_id

  # 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: 'UsageapiClient#request_usage_carbon_emission_config') 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::UsageApi::Models::ConfigurationAggregation'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#request_usage_carbon_emissions(request_usage_carbon_emissions_details, opts = {}) ⇒ Response

Note:

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

Returns usage carbon emission for the given account.

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)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :page (String)

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

  • :limit (Integer)

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

Returns:



1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
# File 'lib/oci/usage_api/usageapi_client.rb', line 1889

def request_usage_carbon_emissions(request_usage_carbon_emissions_details, opts = {})
  logger.debug 'Calling operation UsageapiClient#request_usage_carbon_emissions.' if logger

  raise "Missing the required parameter 'request_usage_carbon_emissions_details' when calling request_usage_carbon_emissions." if request_usage_carbon_emissions_details.nil?

  path = '/usageCarbonEmissions'
  operation_signing_strategy = :standard

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

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

  post_body = @api_client.object_to_http_body(request_usage_carbon_emissions_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'UsageapiClient#request_usage_carbon_emissions') 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::UsageApi::Models::UsageCarbonEmissionAggregation'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_custom_table(update_custom_table_details, custom_table_id, opts = {}) ⇒ Response

Note:

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

Update a saved custom table by table id.

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)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :if_match (String)

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

Returns:



1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
# File 'lib/oci/usage_api/usageapi_client.rb', line 1954

def update_custom_table(update_custom_table_details, custom_table_id, opts = {})
  logger.debug 'Calling operation UsageapiClient#update_custom_table.' if logger

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

  path = '/customTables/{customTableId}'.sub('{customTableId}', custom_table_id.to_s)
  operation_signing_strategy = :standard

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

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

  post_body = @api_client.object_to_http_body(update_custom_table_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'UsageapiClient#update_custom_table') 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::UsageApi::Models::CustomTable'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_email_recipients_group(update_email_recipients_group_details, email_recipients_group_id, subscription_id, compartment_id, opts = {}) ⇒ Response

Note:

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

Update a saved email recipients group.

Parameters:

  • update_email_recipients_group_details (OCI::UsageApi::Models::UpdateEmailRecipientsGroupDetails)

    The information to be updated.

  • email_recipients_group_id (String)

    The email recipient group OCID.

  • subscription_id (String)

    The UsageStatement Subscription unique OCID.

  • compartment_id (String)

    The compartment ID 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

  • :opc_request_id (String)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :if_match (String)

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

Returns:



2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
# File 'lib/oci/usage_api/usageapi_client.rb', line 2022

def update_email_recipients_group(update_email_recipients_group_details, email_recipients_group_id, subscription_id, compartment_id, opts = {})
  logger.debug 'Calling operation UsageapiClient#update_email_recipients_group.' if logger

  raise "Missing the required parameter 'update_email_recipients_group_details' when calling update_email_recipients_group." if update_email_recipients_group_details.nil?
  raise "Missing the required parameter 'email_recipients_group_id' when calling update_email_recipients_group." if email_recipients_group_id.nil?
  raise "Missing the required parameter 'subscription_id' when calling update_email_recipients_group." if subscription_id.nil?
  raise "Missing the required parameter 'compartment_id' when calling update_email_recipients_group." if compartment_id.nil?
  raise "Parameter value for 'email_recipients_group_id' must not be blank" if OCI::Internal::Util.blank_string?(email_recipients_group_id)
  raise "Parameter value for 'subscription_id' must not be blank" if OCI::Internal::Util.blank_string?(subscription_id)

  path = '/usageStatements/{subscriptionId}/emailRecipientsGroups/{emailRecipientsGroupId}'.sub('{emailRecipientsGroupId}', email_recipients_group_id.to_s).sub('{subscriptionId}', subscription_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id

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

  post_body = @api_client.object_to_http_body(update_email_recipients_group_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'UsageapiClient#update_email_recipients_group') 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::UsageApi::Models::EmailRecipientsGroup'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_query(update_query_details, query_id, opts = {}) ⇒ Response

Note:

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

Update a saved query 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

  • :opc_request_id (String)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :if_match (String)

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

Returns:



2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
# File 'lib/oci/usage_api/usageapi_client.rb', line 2092

def update_query(update_query_details, query_id, opts = {})
  logger.debug 'Calling operation UsageapiClient#update_query.' if logger

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

  path = '/queries/{queryId}'.sub('{queryId}', query_id.to_s)
  operation_signing_strategy = :standard

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

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

  post_body = @api_client.object_to_http_body(update_query_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'UsageapiClient#update_query') 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::UsageApi::Models::Query'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_schedule(update_schedule_details, schedule_id, opts = {}) ⇒ Response

Note:

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

Update a saved schedule

Parameters:

  • update_schedule_details (OCI::UsageApi::Models::UpdateScheduleDetails)

    The information to be updated. Currently supports only tags

  • schedule_id (String)

    The schedule unique 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)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :if_match (String)

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

Returns:



2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
# File 'lib/oci/usage_api/usageapi_client.rb', line 2158

def update_schedule(update_schedule_details, schedule_id, opts = {})
  logger.debug 'Calling operation UsageapiClient#update_schedule.' if logger

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

  path = '/schedules/{scheduleId}'.sub('{scheduleId}', schedule_id.to_s)
  operation_signing_strategy = :standard

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

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

  post_body = @api_client.object_to_http_body(update_schedule_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'UsageapiClient#update_schedule') 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::UsageApi::Models::Schedule'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_usage_carbon_emissions_query(update_usage_carbon_emissions_query_details, usage_carbon_emissions_query_id, opts = {}) ⇒ Response

Note:

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

Update a usage carbon emissions saved query 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

  • :opc_request_id (String)

    Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :if_match (String)

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

Returns:



2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
# File 'lib/oci/usage_api/usageapi_client.rb', line 2224

def update_usage_carbon_emissions_query(update_usage_carbon_emissions_query_details, usage_carbon_emissions_query_id, opts = {})
  logger.debug 'Calling operation UsageapiClient#update_usage_carbon_emissions_query.' if logger

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

  path = '/usageCarbonEmissionsQueries/{usageCarbonEmissionsQueryId}'.sub('{usageCarbonEmissionsQueryId}', usage_carbon_emissions_query_id.to_s)
  operation_signing_strategy = :standard

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

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

  post_body = @api_client.object_to_http_body(update_usage_carbon_emissions_query_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'UsageapiClient#update_usage_carbon_emissions_query') 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::UsageApi::Models::UsageCarbonEmissionsQuery'
    )
  end
  # rubocop:enable Metrics/BlockLength
end