Skip to content

Commit c142f64

Browse files
authored
Merge branch 'master' into docs/generalize-grafana-multinode
2 parents bc7289a + 5a6b473 commit c142f64

File tree

3 files changed

+114
-0
lines changed

3 files changed

+114
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: influxdb3 test schedule_plugin
3+
description: >
4+
The `influxdb3 test schedule_plugin` command tests a schedule plugin file without needing to create a trigger.
5+
menu:
6+
influxdb3_core:
7+
parent: influxdb3 test
8+
name: influxdb3 test schedule_plugin
9+
weight: 401
10+
source: /shared/influxdb3-cli/test/schedule_plugin.md
11+
---
12+
13+
<!--
14+
The content of this file is at content/shared/influxdb3-cli/test/schedule_plugin.md
15+
-->
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: influxdb3 test schedule_plugin
3+
description: >
4+
The `influxdb3 test schedule_plugin` command tests a schedule plugin file without needing to create a trigger.
5+
menu:
6+
influxdb3_enterprise:
7+
parent: influxdb3 test
8+
name: influxdb3 test schedule_plugin
9+
weight: 401
10+
source: /shared/influxdb3-cli/test/schedule_plugin.md
11+
---
12+
13+
<!--
14+
The content of this file is at content/shared/influxdb3-cli/test/schedule_plugin.md
15+
-->
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
2+
The `influxdb3 test schedule_plugin` command tests a schedule plugin. Use this command to verify plugin behavior without creating a trigger.
3+
4+
## Usage
5+
6+
<!--pytest.mark.skip-->
7+
8+
```bash
9+
influxdb3 test schedule_plugin [OPTIONS] --database <DATABASE_NAME> <FILENAME>
10+
```
11+
12+
## Arguments
13+
14+
- **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`.
15+
16+
## Options
17+
18+
| Option | Flag | Description |
19+
| :----- | :-------------------- | :-------------------------------------------------------------------------------------------- |
20+
| `-H` | `--host` | URL of the running {{< product-name >}} server <br>(default: `http://127.0.0.1:8181`) |
21+
| `-d` | `--database` | _({{< req >}})_ Name of the database you want to test the plugin against |
22+
| | `--token` | _({{< req >}})_ Authentication token |
23+
| | `--input-arguments` | JSON map of key/value pairs to pass as plugin input arguments (for example, `'{"key":"val"}'`)|
24+
| | `--schedule` | Cron schedule to simulate when testing the plugin <br>(default: `* * * * *`) |
25+
| | `--cache-name` | Optional cache name to associate with the test |
26+
| | `--tls-ca` | Path to a custom TLS certificate authority for self-signed certs |
27+
| `-h` | `--help` | Show basic help information |
28+
| | `--help-all` | Show all available help options |
29+
30+
31+
### Option environment variables
32+
33+
You can use the following environment variables to set command options:
34+
35+
| Environment Variable | Corresponding Option |
36+
| :------------------------ | :------------------- |
37+
| `INFLUXDB3_HOST_URL` | `--host` |
38+
| `INFLUXDB3_DATABASE_NAME` | `--database` |
39+
| `INFLUXDB3_AUTH_TOKEN` | `--token` |
40+
| `INFLUXDB3_TLS_CA` | `--tls-ca` |
41+
42+
## Examples
43+
44+
In the examples below, replace the following:
45+
46+
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: Your target database
47+
- {{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}}: Your authentication token
48+
- {{% code-placeholder-key %}}`PLUGIN_DIR`{{% /code-placeholder-key %}}:
49+
the path to the plugin directory you provided when starting the server
50+
- {{% code-placeholder-key %}}`FILENAME`{{% /code-placeholder-key %}}:
51+
Plugin file name
52+
53+
{{% code-placeholders "(DATABASE|PLUGIN_DIR|FILENAME|AUTH_TOKEN)" %}}
54+
55+
### Test a schedule plugin
56+
57+
<!--pytest.mark.skip-->
58+
59+
```bash
60+
influxdb3 test schedule_plugin \
61+
--database DATABASE_NAME \
62+
--token AUTH_TOKEN \
63+
PLUGIN_DIR/FILENAME.py
64+
```
65+
66+
### Test with input arguments and a custom cron schedule
67+
68+
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):
69+
70+
<!--pytest.mark.skip-->
71+
72+
```bash
73+
influxdb3 test schedule_plugin \
74+
--host http://localhost:8182 \
75+
--database DATABASE_NAME \
76+
--token AUTH_TOKEN \
77+
--input-arguments threshold=10,unit=seconds \
78+
--schedule "0 0 * * * ?" \
79+
PLUGIN_DIR/FILENAME.py
80+
```
81+
- Pass plugin parameters using `--input-arguments` as comma-separated key=value pairs.
82+
- 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.
83+
84+
{{% /code-placeholders %}}

0 commit comments

Comments
 (0)