-
Notifications
You must be signed in to change notification settings - Fork 298
Adding adequate CLI examples for creating triggers #6002
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
e481e68
0c85184
4746e6e
22c9fc4
4f11fc1
4199554
d72eccd
7d6d7f1
07aded0
481575e
98d8d6e
dfd1a9c
b16ea65
958e0a8
289c24e
81d8863
1569829
87cb056
88ec6af
85310e1
b3be9de
f592009
e659a0b
b71dd9a
46a4d35
e9bcb06
dedf9ca
eecde07
38a9aaf
0f853d0
5ee9686
8988fb6
07c8b95
386cfc2
8f8bf55
e6d8838
994e848
663cfc9
0cbfade
5a843f5
18a4413
94b4228
0f8945f
8847d67
02c3a8b
b460338
21588fe
3edf4e7
9834fab
dd8369b
df24a22
2ae9d67
af99904
2c3b3f8
7a39062
3a39a92
ef239ef
a2145f0
cf87936
6917097
7f1a3b6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
title: Revoke a database token | ||
description: > | ||
Use the [`influxctl token revoke` command](/influxdb3/clustered/reference/cli/influxctl/token/revoke/) | ||
to revoke a token from your InfluxDB cluster and disable all | ||
permissions associated with the token. | ||
Provide the ID of the token you want to revoke. | ||
menu: | ||
influxdb3_clustered: | ||
parent: Database tokens | ||
weight: 203 | ||
list_code_example: | | ||
```sh | ||
influxctl token revoke <TOKEN_ID> | ||
``` | ||
aliases: | ||
- /influxdb3/clustered/admin/tokens/delete/ | ||
- /influxdb3/clustered/admin/tokens/database/delete/ | ||
--- | ||
|
||
Use the [`influxctl token revoke` command](/influxdb3/clustered/reference/cli/influxctl/token/revoke/) | ||
to revoke a database token from your {{< product-name omit=" Clustered" >}} cluster and disable | ||
all permissions associated with the token. | ||
|
||
1. If you haven't already, [download and install the `influxctl` CLI](/influxdb3/clustered/reference/cli/influxctl/#download-and-install-influxctl). | ||
2. Run the [`influxctl token list` command](/influxdb3/clustered/reference/cli/influxctl/token/list) | ||
to output tokens with their IDs. | ||
Copy the **token ID** of the token you want to delete. | ||
|
||
```sh | ||
influxctl token list | ||
``` | ||
|
||
3. Run the `influxctl token revoke` command and provide the following: | ||
|
||
- Token ID to revoke | ||
|
||
4. Confirm that you want to revoke the token. | ||
|
||
{{% code-placeholders "TOKEN_ID" %}} | ||
```sh | ||
influxctl token revoke TOKEN_ID | ||
``` | ||
{{% /code-placeholders %}} | ||
|
||
> [!Warning] | ||
> #### Revoking a token is immediate and cannot be undone | ||
> | ||
> Revoking a database token is a destructive action that takes place immediately | ||
> and cannot be undone. | ||
> | ||
> #### Rotate revoked tokens | ||
> | ||
> After revoking a database token, any clients using the revoked token need to | ||
> be updated with a new database token to continue to interact with your | ||
> {{% product-name omit=" Clustered" %}} cluster. |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,23 @@ | ||
|
||
The `influxdb3 create last_cache` command creates a new last value cache. | ||
The `influxdb3 create last_cache` command creates a last value cache, which stores the most recent values for specified columns in a table. Use this to efficiently retrieve the latest values based on key column combinations. | ||
|
||
## Usage | ||
|
||
{{% code-placeholders "DATABASE_NAME|TABLE_NAME|AUTH_TOKEN|CACHE_NAME" %}} | ||
|
||
<!--pytest.mark.skip--> | ||
|
||
```bash | ||
influxdb3 create last_cache [OPTIONS] --database <DATABASE_NAME> --table <TABLE> [CACHE_NAME] | ||
influxdb3 create last_cache [OPTIONS] \ | ||
--database DATABASE_NAME \ | ||
--table TABLE_NAME \ | ||
--token AUTH_TOKEN \ | ||
CACHE_NAME | ||
``` | ||
{{% /code-placeholders %}} | ||
|
||
## Arguments | ||
|
||
- **CACHE_NAME**: _(Optional)_ Name for the cache. | ||
If not provided, the command automatically generates a name. | ||
- **CACHE_NAME**: _(Optional)_ Name for the cache. If omitted, InfluxDB automatically generates one. | ||
|
||
## Options | ||
|
||
|
@@ -32,12 +37,67 @@ influxdb3 create last_cache [OPTIONS] --database <DATABASE_NAME> --table <TABLE> | |
|
||
### Option environment variables | ||
|
||
You can use the following environment variables to set command options: | ||
You can use the following environment variables as substitutes for CLI options: | ||
|
||
| Environment Variable | Option | | ||
| :------------------------ | :----------- | | ||
| `INFLUXDB3_HOST_URL` | `--host` | | ||
| `INFLUXDB3_DATABASE_NAME` | `--database` | | ||
| `INFLUXDB3_AUTH_TOKEN` | `--token` | | ||
|
||
<!-- TODO: GET EXAMPLES --> | ||
## Prerequisites | ||
|
||
Before creating a last value cache, ensure you’ve done the following: | ||
|
||
- Create a [database](/influxdb3/version/reference/cli/influxdb3/create/database/). | ||
- Create a [table](/influxdb3/version/reference/cli/influxdb3/create/table/) with the columns you want to cache. | ||
- Have a valid authentication token. | ||
|
||
## Examples | ||
|
||
A last value cache stores the most recent values from specified columns in a table. | ||
|
||
### Create a basic last value cache for one column | ||
|
||
The following example shows how to track the most recent value for a single key (the last temperature for each room): | ||
|
||
<!--pytest.mark.skip--> | ||
|
||
```bash | ||
influxdb3 create last_cache \ | ||
--database DATABASE_NAME \ | ||
--table my_sensor_table \ | ||
--token AUTH_TOKEN \ | ||
--key-columns room \ | ||
--value-columns temp \ | ||
my_temp_cache | ||
``` | ||
|
||
### Create a last value cache with multiple keys and values | ||
|
||
The following example shows how to: | ||
|
||
- Use multiple columns as a composite key | ||
- Track several values per key combination | ||
- Set a cache entry limit with `--count` | ||
- Configure automatic expiry with `--ttl` | ||
|
||
<!--pytest.mark.skip--> | ||
|
||
```bash | ||
influxdb3 create last_cache \ | ||
--database DATABASE_NAME \ | ||
--table my_sensor_table \ | ||
--token AUTH_TOKEN \ | ||
--key-columns room,sensor_id \ | ||
--value-columns temp,hum \ | ||
--count 10 \ | ||
--ttl 1h \ | ||
my_sensor_cache | ||
``` | ||
Comment on lines
+80
to
+97
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
|
||
## Usage notes | ||
|
||
- All specified key and value columns must exist in the table schema. | ||
- Tokens must be passed with `--token` unless set via environment variable. | ||
- If not specified, default values are used for `--count` and `--ttl`. | ||
Comment on lines
+101
to
+103
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer active voice. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reference docs are generally terse and 3rd person--we don't usually include "Use the..." like we do in the guides.
You could do