oracle.oci.oci_onesubscription_computed_usage_facts – Fetches details about one or multiple ComputedUsage resources in Oracle Cloud Infrastructure

Note

This plugin is part of the oracle.oci collection (version 4.11.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install oracle.oci.

To use it in a playbook, specify: oracle.oci.oci_onesubscription_computed_usage_facts.

New in version 2.9.0: of oracle.oci

Synopsis

  • Fetches details about one or multiple ComputedUsage resources in Oracle Cloud Infrastructure

  • This is a collection API which returns a list of Computed Usages for given filters.

  • If computed_usage_id is specified, the details of a single ComputedUsage will be returned.

Requirements

The below requirements are needed on the host that executes this module.

Parameters

Parameter Choices/Defaults Comments
api_user
string
The OCID of the user, on whose behalf, OCI APIs are invoked. If not set, then the value of the OCI_USER_ID environment variable, if any, is used. This option is required if the user is not specified through a configuration file (See config_file_location). To get the user's OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm.
api_user_fingerprint
string
Fingerprint for the key pair being used. If not set, then the value of the OCI_USER_FINGERPRINT environment variable, if any, is used. This option is required if the key fingerprint is not specified through a configuration file (See config_file_location). To get the key pair's fingerprint value please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm.
api_user_key_file
string
Full path and filename of the private key (in PEM format). If not set, then the value of the OCI_USER_KEY_FILE variable, if any, is used. This option is required if the private key is not specified through a configuration file (See config_file_location). If the key is encrypted with a pass-phrase, the api_user_key_pass_phrase option must also be provided.
api_user_key_pass_phrase
string
Passphrase used by the key referenced in api_user_key_file, if it is encrypted. If not set, then the value of the OCI_USER_KEY_PASS_PHRASE variable, if any, is used. This option is required if the key passphrase is not specified through a configuration file (See config_file_location).
auth_purpose
string
    Choices:
  • service_principal
The auth purpose which can be used in conjunction with 'auth_type=instance_principal'. The default auth_purpose for instance_principal is None.
auth_type
string
    Choices:
  • api_key ←
  • instance_principal
  • instance_obo_user
  • resource_principal
The type of authentication to use for making API requests. By default auth_type="api_key" based authentication is performed and the API key (see api_user_key_file) in your config file will be used. If this 'auth_type' module option is not specified, the value of the OCI_ANSIBLE_AUTH_TYPE, if any, is used. Use auth_type="instance_principal" to use instance principal based authentication when running ansible playbooks within an OCI compute instance.
cert_bundle
string
The full path to a CA certificate bundle to be used for SSL verification. This will override the default CA certificate bundle. If not set, then the value of the OCI_ANSIBLE_CERT_BUNDLE variable, if any, is used.
compartment_id
string / required
The OCID of the root compartment.
computed_product
string
Product part number for Computed Usage .
computed_usage_id
string
The Computed Usage Id
Required to get a specific computed_usage.

aliases: id
config_file_location
string
Path to configuration file. If not set then the value of the OCI_CONFIG_FILE environment variable, if any, is used. Otherwise, defaults to ~/.oci/config.
config_profile_name
string
The profile to load from the config file referenced by config_file_location. If not set, then the value of the OCI_CONFIG_PROFILE environment variable, if any, is used. Otherwise, defaults to the "DEFAULT" profile in config_file_location.
fields
list / elements=string
Partial response refers to an optimization technique offered by the RESTful web APIs to return only the information (fields) required by the client. This parameter is used to control what fields to return.
parent_product
string
Product part number for subscribed service line, called parent product.
region
string
The Oracle Cloud Infrastructure region to use for all OCI API requests. If not set, then the value of the OCI_REGION variable, if any, is used. This option is required if the region is not specified through a configuration file (See config_file_location). Please refer to https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm for more information on OCI regions.
sort_by
string
    Choices:
  • timeCreated
  • timeOfArrival
  • timeMeteredOn
The field to sort by. You can provide one sort order (`sortOrder`).
sort_order
string
    Choices:
  • ASC
  • DESC
The sort order to use, either ascending ('ASC') or descending ('DESC').
subscription_id
string
Subscription Id is an identifier associated to the service used for filter the Computed Usage in SPM.
Required to list multiple computed_usages.
tenancy
string
OCID of your tenancy. If not set, then the value of the OCI_TENANCY variable, if any, is used. This option is required if the tenancy OCID is not specified through a configuration file (See config_file_location). To get the tenancy OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm
time_from
string
Initial date to filter Computed Usage data in SPM. In the case of non aggregated data the time period between of fromDate and toDate , expressed in RFC 3339 timestamp format.
Required to list multiple computed_usages.
time_to
string
Final date to filter Computed Usage data in SPM, expressed in RFC 3339 timestamp format.
Required to list multiple computed_usages.

Examples

- name: Get a specific computed_usage
  oci_onesubscription_computed_usage_facts:
    # required
    computed_usage_id: "ocid1.computedusage.oc1..xxxxxxEXAMPLExxxxxx"
    compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"

    # optional
    fields: [ "fields_example" ]

- name: List computed_usages
  oci_onesubscription_computed_usage_facts:
    # required
    compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"
    subscription_id: "ocid1.subscription.oc1..xxxxxxEXAMPLExxxxxx"
    time_from: 2013-10-20T19:20:30+01:00
    time_to: 2013-10-20T19:20:30+01:00

    # optional
    parent_product: parent_product_example
    computed_product: computed_product_example
    sort_order: ASC
    sort_by: timeCreated

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
computed_usages
complex
on success
List of ComputedUsage resources

Sample:
[{'commitment_service_id': 'ocid1.commitmentservice.oc1..xxxxxxEXAMPLExxxxxx', 'compute_source': 'compute_source_example', 'computed_usage_id': 'ocid1.computedusage.oc1..xxxxxxEXAMPLExxxxxx', 'cost': 'cost_example', 'cost_rounded': 'cost_rounded_example', 'currency_code': 'currency_code_example', 'data_center': 'data_center_example', 'id': 'ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx', 'is_invoiced': True, 'mqs_message_id': 'ocid1.mqsmessage.oc1..xxxxxxEXAMPLExxxxxx', 'net_unit_price': 'net_unit_price_example', 'original_usage_number': 'original_usage_number_example', 'parent_product': {'billing_category': 'billing_category_example', 'name': 'name_example', 'part_number': 'part_number_example', 'product_category': 'product_category_example', 'provisioning_group': 'provisioning_group_example', 'ucm_rate_card_part_type': 'ucm_rate_card_part_type_example', 'unit_of_measure': 'unit_of_measure_example'}, 'parent_subscribed_service_id': 'ocid1.parentsubscribedservice.oc1..xxxxxxEXAMPLExxxxxx', 'plan_number': 'plan_number_example', 'product': {'billing_category': 'billing_category_example', 'name': 'name_example', 'part_number': 'part_number_example', 'product_category': 'product_category_example', 'provisioning_group': 'provisioning_group_example', 'ucm_rate_card_part_type': 'ucm_rate_card_part_type_example', 'unit_of_measure': 'unit_of_measure_example'}, 'quantity': 'quantity_example', 'rate_card_id': 'ocid1.ratecard.oc1..xxxxxxEXAMPLExxxxxx', 'rate_card_tierd_id': 'ocid1.ratecardtierd.oc1..xxxxxxEXAMPLExxxxxx', 'time_created': '2013-10-20T19:20:30+01:00', 'time_metered_on': '2013-10-20T19:20:30+01:00', 'time_of_arrival': '2013-10-20T19:20:30+01:00', 'time_updated': '2013-10-20T19:20:30+01:00', 'type': 'PROMOTION', 'unit_of_measure': 'unit_of_measure_example', 'usage_number': 'usage_number_example'}]
 
commitment_service_id
string
on success
Subscribed service commitmentId.

Sample:
ocid1.commitmentservice.oc1..xxxxxxEXAMPLExxxxxx
 
compute_source
string
on success
SPM Internal compute records source .

Sample:
compute_source_example
 
computed_usage_id
string
on success
SPM Internal computed usage Id , 32 character string
Returned for list operation

Sample:
ocid1.computedusage.oc1..xxxxxxEXAMPLExxxxxx
 
cost
string
on success
Computed Line Amount not rounded

Sample:
cost_example
 
cost_rounded
string
on success
Computed Line Amount rounded.

Sample:
cost_rounded_example
 
currency_code
string
on success
Currency code

Sample:
currency_code_example
 
data_center
string
on success
Data Center Attribute as sent by MQS to SPM.

Sample:
data_center_example
 
id
string
on success
SPM Internal computed usage Id , 32 character string
Returned for get operation

Sample:
ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx
 
is_invoiced
boolean
on success
Invoicing status for the aggregated compute usage

Sample:
True
 
mqs_message_id
string
on success
MQS Identfier send to SPM , SPM does not transform this attribute and is received as is.

Sample:
ocid1.mqsmessage.oc1..xxxxxxEXAMPLExxxxxx
 
net_unit_price
string
on success
Net Unit Price for the product in consideration, price actual.

Sample:
net_unit_price_example
 
original_usage_number
string
on success
SPM Internal Original usage Line number identifier in SPM coming from Metered Services entity.

Sample:
original_usage_number_example
 
parent_product
complex
on success

   
billing_category
string
on success
Metered service billing category

Sample:
billing_category_example
   
name
string
on success
Product name

Sample:
name_example
   
part_number
string
on success
Product part number

Sample:
part_number_example
   
product_category
string
on success
Product category

Sample:
product_category_example
   
provisioning_group
string
on success
Product provisioning group

Sample:
provisioning_group_example
   
ucm_rate_card_part_type
string
on success
Rate card part type of Product

Sample:
ucm_rate_card_part_type_example
   
unit_of_measure
string
on success
Unit of Measure

Sample:
unit_of_measure_example
 
parent_subscribed_service_id
string
on success
Subscribed service line parent id

Sample:
ocid1.parentsubscribedservice.oc1..xxxxxxEXAMPLExxxxxx
 
plan_number
string
on success
Subscription plan number

Sample:
plan_number_example
 
product
complex
on success

   
billing_category
string
on success
Metered service billing category

Sample:
billing_category_example
   
name
string
on success
Product name

Sample:
name_example
   
part_number
string
on success
Product part number

Sample:
part_number_example
   
product_category
string
on success
Product category

Sample:
product_category_example
   
provisioning_group
string
on success
Product provisioning group

Sample:
provisioning_group_example
   
ucm_rate_card_part_type
string
on success
Rate card part type of Product

Sample:
ucm_rate_card_part_type_example
   
unit_of_measure
string
on success
Unit of Measure

Sample:
unit_of_measure_example
 
quantity
string
on success
Total Quantity that was used for computation

Sample:
quantity_example
 
rate_card_id
string
on success
Ratecard Id at subscribed service level

Sample:
ocid1.ratecard.oc1..xxxxxxEXAMPLExxxxxx
 
rate_card_tierd_id
string
on success
References the tier in the ratecard for that usage (OCI will be using the same reference to cross-reference for correctness on the usage csv report), comes from Entity OBSCNTR_IPT_PRODUCTTIER.

Sample:
ocid1.ratecardtierd.oc1..xxxxxxEXAMPLExxxxxx
 
time_created
string
on success
Computed Usage created time, expressed in RFC 3339 timestamp format.

Sample:
2013-10-20T19:20:30+01:00
 
time_metered_on
string
on success
Metered Service date, expressed in RFC 3339 timestamp format.

Sample:
2013-10-20T19:20:30+01:00
 
time_of_arrival
string
on success
Usae computation date, expressed in RFC 3339 timestamp format.

Sample:
2013-10-20T19:20:30+01:00
 
time_updated
string
on success
Computed Usage updated time, expressed in RFC 3339 timestamp format.

Sample:
2013-10-20T19:20:30+01:00
 
type
string
on success
Usage compute type in SPM.

Sample:
PROMOTION
 
unit_of_measure
string
on success
Unit of Messure

Sample:
unit_of_measure_example
 
usage_number
string
on success
SPM Internal usage Line number identifier in SPM coming from Metered Services entity.

Sample:
usage_number_example


Authors

  • Oracle (@oracle)