fabiog1901.cockroachdb.cc_invoices_info module – List invoices for a given organization.

Note

This module is part of the fabiog1901.cockroachdb collection (version 1.0.0).

To install it, use: ansible-galaxy collection install fabiog1901.cockroachdb. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: fabiog1901.cockroachdb.cc_invoices_info.

New in fabiog1901.cockroachdb 1.0.0

Synopsis

  • List invoices for a given organization.

  • A Cockroach Cloud Service Account API Key is required.

  • Export the key as environment variable ‘CC_KEY’ or pass it on module invokation

Requirements

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

  • cockroachdb-cloud-client

Parameters

Parameter

Comments

api_client

string

Define details for the API client

api_version

string

The API version to use

Default: "latest"

cc_key

string

The Service Account API key

This value is log redacted

By default it reads the env variable ‘CC_KEY’

host

string

the hostname of the API server

Default: "cockroachlabs.cloud"

path

string

the path to the API endpoint

Default: ""

port

string

the port number, as a string, for the API server

Default: "443"

scheme

string

http or https

Choices:

  • "http"

  • "https" ← (default)

verify_ssl

boolean

whether the client should verify the server cert

Choices:

  • false

  • true ← (default)

invoice_id

string

Examples

- name: list my bills
  fabiog1901.cockroachdb.cc_invoices_info:
    # invoice_id:
    api_client:
      api_version: '2022-09-20'

Return Values

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

Key

Description

invoices

list / elements=dictionary

Invoices are sorted by PeriodStart time.

[ Invoice message represents the details and the total charges associated with one billing period, which starts at the beginning of the month and ends at the beginning of the next month. The message also includes details about each invoice item. ]

Returned: always

balances

list / elements=dictionary

Balances are the amounts of currency left at the time of the invoice.

Returned: always

amount

integer

Amount is the quantity of currency.

Returned: always

currency

string

Currency is the set of currencies supported in CockroachCloud.

Allowed: USD┃CRDB_CLOUD_CREDITS

Returned: always

invoice_id

string

Returned: always

invoice_items

list / elements=dictionary

InvoiceItems are sorted by the cluster name.

Returned: always

cluster

dictionary

Returned: success

account_id

string

Returned: always

cloud_provider

string

GCP: The Google Cloud Platform cloud provider.

AWS: The Amazon Web Services cloud provider.

Allowed: GCP┃AWS

Returned: always

cockroach_version

string

Returned: always

config

dictionary

config details for either dedicated or serverless.

Returned: always

dedicated

dictionary

present only if dedicated cluster

Returned: success

disk_iops

integer

DiskIOPs is the number of disk I/O operations per second that are permitted on each node in the cluster. Zero indicates the cloud provider-specific default.

Returned: always

machine_type

string

MachineType is the machine type identifier within the given cloud provider, ex. m5.xlarge, n2-standard-4.

Returned: always

num_virtual_cpus

integer

NumVirtualCPUs is the number of virtual CPUs per node in the cluster.

Returned: always

storage_gib

integer

StorageGiB is the number of storage GiB per node in the cluster.

Returned: always

serverless

dictionary

present only if serverless cluster

Returned: success

routing_id

string

Used to build a connection string.

Returned: always

spend_limit

integer

Spend limit in US cents.

Returned: always

created_at

string

date-time

Returned: always

creator_id

string

Returned: always

deleted_at

string

date-time

Returned: success

id

string

Returned: always

name

string

Returned: always

operation_status

string

Allowed: CLUSTER_STATUS_UNSPECIFIED┃CRDB_MAJOR_UPGRADE_RUNNING┃CRDB_MAJOR_UPGRADE_FAILED┃CRDB_MAJOR_ROLLBACK_RUNNING┃CRDB_MAJOR_ROLLBACK_FAILED┃CRDB_PATCH_RUNNING┃CRDB_PATCH_FAILED┃CRDB_SCALE_RUNNING┃CRDB_SCALE_FAILED┃MAINTENANCE_RUNNING┃CRDB_INSTANCE_UPDATE_RUNNING┃CRDB_INSTANCE_UPDATE_FAILED┃CRDB_EDIT_CLUSTER_RUNNING┃CRDB_EDIT_CLUSTER_FAILED┃CRDB_CMEK_OPERATION_RUNNING┃CRDB_CMEK_OPERATION_FAILED┃TENANT_RESTORE_RUNNING┃TENANT_RESTORE_FAILED┃CRDB_LOG_EXPORT_OPERATION_RUNNING┃CRDB_LOG_EXPORT_OPERATION_FAILED

Returned: always

plan

string

DEDICATED: A paid plan that offers dedicated hardware in any location.

CUSTOM: A plan option that is used for clusters whose machine configs are not supported in self-service. All INVOICE clusters are under this plan option.

SERVERLESS: A paid plan that runs on shared hardware and caps the users’ maximum monthly spending to a user-specified (possibly 0) amount.

Allowed: DEDICATED┃CUSTOM┃SERVERLESS

Returned: always

regions

list / elements=string

Returned: always

internal_dns

string

InternalDns is the internal DNS name of the cluster within the cloud provider’s network. It is used to connect to the cluster with PrivateLink or VPC peering.

Returned: always

name

string

cluster name

Returned: always

node_count

integer

NodeCount will be 0 for serverless clusters.

Returned: always

sql_dns

string

SqlDns is the DNS name of SQL interface of the cluster. It is used to connect to the cluster with IP allowlisting.

Returned: always

ui_dns

string

UiDns is the DNS name used when connecting to the DB Console for the cluster.

Returned: always

state

string

LOCKED: An exclusive operation is being performed on this cluster. Other operations should not proceed if they did not set a cluster into the LOCKED state.

Allowed: CREATING┃CREATED┃CREATION_FAILED┃DELETED┃LOCKED

Returned: always

updated_at

string

Returned: always

line_items

list / elements=dictionary

LineItems contain all the relevant line items from the Metronome invoice.

Returned: success

description

string

Description contains the details of the line item (i.e t3 micro).

Returned: always

quantity

integer

Quantity is the number of the specific line items used.

Returned: always

quantity_unit

string

Billing QuantityUnitType is the unit type for a quantity of billing line item.

Allowed: HOURS┃REQUEST_UNITS

Returned: success

total

dictionary

Returned: success

amount

integer

Amount is the quantity of currency.

Returned: always

currency

string

Currency is the set of currencies supported in CockroachCloud.

Allowed: USD┃CRDB_CLOUD_CREDITS

Returned: always

unit_cost

integer

UnitCost is the cost per unit of line item.

Returned: always

totals

list / elements=string

Totals is a list of the total amounts of line items per currency.

Returned: success

amount

integer

Amount is the quantity of currency.

Returned: always

currency

string

Currency is the set of currencies supported in CockroachCloud.

Allowed: USD┃CRDB_CLOUD_CREDITS

Returned: always

period_end

string

PeriodEnd is the end of the billing period (exclusive).

Returned: always

period_start

string

PeriodStart is the start of the billing period (inclusive).

Returned: always

totals

list / elements=dictionary

Returned: success

amount

integer

Amount is the quantity of currency.

Returned: always

currency

string

Currency is the set of currencies supported in CockroachCloud.

Allowed: USD┃CRDB_CLOUD_CREDITS

Returned: always

Authors

  • Cockroach Labs