From 85310e12822e6b2e687eb16570029833c44a0e7b Mon Sep 17 00:00:00 2001 From: meelahme Date: Wed, 30 Apr 2025 22:41:45 -0700 Subject: [PATCH] docs: add examples and clarify usage for token, distinct_cache, and last_cache commands --- .../influxdb3-cli/create/distinct_cache.md | 4 ++++ .../shared/influxdb3-cli/create/last_cache.md | 4 ++-- content/shared/influxdb3-cli/create/token.md | 19 ++++++++++++++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/content/shared/influxdb3-cli/create/distinct_cache.md b/content/shared/influxdb3-cli/create/distinct_cache.md index 26d68ff12..c4a4069dc 100644 --- a/content/shared/influxdb3-cli/create/distinct_cache.md +++ b/content/shared/influxdb3-cli/create/distinct_cache.md @@ -93,6 +93,8 @@ In the example above, replace the following: Use this simple setup to test the cache functionality for a single tag column. It’s helpful when validating basic behavior or building up incrementally. + + ```bash influxdb3 create distinct_cache \ --database my_test_db \ @@ -105,6 +107,8 @@ influxdb3 create distinct_cache \ Use this pattern when you need more control over cache structure and retention. It creates a multilevel cache with resource limits. + + ```bash influxdb3 create distinct_cache \ --database my_test_db \ diff --git a/content/shared/influxdb3-cli/create/last_cache.md b/content/shared/influxdb3-cli/create/last_cache.md index ae8098839..49d20a781 100644 --- a/content/shared/influxdb3-cli/create/last_cache.md +++ b/content/shared/influxdb3-cli/create/last_cache.md @@ -95,12 +95,12 @@ influxdb3 create last_cache \ my_temp_cache ``` - - ## Create a last value cache with multiple keys and values This example shows how to configure a more complex cache: + + ```bash influxdb3 create last_cache \ --database my_test_db \ diff --git a/content/shared/influxdb3-cli/create/token.md b/content/shared/influxdb3-cli/create/token.md index fa8b91226..6cf95dfba 100644 --- a/content/shared/influxdb3-cli/create/token.md +++ b/content/shared/influxdb3-cli/create/token.md @@ -1,4 +1,3 @@ - The `influxdb3 create token` command creates a new authentication token. ## Usage @@ -33,3 +32,21 @@ influxdb3 create token ```bash influxdb3 create token --admin ``` + +This returns a token string. You can use it to authenticate future requests by setting it with `--token` or the `INFLUXDB3_AUTH_TOKEN` environment variable. + +### Use the token to create a database + + + +```bash +influxdb3 create database \ + --token YOUR_ADMIN_TOKEN \ + my_new_database +``` + +> [!Tip] +> Set the token as an environment variable to simplify repeated commands: +> ```bash +> export INFLUXDB3_AUTH_TOKEN=YOUR_ADMIN_TOKEN +> ```