You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix `create token --admin` name in frontmatter
Improve schedule trigger docs with more detail:
1. Core API documentation
(/api-docs/influxdb3/core/v3/ref.yml):
- Added missing duration units (weeks, months, years)
- Added "Maximum interval: 1 year"
2. Enterprise API documentation
(/api-docs/influxdb3/enterprise/v3/ref.yml):
- Added missing duration units (weeks, months, years)
- Added "Maximum interval: 1 year"
3. CLI reference documentation
(/content/shared/influxdb3-cli/create/trigger.md):
- Added complete list of supported duration units
- Added "Maximum interval is 1 year" note
All documentation now consistently reflects:
- The complete set of supported duration units for
every triggers
- The 1-year maximum limit for interval-based
scheduling
- Clear examples showing the syntax
||`--plugin-filename`|_({{< req >}})_ Name of the file, stored in the server's `plugin-dir`, that contains the Python plugin code to run |
30
30
||`--trigger-spec`| Trigger specification: `table:<TABLE_NAME>`, `all_tables`, `every:<DURATION>`, `cron:<EXPRESSION>`, or `request:<REQUEST_PATH>`|
31
+
||`--trigger-arguments`| Additional arguments for the trigger, in the format `key=value`, separated by commas (for example, `arg1=val1,arg2=val2`) |
31
32
||`--disabled`| Create the trigger in disabled state |
33
+
||`--error-behavior`| Error handling behavior: `log`, `retry`, or `disable`|
34
+
||`--run-asynchronous`| Run the trigger asynchronously, allowing multiple triggers to run simultaneously (default is synchronous) |
32
35
||`--tls-ca`| Path to a custom TLS certificate authority (for testing or self-signed certificates) |
33
36
|`-h`|`--help`| Print help information |
34
37
||`--help-all`| Print detailed help information |
35
38
36
-
If you want to use a plugin from the [Plugin Library](https://github.com/influxdata/influxdb3_plugins) repo, use the url path with `gh:` specified as the prefix.
39
+
If you want to use a plugin from the [Plugin Library](https://github.com/influxdata/influxdb3_plugins) repo, use the URL path with `gh:` specified as the prefix.
37
40
For example, to use the [System Metrics](https://github.com/influxdata/influxdb3_plugins/blob/main/examples/schedule/system_metrics/system_metrics.py) plugin, the plugin filename is `gh:examples/schedule/system_metrics/system_metrics.py`.
38
41
39
42
@@ -51,6 +54,17 @@ You can use the following environment variables to set command options:
51
54
52
55
The following examples show how to use the `influxdb3 create trigger` command to create triggers in different scenarios.
53
56
57
+
-[Create a trigger for a specific table](#create-a-trigger-for-a-specific-table)
58
+
-[Create a trigger for all tables](#create-a-trigger-for-all-tables)
59
+
-[Create a trigger with a schedule](#create-a-trigger-with-a-schedule)
60
+
-[Create a trigger for HTTP requests](#create-a-trigger-for-http-requests)
61
+
-[Create a trigger with additional arguments](#create-a-trigger-with-additional-arguments)
62
+
-[Create a disabled trigger](#create-a-disabled-trigger)
63
+
-[Create a trigger with error handling](#create-a-trigger-with-error-handling)
64
+
65
+
---
66
+
67
+
Replace the following placeholders with your values:
54
68
55
69
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: Database name
`PLUGIN_FILENAME` must implement the [data write plugin](/influxdb3/version/plugins/#create-a-data-write-plugin) interface.
95
+
80
96
### Create a trigger for all tables
81
97
82
98
Create a trigger that applies to all tables in the specified database.
@@ -92,8 +108,77 @@ influxdb3 create trigger \
92
108
TRIGGER_NAME
93
109
```
94
110
111
+
`PLUGIN_FILENAME` must implement the [data write plugin](/influxdb3/version/plugins/#create-a-data-write-plugin) interface.
112
+
95
113
This is useful when you want a trigger to apply to any table in the database, regardless of name.
96
114
115
+
### Create a trigger with a schedule
116
+
117
+
Create a trigger that runs at a specific interval using a duration. Supported duration units: `s` (seconds), `m` (minutes), `h` (hours), `d` (days), `w` (weeks), `M` (months), `y` (years). Maximum interval is 1 year.
118
+
119
+
```bash
120
+
influxdb3 create trigger \
121
+
--database DATABASE_NAME \
122
+
--token AUTH_TOKEN \
123
+
--plugin-filename <PLUGIN_FILENAME> \
124
+
--trigger-spec every:5m \
125
+
TRIGGER_NAME
126
+
```
127
+
128
+
Create a trigger that runs based on a cron schedule using extended 6-field cron format. The cron expression follows the format:
129
+
130
+
```console
131
+
second minute hour day_of_month month day_of_week
132
+
```
133
+
134
+
Fields:
135
+
-**second**: 0-59
136
+
-**minute**: 0-59
137
+
-**hour**: 0-23
138
+
-**day_of_month**: 1-31
139
+
-**month**: 1-12 or JAN-DEC
140
+
-**day_of_week**: 0-7 (0 or 7 is Sunday) or SUN-SAT
141
+
142
+
Example: Run at 6:00 AM every weekday (Monday-Friday):
143
+
144
+
```bash
145
+
influxdb3 create trigger \
146
+
--database DATABASE_NAME \
147
+
--token AUTH_TOKEN \
148
+
--plugin-filename <PLUGIN_FILENAME> \
149
+
--trigger-spec "cron:0 0 6 * * 1-5" \
150
+
TRIGGER_NAME
151
+
```
152
+
153
+
`PLUGIN_FILENAME` must implement the [scheduled plugin](/influxdb3/version/plugins/#create-a-scheduled-plugin) interface.
154
+
155
+
### Create a trigger for HTTP requests
156
+
157
+
Create a trigger that provides an API endpoint and processes HTTP requests.
158
+
159
+
```bash
160
+
influxdb3 create trigger \
161
+
--database DATABASE_NAME \
162
+
--token AUTH_TOKEN \
163
+
--plugin-filename PLUGIN_FILENAME \
164
+
--trigger-spec request:REQUEST_PATH \
165
+
TRIGGER_NAME
166
+
```
167
+
168
+
`PLUGIN_FILENAME` must implement the [HTTP request plugin](/influxdb3/version/plugins/#create-an-http-request-plugin) interface.
169
+
170
+
### Create a trigger with additional arguments
171
+
172
+
```bash
173
+
influxdb3 create trigger \
174
+
--database DATABASE_NAME \
175
+
--token AUTH_TOKEN \
176
+
--plugin-filename <PLUGIN_FILENAME> \
177
+
--trigger-spec table:TABLE_NAME \
178
+
--trigger-arguments arg1=value1,arg2=value2 \
179
+
TRIGGER_NAME
180
+
```
181
+
97
182
### Create a disabled trigger
98
183
99
184
Create a trigger in a disabled state.
@@ -112,4 +197,42 @@ influxdb3 create trigger \
112
197
113
198
Creating a trigger in a disabled state prevents it from running immediately. You can enable it later when you're ready to activate it.
114
199
200
+
### Create a trigger with error handling
201
+
202
+
Log the error to the service output and the `system.processing_engine_logs` table:
0 commit comments