fabiog1901.cockroachdb.cc_clusters_info module – List clusters owned by an 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_clusters_info.

New in fabiog1901.cockroachdb 1.0.0

Synopsis

  • List clusters owned by an 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)

cluster_id

string

The UUID or name of the cluster you want to get information for.

Omit for a full list of clusters under the organization.

show_inactive

boolean

If true, show clusters that have been deleted or failed to initialize.

Choices:

  • false ← (default)

  • true

show_nodes

boolean

If true, show nodes that compose this cluster. Only available for CUSTOM or DEDICATED clusters.

Choices:

  • false ← (default)

  • true

Examples

- name: list CC clusters in my org
  fabiog1901.cockroachdb.cc_clusters_info:
    show_inactive: no
    show_nodes: no
    api_client:
      api_version: '2022-09-20'
    register: out

Return Values

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

Key

Description

clusters

list / elements=dictionary

A list of regions

Returned: always

Sample: [{"account_id": "crl-abcd-fg5", "cloud_provider": "GCP", "cockroach_version": "v22.1.7", "config": {"dedicated": {"disk_iops": 450, "machine_type": "n1-standard-2", "memory_gib": 7.5, "num_virtual_cpus": 2, "storage_gib": 15}}, "created_at": "2022-09-07T15:38:55.339299Z", "creator_id": "zz895zzz-0307-471z-1234-123zzzzzzzz", "deleted_at": null, "id": "25fe8ade-1234-4d8b-1234-506ed445eed7", "name": "some-good-cluster", "operation_status": "CLUSTER_STATUS_UNSPECIFIED", "plan": "DEDICATED", "regions": [{"internal_dns": "", "name": "us-west2", "node_count": 1, "sql_dns": "some-good-cluster-gp7.gcp-us-west2.cockroachlabs.cloud", "ui_dns": "admin-some-good-cluster-gp7.gcp-us-west2.cockroachlabs.cloud"}], "state": "CREATED", "updated_at": "2022-10-20T17:58:41.008978Z"}]

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

nodes

list / elements=string

list of nodes that make up the cluster.

Only returned if show_nodes is True.

Only returned for Dedicated or Custom cluster. Not for Serverless clusters.

Returned: success

name

string

Returned: success

region_name

string

Returned: success

status

string

Allowed: LIVE┃NOT_READY

Returned: success

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

Authors

  • Cockroach Labs