Add new influxdb3 show system commands (#5812)

* add new show system table commands

* Apply suggestions from code review

Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>

* Update content/shared/influxdb3-cli/show/system/summary.md

Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>

---------

Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
sample-data-cli
Scott Anderson 2025-01-30 15:19:48 -07:00 committed by GitHub
parent 80a523d921
commit 43efe0c4c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 351 additions and 4 deletions

View File

@ -0,0 +1,16 @@
---
title: influxdb3 show system
description: >
The `influxdb3 show system` command displays data from {{< product-name >}}
system tables.
menu:
influxdb3_core:
parent: influxdb3 show
name: influxdb3 show system
weight: 400
source: /shared/influxdb3-cli/show/system/_index.md
---
<!--
The content for this page is at content/shared/influxdb3-cli/show/system/_index.md
-->

View File

@ -0,0 +1,16 @@
---
title: influxdb3 show system summary
description: >
The `influxdb3 show system summary` command returns a summary various types of
system table data.
menu:
influxdb3_core:
parent: influxdb3 show system
name: influxdb3 show system summary
weight: 401
source: /shared/influxdb3-cli/show/system/summary.md
---
<!--
The content for this page is at content/shared/influxdb3-cli/show/system/summary.md
-->

View File

@ -0,0 +1,15 @@
---
title: influxdb3 show system table-list
description: >
The `influxdb3 show system table-list` command lists available system tables.
menu:
influxdb3_core:
parent: influxdb3 show system
name: influxdb3 show system table-list
weight: 401
source: /shared/influxdb3-cli/show/system/table-list.md
---
<!--
The content for this page is at content/shared/influxdb3-cli/show/system/table-list.md
-->

View File

@ -0,0 +1,15 @@
---
title: influxdb3 show system table
description: >
The `influxdb3 show system table` command queries data from a system table.
menu:
influxdb3_core:
parent: influxdb3 show system
name: influxdb3 show system table
weight: 401
source: /shared/influxdb3-cli/show/system/table.md
---
<!--
The content for this page is at content/shared/influxdb3-cli/show/system/table.md
-->

View File

@ -0,0 +1,16 @@
---
title: influxdb3 show system
description: >
The `influxdb3 show system` command displays data from {{< product-name >}}
system tables.
menu:
influxdb3_enterprise:
parent: influxdb3 show
name: influxdb3 show system
weight: 400
source: /shared/influxdb3-cli/show/system/_index.md
---
<!--
The content for this page is at content/shared/influxdb3-cli/show/system/_index.md
-->

View File

@ -0,0 +1,16 @@
---
title: influxdb3 show system summary
description: >
The `influxdb3 show system summary` command returns a summary various types of
system table data.
menu:
influxdb3_enterprise:
parent: influxdb3 show system
name: influxdb3 show system summary
weight: 401
source: /shared/influxdb3-cli/show/system/summary.md
---
<!--
The content for this page is at content/shared/influxdb3-cli/show/system/summary.md
-->

View File

@ -0,0 +1,15 @@
---
title: influxdb3 show system table-list
description: >
The `influxdb3 show system table-list` command lists available system tables.
menu:
influxdb3_enterprise:
parent: influxdb3 show system
name: influxdb3 show system table-list
weight: 401
source: /shared/influxdb3-cli/show/system/table-list.md
---
<!--
The content for this page is at content/shared/influxdb3-cli/show/system/table-list.md
-->

View File

@ -0,0 +1,15 @@
---
title: influxdb3 show system table
description: >
The `influxdb3 show system table` command queries data from a system table.
menu:
influxdb3_enterprise:
parent: influxdb3 show system
name: influxdb3 show system table
weight: 401
source: /shared/influxdb3-cli/show/system/table.md
---
<!--
The content for this page is at content/shared/influxdb3-cli/show/system/table.md
-->

View File

@ -11,10 +11,11 @@ influxdb3 show <SUBCOMMAND>
## Subcommands
| Subcommand | Description |
| :------------------------------------------------------------------------- | :--------------------------------------------- |
| Subcommand | Description |
| :---------------------------------------------------------------------- | :--------------------------------------------- |
| [databases](/influxdb3/version/reference/cli/influxdb3/show/databases/) | List database |
| help | Print command help or the help of a subcommand |
| [system](/influxdb3/version/reference/cli/influxdb3/show/system/) | Display system table data |
| help | Print command help or the help of a subcommand |
## Options

View File

@ -18,7 +18,7 @@ influxdb3 show databases [OPTIONS]
| `-d` | `--database` | _({{< req >}})_ Name of the database to operate on |
| | `--token` | Authentication token |
| | `--show-deleted` | Include databases marked as deleted in the output |
| | `--format` | Output format (`pretty` _(default)_, `json`, `jsonl`, or `csv`) |
| | `--format` | Output format (`pretty` _(default)_, `json`, `jsonl`, `csv`, or `parquet`) |
| `-h` | `--help` | Print help information |
### Option environment variables

View File

@ -0,0 +1,43 @@
The `influxdb3 show system` command displays data from {{< product-name >}}
system tables.
## Usage
<!--pytest.mark.skip-->
```bash
influxdb3 show system [OPTIONS] --database <DATABASE_NAME> <SUBCOMMAND>
```
##### Aliases
`system`, `s`
## Subcommands
| Subcommand | Description |
| :---------------------------------------------------------------------------- | :--------------------------------------------- |
| [summary](/influxdb3/version/reference/cli/influxdb3/show/system/summary) | Summarize system table data |
| [table](/influxdb3/version/reference/cli/influxdb3/show/system/table/) | Retrieve entries from a specific system table |
| [table-list](/influxdb3/version/reference/cli/influxdb3/show/system/table-list/) | List available system tables |
| help | Print command help or the help of a subcommand |
## Options
| Option | | Description |
| :----- | :--------------- | :--------------------------------------------------------------------------------------- |
| `-H` | `--host` | Host URL of the running {{< product-name >}} server (default is `http://127.0.0.1:8181`) |
| `-d` | `--database` | _({{< req >}})_ Name of the database to operate on |
| | `--token` | Authentication token |
| `-h` | `--help` | Print help information |
### Option environment variables
You can use the following environment variables to set command options:
| Environment Variable | Option |
| :------------------------ | :----------- |
| `INFLUXDB3_HOST_URL` | `--host` |
| `INFLUXDB3_DATABASE_NAME` | `--database` |
| `INFLUXDB3_AUTH_TOKEN` | `--token` |

View File

@ -0,0 +1,48 @@
The `influxdb3 show system summary` command returns a summary of various types of
system table data.
## Usage
<!--pytest.mark.skip-->
```bash
influxdb3 show system --database <DATABASE_NAME> summary [OPTIONS]
```
## Options
| Option | | Description |
| :----- | :--------- | :--------------------------------------------------------------------------------------------- |
| `-l` | `--limit` | Maximum number of entries from each table to display (default is `10`, `0` indicates no limit) |
| | `--format` | Output format (`pretty` _(default)_, `json`, `jsonl`, `csv`, or `parquet`) |
| `-h` | `--help` | Print help information |
## Examples
- [Summarize system table data](#summarize-system-table-data)
- [Summarize system table data in JSON-formatted output](#summarize-system-table-data-in-json-formatted-output)
In the examples below, replace
{{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}} with
the name of the database to operate on.
{{% code-placeholders "DATABASE_NAME" %}}
### Summarize system table data
<!--pytest.mark.skip-->
```bash
influxdb3 show system --database DATABASE_NAME summary
```
### Summarize system table data in JSON-formatted output
<!--pytest.mark.skip-->
```bash
influxdb3 show system --database DATABASE_NAME summary --format json
```
{{% /code-placeholders %}}

View File

@ -0,0 +1,46 @@
The `influxdb3 show system table-list` command lists available system tables.
## Usage
<!--pytest.mark.skip-->
```bash
influxdb3 show system --database <DATABASE_NAME> table-list [OPTIONS]
```
## Options
| Option | | Description |
| :----- | :--------- | :--------------------------------------------------------------------------------------------- |
| | `--format` | Output format (`pretty` _(default)_, `json`, `jsonl`, `csv`, or `parquet`) |
| `-h` | `--help` | Print help information |
## Examples
- [List system tables](#list-system-tables)
- [List system tables in JSON-formatted output](#list-system-tables-in-json-formatted-output)
In the examples below, replace
{{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}} with
the name of the database to operate on.
{{% code-placeholders "DATABASE_NAME" %}}
### List system tables
<!--pytest.mark.skip-->
```bash
influxdb3 show system --database DATABASE_NAME summary
```
### List system tables in JSON-formatted output
<!--pytest.mark.skip-->
```bash
influxdb3 show system --database DATABASE_NAME summary --format json
```
{{% /code-placeholders %}}

View File

@ -0,0 +1,85 @@
The `influxdb3 show system table` command queries data from a system table.
## Usage
<!--pytest.mark.skip-->
```bash
influxdb3 show system --database <DATABASE_NAME> table [OPTIONS] <SYSTEM_TABLE>
```
## Arguments
- **SYSTEM_TABLE**: the system table to query
## Options
| Option | | Description |
| :----- | :----------- | :------------------------------------------------------------------------------------ |
| `-l` | `--limit` | Maximum number of tables entries to display (default is `10`, `0` indicates no limit) |
| `-o` | `--order-by` | Order by the specified columns |
| `-s` | `--select` | Select specific columns from the system table |
| | `--format` | Output format (`pretty` _(default)_, `json`, `jsonl`, `csv`, or `parquet`) |
| `-h` | `--help` | Print help information |
## Examples
- [Query a system table](#query-a-system-table)
- [Query specific columns from a system table](#query-specific-columns-from-a-system-table)
- [Query a system table and order by a specific column](#query-a-system-table-and-order-by-a-specific-column)
- [Query a system table and return JSON-formatted output](#query-a-system-table-and-return-json-formatted-output)
In the examples below, replace
{{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}} with
the name of the database to operate on.
{{% code-placeholders "DATABASE_NAME" %}}
### Query a system table
<!--pytest.mark.skip-->
```bash
# Query the parquet_files system table
influxdb3 show system --database DATABASE_NAME table parquet_files
```
### Query specific columns from a system table
<!--pytest.mark.skip-->
```bash
# Select specific columns from the parquet_files system table
influxdb3 show system \
--database DATABASE_NAME \
table \
--select table_name,size_bytes,row_count \
parquet_files
```
### Query a system table and order by a specific column
<!--pytest.mark.skip-->
```bash
influxdb3 show system \
--database DATABASE_NAME \
table \
--order-by size_bytes,row_count \
parquet_files
```
### Query a system table and return JSON-formatted output
<!--pytest.mark.skip-->
```bash
influxdb3 show system \
--database DATABASE_NAME \
table \
--format json \
parquet_files
```
{{% /code-placeholders %}}