cloudera.cloud.compute_usage_info module – Gather information about compute usage records

Note

This module is part of the cloudera.cloud collection (version 3.1.0).

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 cloudera.cloud.

To use it in a playbook, specify: cloudera.cloud.compute_usage_info.

New in cloudera.cloud 3.2.0

Synopsis

  • Gather information about compute usage records for a Cloudera on cloud tenant.

  • The module supports check_mode.

Parameters

Parameter

Comments

access_key

string

If provided, the Cloudera on cloud API will use this value as its access key.

If not provided, the API will attempt to use the value from the environment variable CDP_ACCESS_KEY_ID.

Required if private_key is provided.

Mutually exclusive with credentials_path.

credentials_path

string

If provided, the Cloudera on cloud API will use this value as its credentials path.

If not provided, the API will attempt to use the value from the environment variable CDP_CREDENTIALS_PATH.

Default: "~/.cdp/credentials"

debug

boolean

If true, the module will capture the Cloudera on cloud HTTP log and return it in the sdk_out and sdk_out_lines fields.

Choices:

  • false ← (default)

  • true

endpoint

aliases: url

string / required

The Cloudera on cloud API endpoint to use.

from_timestamp

string / required

The starting timestamp (ISO format) for the search range (inclusive).

http_agent

string

The HTTP user agent to use for Cloudera on cloud API requests.

Default: "cloudera.cloud"

private_key

string

If provided, the Cloudera on cloud API will use this value as its private key.

If not provided, the API will attempt to use the value from the environment variable CDP_PRIVATE_KEY.

Required if access_key is provided.

profile

string

If provided, the Cloudera on cloud API will use this value as its profile.

If not provided, the API will attempt to use the value from the environment variable CDP_PROFILE.

Default: "default"

to_timestamp

string / required

The ending timestamp (ISO format) for the search range (exclusive).

Examples

# Note: These examples do not set authentication details.

- name: Gather information about compute usage records
  cloudera.cloud.compute_usage_info:
    from_timestamp: "2023-01-01T00:00:00Z"
    to_timestamp: "2023-01-31T23:59:59Z"

Return Values

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

Key

Description

records

list / elements=dictionary

Returns a list of compute usage records.

Each record represents the aggregated hourly usage.

Returned: always

cloud_provider

string

The cloud provider for the running cluster.

Returned: when supported

Sample: "AWS"

cluster_crn

string

The cluster CRN.

Returned: when supported

cluster_name

string

The cluster name.

Returned: always

cluster_template

string

The template used to create the cluster.

Returned: when supported

cluster_type

string

The cluster type.

Returned: always

Sample: "Data Engineering"

environment_crn

string

The environment CRN for the cluster.

Returned: always

environment_name

string

The environment name for the cluster.

Returned: always

gross_charge

float

Number of credits consumed for the compute usage record.

Returned: always

hours

float

Total number of hours for which the instances were running.

Returned: always

instance_count

integer

Total number of instances in use.

Returned: always

instance_type

string

The instance type for the cluster.

Returned: always

list_rate

float

Rate in credits at which usage is charged for given cluster type, instance type, and cloud provider.

Returned: always

quantity

float

Quantity of usage of the cluster.

Returned: always

quantity_type

float

Type of usage by the cluster.

Returned: always

Sample: ["INSTANCE_USAGE", "COMPUTE_USAGE"]

service_feature

string

The service feature for the cluster.

Returned: when supported

usage_end_timestamp

string

Timestamp of end of the usage (ISO format).

Returned: always

usage_start_timestamp

string

Timestamp of start of the usage (ISO format).

Returned: always

user_tags

string

User-defined tags assigned to the cluster.

Returns a JSON-encoded string of key-value pairs.

Returned: when supported

sdk_out

string

Returns the captured API HTTP log.

Returned: when supported

sdk_out_lines

list / elements=string

Returns a list of each line of the captured API HTTP log.

Returned: when supported

Authors

  • Webster Mudge (@wmudge)