feat(influxdb3): Core and Ent: CLI reference for update database, update table (Ent3 only)- Add CLI reference for influxdb3 update database command and retention period option in Core and Ent

- Add CLI ref for influxdb3 update table and ret. period option in Ent- Change volume source to /test for core and ent3 in compose.yaml
- Add alt_links instructions in CONTRIBUTING.md
jts-6160-3-2-cli
Jason Stirnaman 2025-06-27 12:46:56 -05:00
parent 566f7dcb56
commit 6dac142127
14 changed files with 340 additions and 9 deletions

View File

@ -2,11 +2,11 @@
applyTo: "content/**/*.md, layouts/**/*.html" applyTo: "content/**/*.md, layouts/**/*.html"
--- ---
# GitHub Copilot Instructions for InfluxData Documentation # Contributing instructions for InfluxData Documentation
## Purpose and scope ## Purpose and scope
GitHub Copilot should help document InfluxData products Help document InfluxData products
by creating clear, accurate technical content with proper by creating clear, accurate technical content with proper
code examples, frontmatter, shortcodes, and formatting. code examples, frontmatter, shortcodes, and formatting.
@ -375,6 +375,9 @@ list_query_example:# Code examples included with article descriptions in childre
# References to examples in data/query_examples # References to examples in data/query_examples
canonical: # Path to canonical page, overrides auto-gen'd canonical URL canonical: # Path to canonical page, overrides auto-gen'd canonical URL
v2: # Path to v2 equivalent page v2: # Path to v2 equivalent page
alt_links: # Alternate pages in other products/versions for cross-product navigation
cloud-dedicated: /influxdb3/cloud-dedicated/path/to/page/
core: /influxdb3/core/path/to/page/
prepend: # Prepend markdown content to an article (especially powerful with cascade) prepend: # Prepend markdown content to an article (especially powerful with cascade)
block: # (Optional) Wrap content in a block style (note, warn, cloud) block: # (Optional) Wrap content in a block style (note, warn, cloud)
content: # Content to prepend to article content: # Content to prepend to article
@ -466,6 +469,29 @@ add the following frontmatter to the 1.x page:
v2: /influxdb/v2.0/get-started/ v2: /influxdb/v2.0/get-started/
``` ```
### Alternative links for cross-product navigation
Use the `alt_links` frontmatter to specify equivalent pages in other InfluxDB products,
for example, when a page exists at a different path in a different version or if
the feature doesn't exist in that product.
This enables the product switcher to navigate users to the corresponding page when they
switch between products. If a page doesn't exist in another product (for example, an
Enterprise-only feature), point to the nearest parent page if relevant.
```yaml
alt_links:
cloud-dedicated: /influxdb3/cloud-dedicated/admin/tokens/create-token/
cloud-serverless: /influxdb3/cloud-serverless/admin/tokens/create-token/
core: /influxdb3/core/reference/cli/influxdb3/update/ # Points to parent if exact page doesn't exist
```
Supported product keys for InfluxDB 3:
- `core`
- `enterprise`
- `cloud-serverless`
- `cloud-dedicated`
- `clustered`
### Prepend and append content to a page ### Prepend and append content to a page
Use the `prepend` and `append` frontmatter to add content to the top or bottom of a page. Use the `prepend` and `append` frontmatter to add content to the top or bottom of a page.

View File

@ -363,6 +363,9 @@ list_query_example:# Code examples included with article descriptions in childre
# References to examples in data/query_examples # References to examples in data/query_examples
canonical: # Path to canonical page, overrides auto-gen'd canonical URL canonical: # Path to canonical page, overrides auto-gen'd canonical URL
v2: # Path to v2 equivalent page v2: # Path to v2 equivalent page
alt_links: # Alternate pages in other products/versions for cross-product navigation
cloud-dedicated: /influxdb3/cloud-dedicated/path/to/page/
core: /influxdb3/core/path/to/page/
prepend: # Prepend markdown content to an article (especially powerful with cascade) prepend: # Prepend markdown content to an article (especially powerful with cascade)
block: # (Optional) Wrap content in a block style (note, warn, cloud) block: # (Optional) Wrap content in a block style (note, warn, cloud)
content: # Content to prepend to article content: # Content to prepend to article
@ -454,6 +457,29 @@ add the following frontmatter to the 1.x page:
v2: /influxdb/v2.0/get-started/ v2: /influxdb/v2.0/get-started/
``` ```
### Alternative links for cross-product navigation
Use the `alt_links` frontmatter to specify equivalent pages in other InfluxDB products,
for example, when a page exists at a different path in a different version or if
the feature doesn't exist in that product.
This enables the product switcher to navigate users to the corresponding page when they
switch between products. If a page doesn't exist in another product (for example, an
Enterprise-only feature), point to the nearest parent page if relevant.
```yaml
alt_links:
cloud-dedicated: /influxdb3/cloud-dedicated/admin/tokens/create-token/
cloud-serverless: /influxdb3/cloud-serverless/admin/tokens/create-token/
core: /influxdb3/core/reference/cli/influxdb3/update/ # Points to parent if exact page doesn't exist
```
Supported product keys for InfluxDB 3:
- `core`
- `enterprise`
- `cloud-serverless`
- `cloud-dedicated`
- `clustered`
### Prepend and append content to a page ### Prepend and append content to a page
Use the `prepend` and `append` frontmatter to add content to the top or bottom of a page. Use the `prepend` and `append` frontmatter to add content to the top or bottom of a page.

View File

@ -304,13 +304,21 @@ services:
image: influxdb:3-core image: influxdb:3-core
ports: ports:
- 8181:8181 - 8181:8181
volumes:
- type: bind
source: test/influxdb3/core/data
target: /var/lib/influxdb3/data
- type: bind
source: test/influxdb3/core/plugins
target: /var/lib/influxdb3-plugins
command: command:
- influxdb3 - influxdb3
- serve - serve
- --node-id=sensors_node0 - --node-id=node0
- --log-filter=debug - --log-filter=debug
- --object-store=file - --object-store=file
- --data-dir=/var/lib/influxdb3 - --data-dir=/var/lib/influxdb3/data
- --plugin-dir=/var/lib/influxdb3/plugins
influxdb3-enterprise: influxdb3-enterprise:
container_name: influxdb3-enterprise container_name: influxdb3-enterprise
image: influxdb:3-enterprise image: influxdb:3-enterprise
@ -326,16 +334,16 @@ services:
- --cluster-id=cluster0 - --cluster-id=cluster0
- --log-filter=debug - --log-filter=debug
- --object-store=file - --object-store=file
- --data-dir=/var/lib/influxdb3 - --data-dir=/var/lib/influxdb3/data
- --plugin-dir=/var/lib/influxdb3/plugins - --plugin-dir=/var/lib/influxdb3/plugins
- --license-email=${INFLUXDB3_LICENSE_EMAIL} - --license-email=${INFLUXDB3_LICENSE_EMAIL}
volumes: volumes:
- type: bind - type: bind
source: docker/influxdb3/data source: test/influxdb3/enterprise/data
target: /var/lib/influxdb3 target: /var/lib/influxdb3/data
- type: bind - type: bind
source: docker/influxdb3/plugins source: test/influxdb3/enterprise/plugins
target: /var/lib/influxdb3-plugins target: /var/lib/influxdb3/plugins
telegraf-pytest: telegraf-pytest:
container_name: telegraf-pytest container_name: telegraf-pytest
image: influxdata/docs-pytest image: influxdata/docs-pytest

View File

@ -32,6 +32,7 @@ influxdb3 [GLOBAL-OPTIONS] [COMMAND]
| [serve](/influxdb3/core/reference/cli/influxdb3/serve/) | Run the {{% product-name %}} server | | [serve](/influxdb3/core/reference/cli/influxdb3/serve/) | Run the {{% product-name %}} server |
| [show](/influxdb3/core/reference/cli/influxdb3/show/) | List resources | | [show](/influxdb3/core/reference/cli/influxdb3/show/) | List resources |
| [test](/influxdb3/core/reference/cli/influxdb3/test/) | Test plugins | | [test](/influxdb3/core/reference/cli/influxdb3/test/) | Test plugins |
| [update](/influxdb3/core/reference/cli/influxdb3/update/) | Update resources |
| [write](/influxdb3/core/reference/cli/influxdb3/write/) | Write to {{% product-name %}} | | [write](/influxdb3/core/reference/cli/influxdb3/write/) | Write to {{% product-name %}} |
## Global options ## Global options

View File

@ -0,0 +1,15 @@
---
title: influxdb3 update
description: >
The `influxdb3 update` command updates resources such as databases.
menu:
influxdb3_core:
parent: influxdb3
name: influxdb3 update
weight: 300
source: /shared/influxdb3-cli/update/_index.md
---
<!--
// SOURCE content/shared/influxdb3-cli/update/_index.md
-->

View File

@ -0,0 +1,15 @@
---
title: influxdb3 update database
description: >
The `influxdb3 update database` command updates an existing database.
menu:
influxdb3_core:
parent: influxdb3 update
name: influxdb3 update database
weight: 400
source: /shared/influxdb3-cli/update/database/_index.md
---
<!--
// SOURCE content/shared/influxdb3-cli/update/database/_index.md
-->

View File

@ -32,6 +32,7 @@ influxdb3 [GLOBAL-OPTIONS] [COMMAND]
| [serve](/influxdb3/enterprise/reference/cli/influxdb3/serve/) | Run the {{% product-name %}} server | | [serve](/influxdb3/enterprise/reference/cli/influxdb3/serve/) | Run the {{% product-name %}} server |
| [show](/influxdb3/enterprise/reference/cli/influxdb3/show/) | List resources | | [show](/influxdb3/enterprise/reference/cli/influxdb3/show/) | List resources |
| [test](/influxdb3/enterprise/reference/cli/influxdb3/test/) | Test plugins | | [test](/influxdb3/enterprise/reference/cli/influxdb3/test/) | Test plugins |
| [update](/influxdb3/enterprise/reference/cli/influxdb3/update/) | Update resources |
| [write](/influxdb3/enterprise/reference/cli/influxdb3/write/) | Write to {{% product-name %}} | | [write](/influxdb3/enterprise/reference/cli/influxdb3/write/) | Write to {{% product-name %}} |
## Global options ## Global options

View File

@ -0,0 +1,15 @@
---
title: influxdb3 update
description: >
The `influxdb3 update` command updates resources such as databases and tables.
menu:
influxdb3_enterprise:
parent: influxdb3
name: influxdb3 update
weight: 300
source: /shared/influxdb3-cli/update/_index.md
---
<!--
// SOURCE content/shared/influxdb3-cli/update/_index.md
-->

View File

@ -0,0 +1,15 @@
---
title: influxdb3 update database
description: >
The `influxdb3 update database` command updates an existing database.
menu:
influxdb3_enterprise:
parent: influxdb3 update
name: influxdb3 update database
weight: 400
source: /shared/influxdb3-cli/update/database/_index.md
---
<!--
// SOURCE content/shared/influxdb3-cli/update/database/_index.md
-->

View File

@ -0,0 +1,17 @@
---
title: influxdb3 update table
description: >
The `influxdb3 update table` command updates an existing table.
menu:
influxdb3_enterprise:
parent: influxdb3 update
name: influxdb3 update table
weight: 400
source: /shared/influxdb3-cli/update/table/_index.md
alt_links:
core: /influxdb3/core/reference/cli/influxdb3/update/
---
<!--
// SOURCE content/shared/influxdb3-cli/update/table/_index.md
-->

View File

@ -0,0 +1,33 @@
The `influxdb3 update` command updates resources such as databases and tables.
## Usage
<!--pytest.mark.skip-->
```bash
influxdb3 update <SUBCOMMAND>
```
## Subcommands
{{% show-in "enterprise" %}}
| Subcommand | Description |
| :----------------------------------------------------------------- | :--------------------- |
| [database](/influxdb3/version/reference/cli/influxdb3/update/database/) | Update a database |
| [table](/influxdb3/version/reference/cli/influxdb3/update/table/) | Update a table |
| help | Print command help or the help of a subcommand |
{{% /show-in %}}
{{% show-in "core" %}}
| Subcommand | Description |
| :----------------------------------------------------------------- | :--------------------- |
| [database](/influxdb3/version/reference/cli/influxdb3/update/database/) | Update a database |
| help | Print command help or the help of a subcommand |
{{% /show-in %}}
## Options
| Option | | Description |
| :----- | :----------- | :------------------------------ |
| `-h` | `--help` | Print help information |
| | `--help-all` | Print detailed help information |

View File

@ -0,0 +1,84 @@
The `influxdb3 update database` command updates an existing database in your {{< product-name >}} instance.
Use this command to update a database's retention period.
## Usage
<!--pytest.mark.skip-->
```bash
influxdb3 update database [OPTIONS] --database <DATABASE_NAME>
```
## Arguments
- **`DATABASE_NAME`**: (Required) The name of the database to update. Valid database names are alphanumeric and start with a letter or number. Dashes (-) and underscores (_) are allowed.
You can also set the database name using the `INFLUXDB3_DATABASE_NAME` environment variable.
## Options
| Option | | Description |
| :----- | :------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------- |
| `-H` | `--host` | Host URL of the running {{< product-name >}} server (default is `http://127.0.0.1:8181`) |
| `-d` | `--database` | The name of the database to update |
| | `--token` | Authentication token |
| `-r` | `--retention-period` | The retention period as a [duration](/influxdb3/version/reference/glossary/#duration) value (for example: `30d`, `24h`) or `none` to clear |
| | `--tls-ca` | Path to a custom TLS certificate authority (for testing or self-signed certificates) |
| `-h` | `--help` | Print help information |
| | `--help-all` | Print detailed help information |
### Option environment variables
You can use the following environment variables instead of providing CLI options directly:
| Environment Variable | Option |
| :------------------------ | :----------- |
| `INFLUXDB3_HOST_URL` | `--host` |
| `INFLUXDB3_DATABASE_NAME` | `--database` |
| `INFLUXDB3_AUTH_TOKEN` | `--token` |
| `INFLUXDB3_TLS_CA` | `--tls-ca` |
## Examples
The following examples show how to update a database.
In your commands replace the following:
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}:
Database name
- {{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}}:
Authentication token
{{% code-placeholders "DATABASE_NAME|AUTH_TOKEN" %}}
### Update a database retention period
Updates a database retention period to 30 days.
<!--pytest.mark.skip-->
```bash
influxdb3 update database --retention-period 30d DATABASE_NAME
```
### Clear a database retention period
Removes the retention period from a database by setting it to `none`.
<!--pytest.mark.skip-->
```bash
influxdb3 update database --retention-period none DATABASE_NAME
```
### Update a database with authentication
Updates a database using an authentication token.
<!--pytest.mark.skip-->
```bash
influxdb3 update database --token AUTH_TOKEN --retention-period 7d DATABASE_NAME
```
{{% /code-placeholders %}}

View File

@ -0,0 +1,74 @@
The `influxdb3 update table` command updates an existing table in a database in your {{< product-name >}} instance.
Use this command to update a table's retention period.
## Usage
<!--pytest.mark.skip-->
```bash
influxdb3 update table [OPTIONS] --database <DATABASE_NAME> <TABLE_NAME>
```
## Arguments
- **`TABLE_NAME`**: (Required) The name of the table to update
## Options
| Option | | Description |
| :----- | :------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------- |
| `-H` | `--host` | Host URL of the running {{< product-name >}} server (default is `http://127.0.0.1:8181`) |
| `-d` | `--database` | The name of the database containing the table |
| | `--token` | Authentication token |
| `-r` | `--retention-period` | The retention period as a [duration](/influxdb3/version/reference/glossary/#duration) value (for example: `30d`, `24h`) or `none` to clear |
| | `--tls-ca` | Path to a custom TLS certificate authority (for testing or self-signed certificates) |
| `-h` | `--help` | Print help information |
| | `--help-all` | Print detailed help information |
### Option environment variables
You can use the following environment variables instead of providing CLI options directly:
| Environment Variable | Option |
| :------------------------ | :----------- |
| `INFLUXDB3_HOST_URL` | `--host` |
| `INFLUXDB3_DATABASE_NAME` | `--database` |
| `INFLUXDB3_AUTH_TOKEN` | `--token` |
| `INFLUXDB3_TLS_CA` | `--tls-ca` |
## Examples
The following examples show how to update a table.
In your commands replace the following:
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}:
Database name
- {{% code-placeholder-key %}}`TABLE_NAME`{{% /code-placeholder-key %}}:
Table name
- {{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}}:
Authentication token
{{% code-placeholders "DATABASE_NAME|TABLE_NAME|AUTH_TOKEN" %}}
### Update a table retention period
Updates a table retention period to 30 days.
<!--pytest.mark.skip-->
```bash
influxdb3 update table --database DATABASE_NAME --token AUTH_TOKEN --retention-period 30d TABLE_NAME
```
### Clear a table retention period
Removes the retention period from a table by setting it to `none`.
<!--pytest.mark.skip-->
```bash
influxdb3 update table --database DATABASE_NAME --retention-period none TABLE_NAME
```
{{% /code-placeholders %}}

1
test/.gitignore vendored
View File

@ -2,6 +2,7 @@
/Cargo.lock /Cargo.lock
config.toml config.toml
content content
influxdb3/**/data
_*_pid _*_pid
node_modules node_modules
shared shared