From 2895396deb2174ed9665bb7a8f4938868de2585c Mon Sep 17 00:00:00 2001 From: meelahme Date: Sat, 24 May 2025 10:12:08 +0900 Subject: [PATCH 01/14] docs: add schedule_plugin test command reference to CLI docs --- content/shared/influxdb3-cli/test/schedule_plugin.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 content/shared/influxdb3-cli/test/schedule_plugin.md diff --git a/content/shared/influxdb3-cli/test/schedule_plugin.md b/content/shared/influxdb3-cli/test/schedule_plugin.md new file mode 100644 index 000000000..f6b0ea459 --- /dev/null +++ b/content/shared/influxdb3-cli/test/schedule_plugin.md @@ -0,0 +1,4 @@ + +The `influxdb3 test schedule_plugin` command tests a schedule plugin. +Use this command to verify plugin behavior without creating a trigger. + From 2d31bdfa3444755eb7809da1cc09e34c7d8e753a Mon Sep 17 00:00:00 2001 From: meelahme Date: Sat, 24 May 2025 10:56:04 +0900 Subject: [PATCH 02/14] docs(schedule_plugin): add option environment variables table --- assets/jsconfig.json | 3 +- .../influxdb3-cli/test/schedule_plugin.md | 53 +++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/assets/jsconfig.json b/assets/jsconfig.json index 377218ccb..4ad710c10 100644 --- a/assets/jsconfig.json +++ b/assets/jsconfig.json @@ -3,7 +3,8 @@ "baseUrl": ".", "paths": { "*": [ - "*" + "*", + "../node_modules/*" ] } } diff --git a/content/shared/influxdb3-cli/test/schedule_plugin.md b/content/shared/influxdb3-cli/test/schedule_plugin.md index f6b0ea459..d163f97f2 100644 --- a/content/shared/influxdb3-cli/test/schedule_plugin.md +++ b/content/shared/influxdb3-cli/test/schedule_plugin.md @@ -2,3 +2,56 @@ The `influxdb3 test schedule_plugin` command tests a schedule plugin. Use this command to verify plugin behavior without creating a trigger. +## Usage + + + +```bash +influxdb3 test schedule_plugin [OPTIONS] --database +``` +## Arguments + +- **FileName**: Path to the local plugin file (usually ends in `.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 environment variables + +You can use the following environment variables to set command options: + +| Environment Variable | Corresponding Option | +| :------------------------ | :------------------- | +| `INFLUXDB3_HOST_URL` | `--host` | +| `INFLUXDB3_DATABASE_NAME` | `--database` | +| `INFLUXDB3_AUTH_TOKEN` | `--token` | + +## Examples + +In the examples below, replace the following: + +- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: Your target database +- {{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}}: Your authentication token +- {{% code-placeholder-key %}}`PLUGIN_FILENAME`{{% /code-placeholder-key %}}: Plugin filename (with path) + +{{% code-placeholders "DATABASE_NAME|AUTH_TOKEN|PLUGIN_FILENAME" %}} + +## Test a schedule plugin + + + +```bash +influxdb3 test schedule_plugin \ + --database DATABASE_NAME \ + --token AUTH_TOKEN \ + PLUGIN_FILENAME.py +``` +{{% /code-placeholders %}} \ No newline at end of file From b2c7660ee5591d56c8930fb4f268fe19ed6770c2 Mon Sep 17 00:00:00 2001 From: meelahme Date: Sat, 24 May 2025 11:34:45 +0900 Subject: [PATCH 03/14] minor changes to headlines structure --- content/shared/influxdb3-cli/test/schedule_plugin.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/content/shared/influxdb3-cli/test/schedule_plugin.md b/content/shared/influxdb3-cli/test/schedule_plugin.md index d163f97f2..8d27bd9b4 100644 --- a/content/shared/influxdb3-cli/test/schedule_plugin.md +++ b/content/shared/influxdb3-cli/test/schedule_plugin.md @@ -44,7 +44,7 @@ In the examples below, replace the following: {{% code-placeholders "DATABASE_NAME|AUTH_TOKEN|PLUGIN_FILENAME" %}} -## Test a schedule plugin +### Test a schedule plugin @@ -54,4 +54,5 @@ influxdb3 test schedule_plugin \ --token AUTH_TOKEN \ PLUGIN_FILENAME.py ``` -{{% /code-placeholders %}} \ No newline at end of file +{{% /code-placeholders %}} + From 20366d1144cdb3e4daee26553bd34ba529238d46 Mon Sep 17 00:00:00 2001 From: meelahme Date: Sat, 24 May 2025 12:18:55 +0900 Subject: [PATCH 04/14] docs: add schedule_plugin route files for Core and Enterprise --- .../cli/influxdb3/test/schedule_plugin.md | 15 +++++++++++++++ .../cli/influxdb3/test/schedule_plugin.md | 15 +++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 content/influxdb3/core/reference/cli/influxdb3/test/schedule_plugin.md create mode 100644 content/influxdb3/enterprise/reference/cli/influxdb3/test/schedule_plugin.md diff --git a/content/influxdb3/core/reference/cli/influxdb3/test/schedule_plugin.md b/content/influxdb3/core/reference/cli/influxdb3/test/schedule_plugin.md new file mode 100644 index 000000000..d866d2854 --- /dev/null +++ b/content/influxdb3/core/reference/cli/influxdb3/test/schedule_plugin.md @@ -0,0 +1,15 @@ +--- +title: influxdb3 test schedule_plugin +description: > + The `influxdb3 test schedule_plugin` command tests a schedule plugin file without needing to create a trigger. +menu: + influxdb3_core: + parent: influxdb3 test + name: influxdb3 test schedule_plugin +weight: 401 +source: /shared/influxdb3-cli/test/schedule_plugin.md +--- + + diff --git a/content/influxdb3/enterprise/reference/cli/influxdb3/test/schedule_plugin.md b/content/influxdb3/enterprise/reference/cli/influxdb3/test/schedule_plugin.md new file mode 100644 index 000000000..8d5682bf6 --- /dev/null +++ b/content/influxdb3/enterprise/reference/cli/influxdb3/test/schedule_plugin.md @@ -0,0 +1,15 @@ +--- +title: influxdb3 test schedule_plugin +description: > + The `influxdb3 test schedule_plugin` command tests a schedule plugin file without needing to create a trigger. +menu: + influxdb3_enterprise: + parent: influxdb3 test + name: influxdb3 test schedule_plugin +weight: 401 +source: /shared/influxdb3-cli/test/schedule_plugin.md +--- + + \ No newline at end of file From fd1c9dcf1e1373727bc85cf3a0f48b38866f6ff4 Mon Sep 17 00:00:00 2001 From: meelahme Date: Thu, 29 May 2025 23:07:46 +0900 Subject: [PATCH 05/14] docs: adding test schedule plugin example --- .../shared/influxdb3-cli/test/schedule_plugin.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/content/shared/influxdb3-cli/test/schedule_plugin.md b/content/shared/influxdb3-cli/test/schedule_plugin.md index 8d27bd9b4..d7736d072 100644 --- a/content/shared/influxdb3-cli/test/schedule_plugin.md +++ b/content/shared/influxdb3-cli/test/schedule_plugin.md @@ -1,6 +1,5 @@ -The `influxdb3 test schedule_plugin` command tests a schedule plugin. -Use this command to verify plugin behavior without creating a trigger. +The `influxdb3 test schedule_plugin` command tests a schedule plugin. Use this command to verify plugin behavior without creating a trigger. ## Usage @@ -11,7 +10,7 @@ influxdb3 test schedule_plugin [OPTIONS] --database ``` ## Arguments -- **FileName**: Path to the local plugin file (usually ends in `.py`) +- **PLUGIN_NAME**: Path to the plugin file on the server. Use the full relative path, such as `/.py`. ## Options @@ -40,9 +39,12 @@ In the examples below, replace the following: - {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: Your target database - {{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}}: Your authentication token -- {{% code-placeholder-key %}}`PLUGIN_FILENAME`{{% /code-placeholder-key %}}: Plugin filename (with path) +- {{% code-placeholder-key %}}`PLUGIN_DIR`{{% /code-placeholder-key %}}: + Plugin directory name +- {{% code-placeholder-key %}}`PLUGIN_NAME`{{% /code-placeholder-key %}}: + Plugin file name -{{% code-placeholders "DATABASE_NAME|AUTH_TOKEN|PLUGIN_FILENAME" %}} +{{% code-placeholders "(DATABASE|PLUGIN)_(NAME|DIR)|AUTH_TOKEN" %}} ### Test a schedule plugin @@ -52,7 +54,7 @@ In the examples below, replace the following: influxdb3 test schedule_plugin \ --database DATABASE_NAME \ --token AUTH_TOKEN \ - PLUGIN_FILENAME.py + PLUGIN_DIR/PLUGIN_NAME.py ``` -{{% /code-placeholders %}} +{{% /code-placeholders %}} From f0fdb709fdaf5e07c5a4ac32d5b55b121680ccd6 Mon Sep 17 00:00:00 2001 From: Jameelah Mercer <36314199+MeelahMe@users.noreply.github.com> Date: Mon, 9 Jun 2025 06:21:02 -0700 Subject: [PATCH 06/14] Update content/shared/influxdb3-cli/test/schedule_plugin.md Co-authored-by: Jason Stirnaman --- content/shared/influxdb3-cli/test/schedule_plugin.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/shared/influxdb3-cli/test/schedule_plugin.md b/content/shared/influxdb3-cli/test/schedule_plugin.md index d7736d072..a0232f16d 100644 --- a/content/shared/influxdb3-cli/test/schedule_plugin.md +++ b/content/shared/influxdb3-cli/test/schedule_plugin.md @@ -8,6 +8,7 @@ The `influxdb3 test schedule_plugin` command tests a schedule plugin. Use this c ```bash influxdb3 test schedule_plugin [OPTIONS] --database ``` + ## Arguments - **PLUGIN_NAME**: Path to the plugin file on the server. Use the full relative path, such as `/.py`. From 029d14eecef6df0fc0d1fd446d49cf750ee30e55 Mon Sep 17 00:00:00 2001 From: Jameelah Mercer <36314199+MeelahMe@users.noreply.github.com> Date: Mon, 9 Jun 2025 06:21:49 -0700 Subject: [PATCH 07/14] Update content/shared/influxdb3-cli/test/schedule_plugin.md Co-authored-by: Jason Stirnaman --- content/shared/influxdb3-cli/test/schedule_plugin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/shared/influxdb3-cli/test/schedule_plugin.md b/content/shared/influxdb3-cli/test/schedule_plugin.md index a0232f16d..db5334ee9 100644 --- a/content/shared/influxdb3-cli/test/schedule_plugin.md +++ b/content/shared/influxdb3-cli/test/schedule_plugin.md @@ -55,7 +55,7 @@ In the examples below, replace the following: influxdb3 test schedule_plugin \ --database DATABASE_NAME \ --token AUTH_TOKEN \ - PLUGIN_DIR/PLUGIN_NAME.py + PLUGIN_DIR/FILENAME.py ``` {{% /code-placeholders %}} From b9272527e2fe3d33b4e23df52afd6a16722119ff Mon Sep 17 00:00:00 2001 From: Jameelah Mercer <36314199+MeelahMe@users.noreply.github.com> Date: Mon, 9 Jun 2025 06:21:55 -0700 Subject: [PATCH 08/14] Update content/shared/influxdb3-cli/test/schedule_plugin.md Co-authored-by: Jason Stirnaman --- content/shared/influxdb3-cli/test/schedule_plugin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/shared/influxdb3-cli/test/schedule_plugin.md b/content/shared/influxdb3-cli/test/schedule_plugin.md index db5334ee9..f5e558cb2 100644 --- a/content/shared/influxdb3-cli/test/schedule_plugin.md +++ b/content/shared/influxdb3-cli/test/schedule_plugin.md @@ -11,7 +11,7 @@ influxdb3 test schedule_plugin [OPTIONS] --database ## Arguments -- **PLUGIN_NAME**: Path to the plugin file on the server. Use the full relative path, such as `/.py`. +- **FILENAME**: the path to the plugin file. Use the full absolute path or the path relative to the current working directory, such as `/.py`. ## Options From 16bb041898b0b873a397a3376e7068706044eac5 Mon Sep 17 00:00:00 2001 From: Jameelah Mercer <36314199+MeelahMe@users.noreply.github.com> Date: Mon, 9 Jun 2025 06:22:02 -0700 Subject: [PATCH 09/14] Update content/shared/influxdb3-cli/test/schedule_plugin.md Co-authored-by: Jason Stirnaman --- content/shared/influxdb3-cli/test/schedule_plugin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/shared/influxdb3-cli/test/schedule_plugin.md b/content/shared/influxdb3-cli/test/schedule_plugin.md index f5e558cb2..353b456e9 100644 --- a/content/shared/influxdb3-cli/test/schedule_plugin.md +++ b/content/shared/influxdb3-cli/test/schedule_plugin.md @@ -45,7 +45,7 @@ In the examples below, replace the following: - {{% code-placeholder-key %}}`PLUGIN_NAME`{{% /code-placeholder-key %}}: Plugin file name -{{% code-placeholders "(DATABASE|PLUGIN)_(NAME|DIR)|AUTH_TOKEN" %}} +{{% code-placeholders "(DATABASE|PLUGIN_DIR|FILENAME|AUTH_TOKEN" %}} ### Test a schedule plugin From e1ce7ddfcf6ecee5ae024a1e95a49559571f9494 Mon Sep 17 00:00:00 2001 From: Jameelah Mercer <36314199+MeelahMe@users.noreply.github.com> Date: Mon, 9 Jun 2025 06:22:10 -0700 Subject: [PATCH 10/14] Update content/shared/influxdb3-cli/test/schedule_plugin.md Co-authored-by: Jason Stirnaman --- content/shared/influxdb3-cli/test/schedule_plugin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/shared/influxdb3-cli/test/schedule_plugin.md b/content/shared/influxdb3-cli/test/schedule_plugin.md index 353b456e9..bdb1baada 100644 --- a/content/shared/influxdb3-cli/test/schedule_plugin.md +++ b/content/shared/influxdb3-cli/test/schedule_plugin.md @@ -42,7 +42,7 @@ In the examples below, replace the following: - {{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}}: Your authentication token - {{% code-placeholder-key %}}`PLUGIN_DIR`{{% /code-placeholder-key %}}: Plugin directory name -- {{% code-placeholder-key %}}`PLUGIN_NAME`{{% /code-placeholder-key %}}: +- {{% code-placeholder-key %}}`FILENAME`{{% /code-placeholder-key %}}: Plugin file name {{% code-placeholders "(DATABASE|PLUGIN_DIR|FILENAME|AUTH_TOKEN" %}} From 26303fd1ec297d033712dc2287c363a6b1ff8e80 Mon Sep 17 00:00:00 2001 From: Jameelah Mercer <36314199+MeelahMe@users.noreply.github.com> Date: Mon, 9 Jun 2025 06:22:18 -0700 Subject: [PATCH 11/14] Update content/shared/influxdb3-cli/test/schedule_plugin.md Co-authored-by: Jason Stirnaman --- content/shared/influxdb3-cli/test/schedule_plugin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/shared/influxdb3-cli/test/schedule_plugin.md b/content/shared/influxdb3-cli/test/schedule_plugin.md index bdb1baada..93a8ffe39 100644 --- a/content/shared/influxdb3-cli/test/schedule_plugin.md +++ b/content/shared/influxdb3-cli/test/schedule_plugin.md @@ -41,7 +41,7 @@ In the examples below, replace the following: - {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: Your target database - {{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}}: Your authentication token - {{% code-placeholder-key %}}`PLUGIN_DIR`{{% /code-placeholder-key %}}: - Plugin directory name + the path to the plugin directory you provided when starting the server - {{% code-placeholder-key %}}`FILENAME`{{% /code-placeholder-key %}}: Plugin file name From 8f1359420f8a9180f370e3f079c79263b269ac95 Mon Sep 17 00:00:00 2001 From: meelahme Date: Mon, 9 Jun 2025 08:40:59 -0700 Subject: [PATCH 12/14] docs: update schedule_plugin command options and environment variables --- .../influxdb3-cli/test/schedule_plugin.md | 38 ++++++++++++++----- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/content/shared/influxdb3-cli/test/schedule_plugin.md b/content/shared/influxdb3-cli/test/schedule_plugin.md index 93a8ffe39..716816dea 100644 --- a/content/shared/influxdb3-cli/test/schedule_plugin.md +++ b/content/shared/influxdb3-cli/test/schedule_plugin.md @@ -11,18 +11,22 @@ influxdb3 test schedule_plugin [OPTIONS] --database ## Arguments -- **FILENAME**: the path to the plugin file. Use the full absolute path or the path relative to the current working directory, such as `/.py`. +- **FILENAME**: Path to the plugin file. Use the absolute path or the path relative to the current working directory, such as `/.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
(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
(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 + + + +```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 %}} From 2d380eabf9fa22c0baed43bff8f6b25cf07136cd Mon Sep 17 00:00:00 2001 From: meelahme Date: Mon, 9 Jun 2025 12:00:23 -0700 Subject: [PATCH 13/14] docs: schedule_plugin test command docs with input args, cron syntax, and troubleshooting --- content/shared/influxdb3-cli/test/schedule_plugin.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/content/shared/influxdb3-cli/test/schedule_plugin.md b/content/shared/influxdb3-cli/test/schedule_plugin.md index 716816dea..0266aa9c4 100644 --- a/content/shared/influxdb3-cli/test/schedule_plugin.md +++ b/content/shared/influxdb3-cli/test/schedule_plugin.md @@ -65,15 +65,20 @@ influxdb3 test schedule_plugin \ ### Test with input arguments and a custom cron schedule +You can pass input arguments to your plugin as key-value pairs and specify a custom cron schedule (using Quartz cron syntax with six fields): + ```bash influxdb3 test schedule_plugin \ + --host http://localhost:8182 \ --database DATABASE_NAME \ --token AUTH_TOKEN \ - --input-arguments '{"threshold": "10", "unit": "seconds"}' \ - --schedule "0 * * * *" \ + --input-arguments threshold=10,unit=seconds \ + --schedule "0 0 * * * ?" \ PLUGIN_DIR/FILENAME.py ``` +- `--input-arguments` accepts comma-separated key=value pairs. +- `--schedule` expects a Quartz cron expression; e.g., "0 0 * * * ?" runs at the top of every hour. {{% /code-placeholders %}} From 8050d4ba58f2190adc2fde8c564106d1ffeb4832 Mon Sep 17 00:00:00 2001 From: meelahme Date: Mon, 9 Jun 2025 12:10:30 -0700 Subject: [PATCH 14/14] minor updates --- content/shared/influxdb3-cli/test/schedule_plugin.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/shared/influxdb3-cli/test/schedule_plugin.md b/content/shared/influxdb3-cli/test/schedule_plugin.md index 0266aa9c4..10aee669a 100644 --- a/content/shared/influxdb3-cli/test/schedule_plugin.md +++ b/content/shared/influxdb3-cli/test/schedule_plugin.md @@ -78,7 +78,7 @@ influxdb3 test schedule_plugin \ --schedule "0 0 * * * ?" \ PLUGIN_DIR/FILENAME.py ``` -- `--input-arguments` accepts comma-separated key=value pairs. -- `--schedule` expects a Quartz cron expression; e.g., "0 0 * * * ?" runs at the top of every hour. +- Pass plugin parameters using `--input-arguments` as comma-separated key=value pairs. +- Use `--schedule` to set the plugin’s execution time with a Quartz cron expression. For example, "0 0 * * * ?" runs the plugin at the start of every hour. {{% /code-placeholders %}}