api-keys

The api-keys command allows you to view, edit and delete user API keys. API keys allow easy programmatic access to the CrateDB Cloud API and have the same permissions than the user they belong to.

Usage: croud api-keys [-h] {list,create,delete,edit} ...

api-keys list

List all the API keys that belong to the current user.

Usage: croud api-keys list [-h] [--region REGION]
                           [--output-fmt {table,wide,json,yaml}] [--sudo]

Optional Arguments

--region, -r

Temporarily use the specified region that command will be run in.

--output-fmt, --format, -o

Possible choices: table, wide, json, yaml

Change the formatting of the output.

--sudo

Run the given command as superuser.

Default: False

Example

sh$ croud api-keys list
+--------------------------------------------+------------------------------------+--------------+-------------------------------+
| user_id                                    | key                                | active       | last_used                     |
|--------------------------------------------+------------------------------------+--------------+-------------------------------|
| f167c730-1d3e-477d-a4d9-d0cb6fc51002       | my-first-key                       | TRUE         | 2022-12-05 09:00:03           |
| 5364bbac-d3ed-4f45-8579-c7f7779ca343       | my-second-key                      | TRUE         | NULL                          |
+--------------------------------------------+------------------------------------+--------------+-------------------------------+

api-keys create

Tip

Make sure to store the secret of the API key, as it will not be shown again after the creation.

Create a new API key for your user. It will have the same permissions as your user.

Usage: croud api-keys create [-h] [--region REGION]
                             [--output-fmt {table,wide,json,yaml}] [--sudo]

Optional Arguments

--region, -r

Temporarily use the specified region that command will be run in.

--output-fmt, --format, -o

Possible choices: table, wide, json, yaml

Change the formatting of the output.

--sudo

Run the given command as superuser.

Default: False

Example

sh$ croud api-keys create
+--------------------------------------------+------------------------------------+--------------+-------------------------------+
| user_id                                    | key                                | active       | secret                        |
|--------------------------------------------+------------------------------------+--------------+-------------------------------|
| f167c730-1d3e-477d-a4d9-d0cb6fc51002       | my-first-key                       | TRUE         | the-secret-of-they-key        |
+--------------------------------------------+------------------------------------+--------------+-------------------------------+

api-keys delete

Delete the API key specified that belongs to your user.

Usage: croud api-keys delete [-h] --api-key API_KEY [--region REGION]
                             [--output-fmt {table,wide,json,yaml}] [--sudo]

Required Arguments

--api-key

The key that identifies an API key that belongs to your user.

Optional Arguments

--region, -r

Temporarily use the specified region that command will be run in.

--output-fmt, --format, -o

Possible choices: table, wide, json, yaml

Change the formatting of the output.

--sudo

Run the given command as superuser.

Default: False

Example

sh$ croud api-keys delete --api-key my-first-key
==> Success: API key deleted.

api-keys edit

Allow activating or deactivating an existing API key

Usage: croud api-keys edit [-h] --api-key API_KEY --active {true,false}
                           [--region REGION]
                           [--output-fmt {table,wide,json,yaml}] [--sudo]

Required Arguments

--api-key

The key that identifies an API key that belongs to your user.

--active

Possible choices: true, false

Either true or false. Determines whether the API key can be used or not.

Optional Arguments

--region, -r

Temporarily use the specified region that command will be run in.

--output-fmt, --format, -o

Possible choices: table, wide, json, yaml

Change the formatting of the output.

--sudo

Run the given command as superuser.

Default: False

Example

sh$ croud api-keys edit --api-key my-first-key --active false
+------------------------------------|--------------+
| key                                | active       |
|------------------------------------+--------------|
| my-first-key                       | FALSE        |
+------------------------------------+--------------+