Skip to content

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

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion content/shared/influxdb3-cli/create/distinct_cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,33 @@ You can use the following environment variables to set command options:
| `INFLUXDB3_DATABASE_NAME` | `--database` |
| `INFLUXDB3_AUTH_TOKEN` | `--token` |

<!-- TODO: GET EXAMPLES -->
## Examples

### Create a distinct value cache

{{% code-placeholders "(DATABASE|TABLE|COLUMN|CACHE)_NAME" %}}

<!--pytest.mark.skip-->

```bash
influxdb3 create distinct_cache \
--database DATABASE_NAME \
--table TABLE_NAME \
--column COLUMN_NAME \
CACHE_NAME
```

{{% /code-placeholders %}}

In the example above, 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 %}}`CACHE_NAME`{{% /code-placeholder-key %}}:
Name of the distinct value cache to delete
- {{% code-placeholder-key %}}`COLUMN_NAME`{{% /code-placeholder-key %}}: Column to cache distinct values from



27 changes: 26 additions & 1 deletion content/shared/influxdb3-cli/create/last_cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,29 @@ You can use the following environment variables to set command options:
| `INFLUXDB3_DATABASE_NAME` | `--database` |
| `INFLUXDB3_AUTH_TOKEN` | `--token` |

<!-- TODO: GET EXAMPLES -->
## Examples

### Create a last value cache

{{% code-placeholders "(DATABASE|TABLE|CACHE)_NAME (TAG_COLUMN|FIELD_COLUMN)" %}}

<!--pytest.mark.skip-->

```bash
influxdb3 create last_cache \
--database DATABASE_NAME \
--table TABLE_NAME \
--tag-columns TAG_COLUMN \
--field-columns FIELD_COLUMN \
CACHE_NAME
```

{{% /code-placeholders %}}

In the example above, 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 %}}`TAG_COLUMN`{{% /code-placeholder-key %}}: Column to use as a tag key for the cache
- {{% code-placeholder-key %}}`FIELD_COLUM`N{{% /code-placeholder-key %}}: Column to cache the last value from
- {{% code-placeholder-key %}}`CACHE_NAME`{{% /code-placeholder-key %}}: Name for the new last value cache
25 changes: 24 additions & 1 deletion content/shared/influxdb3-cli/create/plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,27 @@ You can use the following environment variables to set command options:
| `INFLUXDB3_DATABASE_NAME` | `--database` |
| `INFLUXDB3_AUTH_TOKEN` | `--token` |

<!-- TODO: GET EXAMPLES -->
## Examples
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plugin operations don't exist anymore. We should delete this and any other pages for plugin CRUD commands.


### Create a plugin

{{% code-placeholders "(DATABASE|PLUGIN)_NAME (FILENAME|FUNCTION_NAME)" %}}

<!--pytest.mark.skip-->

```bash
influxdb3 create plugin \
--database DATABASE_NAME \
--filename FILENAME.py \
--entry-point FUNCTION_NAME \
PLUGIN_NAME
```

{{% /code-placeholders %}}

In the example above, replace the following:

- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: Database name
- {{% code-placeholder-key %}}`FILENAME.py`{{% /code-placeholder-key %}}: Name of the plugin Python file (must be in the plugin directory)
- {{% code-placeholder-key %}}`FUNCTION_NAME`{{% /code-placeholder-key %}}: Name of the function in the Python file to use as the entry point
- {{% code-placeholder-key %}}`PLUGIN_NAME`{{% /code-placeholder-key %}}: Name for the new plugin
15 changes: 14 additions & 1 deletion content/shared/influxdb3-cli/create/token.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,24 @@ The `influxdb3 create token` command creates a new authentication token.
<!--pytest.mark.skip-->

```bash
influxdb3 create token
influxdb3 create token <SUBCOMMAND>
```

## Options

| Option | | Description |
| :----- | :------- | :--------------------- |
| |`--admin`| Create an admin token |
| `-h` | `--help` | Print help information |

## Examples

### Create an admin token

<!--pytest.mark.skip-->

```bash
influxdb3 create token --admin
```

This creates an admin token with full access to the system.
2 changes: 1 addition & 1 deletion content/shared/influxdb3-cli/delete/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ influxdb3 delete database [OPTIONS] <DATABASE_NAME>

## Arguments

- **DATABASE_NAME**: The name of the database to delete.
- **DATABASE_NAME**: The name of the database to delete. Valid database names are alphanumeric and start with a letter or number. Dashes (`-`) and underscores (`_`) are allowed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name requirements are really only necessary for create, b/c you need to know what chars you can use. For delete, you just need to know the existing database name. However, if we don't already mention the (token) permissions required, we should add that.


Environment variable: `INFLUXDB3_DATABASE_NAME`

Expand Down