docs: update schedule_plugin command options and environment variables

pr-6089
meelahme 2025-06-09 08:40:59 -07:00
parent f49fda8e36
commit 8f1359420f
1 changed files with 28 additions and 10 deletions

View File

@ -11,18 +11,22 @@ influxdb3 test schedule_plugin [OPTIONS] --database <DATABASE_NAME> <FILENAME>
## Arguments
- **FILENAME**: the path to the plugin file. Use the full absolute path or the path relative to the current working directory, such as `<plugin-dir>/<plugin-file-name>.py`.
- **FILENAME**: Path to the plugin file. Use the absolute path or the path relative to the current working directory, such as `<plugin-dir>/<plugin-file-name>.py`.
## Options
| Option | Flag | Description |
| :----- | :----------------- | :--------------------------------------------------------------------------------------- |
| `-H` | `--host` | Host URL of the running {{< product-name >}} server (default: `http://127.0.0.1:8181`) |
| `-d` | `--database` | _({{< req >}})_ Name of the database to operate on |
| | `--token` | _({{< req >}})_ Authentication token |
| | `--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 | Flag | Description |
| :----- | :-------------------- | :-------------------------------------------------------------------------------------------- |
| `-H` | `--host` | URL of the running {{< product-name >}} server <br>(default: `http://127.0.0.1:8181`) |
| `-d` | `--database` | _({{< req >}})_ Name of the database you want to test the plugin against |
| | `--token` | _({{< req >}})_ Authentication token |
| | `--input-arguments` | JSON map of key/value pairs to pass as plugin input arguments (for example, `'{"key":"val"}'`)|
| | `--schedule` | Cron schedule to simulate when testing the plugin <br>(default: `* * * * *`) |
| | `--cache-name` | Optional cache name to associate with the test |
| | `--tls-ca` | Path to a custom TLS certificate authority for self-signed certs |
| `-h` | `--help` | Show basic help information |
| | `--help-all` | Show all available help options |
### Option environment variables
@ -33,6 +37,7 @@ You can use the following environment variables to set command options:
| `INFLUXDB3_HOST_URL` | `--host` |
| `INFLUXDB3_DATABASE_NAME` | `--database` |
| `INFLUXDB3_AUTH_TOKEN` | `--token` |
| `INFLUXDB3_TLS_CA` | `--tls-ca` |
## Examples
@ -45,7 +50,7 @@ In the examples below, replace the following:
- {{% code-placeholder-key %}}`FILENAME`{{% /code-placeholder-key %}}:
Plugin file name
{{% code-placeholders "(DATABASE|PLUGIN_DIR|FILENAME|AUTH_TOKEN" %}}
{{% code-placeholders "(DATABASE|PLUGIN_DIR|FILENAME|AUTH_TOKEN)" %}}
### Test a schedule plugin
@ -58,4 +63,17 @@ influxdb3 test schedule_plugin \
PLUGIN_DIR/FILENAME.py
```
### Test with input arguments and a custom cron schedule
<!--pytest.mark.skip-->
```bash
influxdb3 test schedule_plugin \
--database DATABASE_NAME \
--token AUTH_TOKEN \
--input-arguments '{"threshold": "10", "unit": "seconds"}' \
--schedule "0 * * * *" \
PLUGIN_DIR/FILENAME.py
```
{{% /code-placeholders %}}