UsageapiClient

class oci.usage_api.UsageapiClient(config, **kwargs)

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](/Content/Billing/Concepts/costanalysisoverview.htm) and [Using the Usage API](/Content/Billing/Concepts/costanalysisoverview.htm#cost_analysis_using_the_api) for more information.

Methods

__init__(config, **kwargs) Creates a new service client
create_custom_table(…) Returns the created custom table.
create_email_recipients_group(…) Add a list of email recipients that can receive usage statements for the subscription.
create_query(create_query_details, **kwargs) Returns the created query.
create_schedule(create_schedule_details, …) Returns the created schedule.
create_usage_carbon_emissions_query(…) Returns the created usage carbon emissions query.
delete_custom_table(custom_table_id, **kwargs) Delete a saved custom table by the OCID.
delete_email_recipients_group(…) Delete the email recipients group for the usage statement subscription.
delete_query(query_id, **kwargs) Delete a saved query by the OCID.
delete_schedule(schedule_id, **kwargs) Delete a saved scheduled report by the OCID.
delete_usage_carbon_emissions_query(…) Delete a usage carbon emissions saved query by the OCID.
get_custom_table(custom_table_id, **kwargs) Returns the saved custom table.
get_email_recipients_group(…) Return the saved usage statement email recipient group.
get_query(query_id, **kwargs) Returns the saved query.
get_schedule(schedule_id, **kwargs) Returns the saved schedule.
get_scheduled_run(scheduled_run_id, **kwargs) Returns the saved schedule run.
get_usage_carbon_emissions_query(…) Returns the usage carbon emissions saved query.
list_custom_tables(compartment_id, …) Returns the saved custom table list.
list_email_recipients_groups(…) Return the saved usage statement email recipient group.
list_queries(compartment_id, **kwargs) Returns the saved query list.
list_scheduled_runs(schedule_id, **kwargs) Returns schedule history list.
list_schedules(compartment_id, **kwargs) Returns the saved schedule list.
list_usage_carbon_emissions_queries(…) Returns the usage carbon emissions saved query list.
request_average_carbon_emission(…) Returns the average carbon emissions summary by SKU.
request_clean_energy_usage(region, **kwargs) Returns the clean energy usage summary by region.
request_summarized_configurations(tenant_id, …) Returns the configurations list for the UI drop-down list.
request_summarized_usages(…) Returns usage for the given account.
request_usage_carbon_emission_config(…) Returns the configuration list for the UI drop-down list of carbon emission console.
request_usage_carbon_emissions(…) Returns usage carbon emission for the given account.
update_custom_table(…) Update a saved custom table by table id.
update_email_recipients_group(…) Update a saved email recipients group.
update_query(update_query_details, query_id, …) Update a saved query by the OCID.
update_schedule(update_schedule_details, …) Update a saved schedule
update_usage_carbon_emissions_query(…) Update a usage carbon emissions saved query by the OCID.
__init__(config, **kwargs)

Creates a new service client

Parameters:
  • config (dict) – Configuration keys and values as per SDK and Tool Configuration. The from_file() method can be used to load configuration from a file. Alternatively, a dict can be passed. You can validate_config the dict using validate_config()
  • service_endpoint (str) – (optional) The endpoint of the service to call using this client. For example https://iaas.us-ashburn-1.oraclecloud.com. If this keyword argument is not provided then it will be derived using the region in the config parameter. You should only provide this keyword argument if you have an explicit need to specify a service endpoint.
  • timeout (float or tuple(float, float)) – (optional) The connection and read timeouts for the client. The default values are connection timeout 10 seconds and read timeout 60 seconds. This keyword argument can be provided as a single float, in which case the value provided is used for both the read and connection timeouts, or as a tuple of two floats. If a tuple is provided then the first value is used as the connection timeout and the second value as the read timeout.
  • signer (AbstractBaseSigner) –

    (optional) The signer to use when signing requests made by the service client. The default is to use a Signer based on the values provided in the config parameter.

    One use case for this parameter is for Instance Principals authentication by passing an instance of InstancePrincipalsSecurityTokenSigner as the value for this keyword argument

  • retry_strategy (obj) –

    (optional) A retry strategy to apply to all calls made by this service client (i.e. at the client level). There is no retry strategy applied by default. Retry strategies can also be applied at the operation level by passing a retry_strategy keyword argument as part of calling the operation. Any value provided at the operation level will override whatever is specified at the client level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

  • circuit_breaker_strategy (obj) – (optional) A circuit breaker strategy to apply to all calls made by this service client (i.e. at the client level). This client uses DEFAULT_CIRCUIT_BREAKER_STRATEGY as default if no circuit breaker strategy is provided. The specifics of circuit breaker strategy are described here.
  • circuit_breaker_callback (function) – (optional) Callback function to receive any exceptions triggerred by the circuit breaker.
  • client_level_realm_specific_endpoint_template_enabled (bool) – (optional) A boolean flag to indicate whether or not this client should be created with realm specific endpoint template enabled or disable. By default, this will be set as None.
  • allow_control_chars – (optional) allow_control_chars is a boolean to indicate whether or not this client should allow control characters in the response object. By default, the client will not allow control characters to be in the response object.
create_custom_table(create_custom_table_details, **kwargs)

Returns the created custom table.

Parameters:
  • create_custom_table_details (oci.usage_api.models.CreateCustomTableDetails) – (required) New custom table details.
  • opc_request_id (str) – (optional) 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 (str) – (optional) 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.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type CustomTable

Return type:

Response

Example:

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

create_email_recipients_group(create_email_recipients_group_details, subscription_id, **kwargs)

Add a list of email recipients that can receive usage statements for the subscription.

Parameters:
  • create_email_recipients_group_details (oci.usage_api.models.CreateEmailRecipientsGroupDetails) – (required) New email recipients group details.
  • subscription_id (str) – (required) The UsageStatement Subscription unique OCID.
  • opc_request_id (str) – (optional) 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 (str) – (optional) 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.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type EmailRecipientsGroup

Return type:

Response

Example:

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

create_query(create_query_details, **kwargs)

Returns the created query.

Parameters:
  • create_query_details (oci.usage_api.models.CreateQueryDetails) – (required) New query details. Up to ten saved queries.
  • opc_request_id (str) – (optional) 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 (str) – (optional) 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.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type Query

Return type:

Response

Example:

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

create_schedule(create_schedule_details, **kwargs)

Returns the created schedule.

Parameters:
  • create_schedule_details (oci.usage_api.models.CreateScheduleDetails) – (required) New schedule details.
  • opc_request_id (str) – (optional) 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 (str) – (optional) 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.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type Schedule

Return type:

Response

Example:

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

create_usage_carbon_emissions_query(create_usage_carbon_emissions_query_details, **kwargs)

Returns the created usage carbon emissions query.

Parameters:
  • create_usage_carbon_emissions_query_details (oci.usage_api.models.CreateUsageCarbonEmissionsQueryDetails) – (required) New query details. Up to ten saved queries.
  • opc_request_id (str) – (optional) 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 (str) – (optional) 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.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type UsageCarbonEmissionsQuery

Return type:

Response

Example:

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

delete_custom_table(custom_table_id, **kwargs)

Delete a saved custom table by the OCID.

Parameters:
  • custom_table_id (str) – (required) The custom table unique OCID.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • if_match (str) – (optional) 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.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

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

delete_email_recipients_group(email_recipients_group_id, subscription_id, compartment_id, **kwargs)

Delete the email recipients group for the usage statement subscription.

Parameters:
  • email_recipients_group_id (str) – (required) The email recipient group OCID.
  • subscription_id (str) – (required) The UsageStatement Subscription unique OCID.
  • compartment_id (str) – (required) The compartment ID in which to list resources.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • if_match (str) – (optional) 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.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

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

delete_query(query_id, **kwargs)

Delete a saved query by the OCID.

Parameters:
  • query_id (str) – (required) The query unique OCID.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • if_match (str) – (optional) 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.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

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

delete_schedule(schedule_id, **kwargs)

Delete a saved scheduled report by the OCID.

Parameters:
  • schedule_id (str) – (required) The schedule unique OCID.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • if_match (str) – (optional) 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.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

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

delete_usage_carbon_emissions_query(usage_carbon_emissions_query_id, **kwargs)

Delete a usage carbon emissions saved query by the OCID.

Parameters:
  • usage_carbon_emissions_query_id (str) – (required) The query unique OCID.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • if_match (str) – (optional) 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.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

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

get_custom_table(custom_table_id, **kwargs)

Returns the saved custom table.

Parameters:
  • custom_table_id (str) – (required) The custom table unique OCID.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type CustomTable

Return type:

Response

Example:

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

get_email_recipients_group(email_recipients_group_id, subscription_id, compartment_id, **kwargs)

Return the saved usage statement email recipient group.

Parameters:
  • email_recipients_group_id (str) – (required) The email recipient group OCID.
  • subscription_id (str) – (required) The UsageStatement Subscription unique OCID.
  • compartment_id (str) – (required) The compartment ID in which to list resources.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type EmailRecipientsGroup

Return type:

Response

Example:

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

get_query(query_id, **kwargs)

Returns the saved query.

Parameters:
  • query_id (str) – (required) The query unique OCID.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type Query

Return type:

Response

Example:

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

get_schedule(schedule_id, **kwargs)

Returns the saved schedule.

Parameters:
  • schedule_id (str) – (required) The schedule unique OCID.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type Schedule

Return type:

Response

Example:

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

get_scheduled_run(scheduled_run_id, **kwargs)

Returns the saved schedule run.

Parameters:
  • scheduled_run_id (str) – (required) The scheduledRun unique OCID
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type ScheduledRun

Return type:

Response

Example:

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

get_usage_carbon_emissions_query(usage_carbon_emissions_query_id, **kwargs)

Returns the usage carbon emissions saved query.

Parameters:
  • usage_carbon_emissions_query_id (str) – (required) The query unique OCID.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type UsageCarbonEmissionsQuery

Return type:

Response

Example:

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

list_custom_tables(compartment_id, saved_report_id, **kwargs)

Returns the saved custom table list.

Parameters:
  • compartment_id (str) – (required) The compartment ID in which to list resources.
  • saved_report_id (str) – (required) The saved report ID in which to list resources.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • limit (int) – (optional) The maximumimum number of items to return.
  • page (str) – (optional) The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.
  • sort_by (str) –

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

    Allowed values are: “displayName”

  • sort_order (str) –

    (optional) The sort order to use, whether ‘asc’ or ‘desc’.

    Allowed values are: “ASC”, “DESC”

  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type CustomTableCollection

Return type:

Response

Example:

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

list_email_recipients_groups(subscription_id, compartment_id, **kwargs)

Return the saved usage statement email recipient group.

Parameters:
  • subscription_id (str) – (required) The UsageStatement Subscription unique OCID.
  • compartment_id (str) – (required) The compartment ID in which to list resources.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • limit (int) – (optional) The maximumimum number of items to return.
  • page (str) – (optional) The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.
  • opc_retry_token (str) – (optional) 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 (str) –

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

    Allowed values are: “displayName”

  • sort_order (str) –

    (optional) The sort order to use, whether ‘asc’ or ‘desc’.

    Allowed values are: “ASC”, “DESC”

  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type EmailRecipientsGroupCollection

Return type:

Response

Example:

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

list_queries(compartment_id, **kwargs)

Returns the saved query list.

Parameters:
  • compartment_id (str) – (required) The compartment ID in which to list resources.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • limit (int) – (optional) The maximumimum number of items to return.
  • page (str) – (optional) The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.
  • sort_by (str) –

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

    Allowed values are: “displayName”

  • sort_order (str) –

    (optional) The sort order to use, whether ‘asc’ or ‘desc’.

    Allowed values are: “ASC”, “DESC”

  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type QueryCollection

Return type:

Response

Example:

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

list_scheduled_runs(schedule_id, **kwargs)

Returns schedule history list.

Parameters:
  • schedule_id (str) – (required) The unique ID of a schedule.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • page (str) – (optional) The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.
  • limit (int) – (optional) The maximumimum number of items to return.
  • sort_by (str) –

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

    Allowed values are: “timeCreated”

  • sort_order (str) –

    (optional) The sort order to use, whether ‘asc’ or ‘desc’.

    Allowed values are: “ASC”, “DESC”

  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type ScheduledRunCollection

Return type:

Response

Example:

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

list_schedules(compartment_id, **kwargs)

Returns the saved schedule list.

Parameters:
  • compartment_id (str) – (required) The compartment ID in which to list resources.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • page (str) – (optional) The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.
  • limit (int) – (optional) The maximumimum number of items to return.
  • sort_by (str) –

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

    Allowed values are: “name”, “timeCreated”

  • sort_order (str) –

    (optional) The sort order to use, whether ‘asc’ or ‘desc’.

    Allowed values are: “ASC”, “DESC”

  • name (str) – (optional) Query parameter for filtering by name
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type ScheduleCollection

Return type:

Response

Example:

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

list_usage_carbon_emissions_queries(compartment_id, **kwargs)

Returns the usage carbon emissions saved query list.

Parameters:
  • compartment_id (str) – (required) The compartment ID in which to list resources.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • limit (int) – (optional) The maximumimum number of items to return.
  • page (str) – (optional) The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.
  • sort_by (str) –

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

    Allowed values are: “displayName”

  • sort_order (str) –

    (optional) The sort order to use, whether ‘asc’ or ‘desc’.

    Allowed values are: “ASC”, “DESC”

  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type UsageCarbonEmissionsQueryCollection

Return type:

Response

Example:

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

request_average_carbon_emission(sku_part_number, **kwargs)

Returns the average carbon emissions summary by SKU.

Parameters:
  • sku_part_number (str) – (required) The SKU part number.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type AverageCarbonEmission

Return type:

Response

Example:

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

request_clean_energy_usage(region, **kwargs)

Returns the clean energy usage summary by region.

Parameters:
  • region (str) – (required) The region.
  • ad (str) – (optional) The availability domain.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type CleanEnergyUsage

Return type:

Response

Example:

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

request_summarized_configurations(tenant_id, **kwargs)

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

Parameters:
  • tenant_id (str) – (required) tenant id
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type ConfigurationAggregation

Return type:

Response

Example:

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

request_summarized_usages(request_summarized_usages_details, **kwargs)

Returns usage for the given account.

Parameters:
  • request_summarized_usages_details (oci.usage_api.models.RequestSummarizedUsagesDetails) – (required) getUsageRequest contains query inforamtion.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • page (str) – (optional) The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.
  • limit (int) – (optional) The maximumimum number of items to return.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type UsageAggregation

Return type:

Response

Example:

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

request_usage_carbon_emission_config(tenant_id, **kwargs)

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

Parameters:
  • tenant_id (str) – (required) tenant id
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type ConfigurationAggregation

Return type:

Response

Example:

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

request_usage_carbon_emissions(request_usage_carbon_emissions_details, **kwargs)

Returns usage carbon emission for the given account.

Parameters:
  • request_usage_carbon_emissions_details (oci.usage_api.models.RequestUsageCarbonEmissionsDetails) – (required) getUsageCarbonEmissionRequest contains query inforamtion.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • page (str) – (optional) The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.
  • limit (int) – (optional) The maximumimum number of items to return.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type UsageCarbonEmissionAggregation

Return type:

Response

Example:

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

update_custom_table(update_custom_table_details, custom_table_id, **kwargs)

Update a saved custom table by table id.

Parameters:
  • update_custom_table_details (oci.usage_api.models.UpdateCustomTableDetails) – (required) The information to be updated.
  • custom_table_id (str) – (required) The custom table unique OCID.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • if_match (str) – (optional) 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.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type CustomTable

Return type:

Response

Example:

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

update_email_recipients_group(update_email_recipients_group_details, email_recipients_group_id, subscription_id, compartment_id, **kwargs)

Update a saved email recipients group.

Parameters:
  • update_email_recipients_group_details (oci.usage_api.models.UpdateEmailRecipientsGroupDetails) – (required) The information to be updated.
  • email_recipients_group_id (str) – (required) The email recipient group OCID.
  • subscription_id (str) – (required) The UsageStatement Subscription unique OCID.
  • compartment_id (str) – (required) The compartment ID in which to list resources.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • if_match (str) – (optional) 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.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type EmailRecipientsGroup

Return type:

Response

Example:

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

update_query(update_query_details, query_id, **kwargs)

Update a saved query by the OCID.

Parameters:
  • update_query_details (oci.usage_api.models.UpdateQueryDetails) – (required) The information to be updated.
  • query_id (str) – (required) The query unique OCID.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • if_match (str) – (optional) 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.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type Query

Return type:

Response

Example:

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

update_schedule(update_schedule_details, schedule_id, **kwargs)

Update a saved schedule

Parameters:
  • update_schedule_details (oci.usage_api.models.UpdateScheduleDetails) – (required) The information to be updated. Currently supports only tags
  • schedule_id (str) – (required) The schedule unique OCID.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • if_match (str) – (optional) 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.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type Schedule

Return type:

Response

Example:

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

update_usage_carbon_emissions_query(update_usage_carbon_emissions_query_details, usage_carbon_emissions_query_id, **kwargs)

Update a usage carbon emissions saved query by the OCID.

Parameters:
  • update_usage_carbon_emissions_query_details (oci.usage_api.models.UpdateUsageCarbonEmissionsQueryDetails) – (required) The information to be updated.
  • usage_carbon_emissions_query_id (str) – (required) The query unique OCID.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • if_match (str) – (optional) 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.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type UsageCarbonEmissionsQuery

Return type:

Response

Example:

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