@@ -146,15 +146,15 @@ tags:
146
146
description : |
147
147
Manage Processing engine triggers, test plugins, and send requests to trigger On Request plugins.
148
148
149
- InfluxDB 3 Core provides the InfluxDB 3 Processing engine, an embedded Python VM that can dynamically load and trigger Python plugins in response to events in your database.
149
+ InfluxDB 3 Core provides the InfluxDB 3 processing engine, an embedded Python VM that can dynamically load and trigger Python plugins in response to events in your database.
150
150
Use Processing engine plugins and triggers to run code and perform tasks for different database events.
151
151
152
- To get started with the Processing engine, see the [Processing engine and Python plugins](/influxdb3/core/processing-engine/) guide.
152
+ To get started with the processing engine, see the [Processing engine and Python plugins](/influxdb3/core/processing-engine/) guide.
153
153
- name : Query data
154
154
description : Query data using SQL or InfluxQL
155
155
- name : Quick start
156
156
description : |
157
- 1. [Create an admin token](#section/Authentication) for the InfluxDB 3 Core API.
157
+ 1. [Create an admin token](#section/Authentication) to authorize API requests .
158
158
159
159
```bash
160
160
curl -X POST "http://localhost:8181/api/v3/configure/token/admin"
@@ -385,12 +385,7 @@ paths:
385
385
parameters :
386
386
- $ref : ' #/components/parameters/dbWriteParam'
387
387
- $ref : ' #/components/parameters/accept_partial'
388
- - name : precision
389
- in : query
390
- required : true
391
- schema :
392
- $ref : ' #/components/schemas/PrecisionWrite'
393
- description : Precision of timestamps.
388
+ - $ref : ' #/components/parameters/precisionParam'
394
389
- name : no_sync
395
390
in : query
396
391
schema :
@@ -440,16 +435,8 @@ paths:
440
435
description : Executes an SQL query to retrieve data from the specified database.
441
436
parameters :
442
437
- $ref : ' #/components/parameters/db'
443
- - name : q
444
- in : query
445
- required : true
446
- schema :
447
- type : string
448
- - name : format
449
- in : query
450
- required : false
451
- schema :
452
- type : string
438
+ - $ref : ' #/components/parameters/querySqlParam'
439
+ - $ref : ' #/components/parameters/format'
453
440
- $ref : ' #/components/parameters/AcceptQueryHeader'
454
441
- $ref : ' #/components/parameters/ContentType'
455
442
responses :
@@ -1072,15 +1059,104 @@ paths:
1072
1059
post :
1073
1060
operationId : PostConfigureProcessingEngineTrigger
1074
1061
summary : Create processing engine trigger
1075
- description : Creates a new processing engine trigger.
1062
+ description : |
1063
+ Creates a processing engine trigger with the specified plugin file and trigger specification.
1064
+
1065
+ ### Related guides
1066
+
1067
+ - [Processing engine and Python plugins](/influxdb3/core/plugins/)
1076
1068
requestBody :
1077
1069
required : true
1078
1070
content :
1079
1071
application/json :
1080
1072
schema :
1081
1073
$ref : ' #/components/schemas/ProcessingEngineTriggerRequest'
1074
+ examples :
1075
+ schedule_cron :
1076
+ summary : Schedule trigger using cron
1077
+ description : |
1078
+ In `"cron:CRON_EXPRESSION"`, `CRON_EXPRESSION` uses extended 6-field cron format.
1079
+ The cron expression `0 0 6 * * 1-5` means the trigger will run at 6:00 AM every weekday (Monday to Friday).
1080
+ value :
1081
+ db : DATABASE_NAME
1082
+ plugin_filename : schedule.py
1083
+ trigger_name : schedule_cron_trigger
1084
+ trigger_specification : cron:0 0 6 * * 1-5
1085
+ schedule_every :
1086
+ summary : Schedule trigger using interval
1087
+ description : |
1088
+ In `"every:DURATION"`, `DURATION` specifies the interval between trigger executions.
1089
+ The duration `1h` means the trigger will run every hour.
1090
+ value :
1091
+ db : mydb
1092
+ plugin_filename : schedule.py
1093
+ trigger_name : schedule_every_trigger
1094
+ trigger_specification : every:1h
1095
+ schedule_every_seconds :
1096
+ summary : Schedule trigger using seconds interval
1097
+ description : |
1098
+ Example of scheduling a trigger to run every 30 seconds.
1099
+ value :
1100
+ db : mydb
1101
+ plugin_filename : schedule.py
1102
+ trigger_name : schedule_every_30s_trigger
1103
+ trigger_specification : every:30s
1104
+ schedule_every_minutes :
1105
+ summary : Schedule trigger using minutes interval
1106
+ description : |
1107
+ Example of scheduling a trigger to run every 5 minutes.
1108
+ value :
1109
+ db : mydb
1110
+ plugin_filename : schedule.py
1111
+ trigger_name : schedule_every_5m_trigger
1112
+ trigger_specification : every:5m
1113
+ all_tables :
1114
+ summary : All tables trigger example
1115
+ description : |
1116
+ Trigger that fires on write events to any table in the database.
1117
+ value :
1118
+ db : mydb
1119
+ plugin_filename : all_tables.py
1120
+ trigger_name : all_tables_trigger
1121
+ trigger_specification : all_tables
1122
+ table_specific :
1123
+ summary : Table-specific trigger example
1124
+ description : |
1125
+ Trigger that fires on write events to a specific table.
1126
+ value :
1127
+ db : mydb
1128
+ plugin_filename : table.py
1129
+ trigger_name : table_trigger
1130
+ trigger_specification : table:sensors
1131
+ api_request :
1132
+ summary : On-demand request trigger example
1133
+ description : |
1134
+ Creates an HTTP endpoint `/api/v3/engine/hello-world` for manual invocation.
1135
+ value :
1136
+ db : mydb
1137
+ plugin_filename : request.py
1138
+ trigger_name : hello_world_trigger
1139
+ trigger_specification : path:hello-world
1140
+ cron_friday_afternoon :
1141
+ summary : Cron trigger for Friday afternoons
1142
+ description : |
1143
+ Example of a cron trigger that runs every Friday at 2:30 PM.
1144
+ value :
1145
+ db : reports
1146
+ plugin_filename : weekly_report.py
1147
+ trigger_name : friday_report_trigger
1148
+ trigger_specification : cron:0 30 14 * * 5
1149
+ cron_monthly :
1150
+ summary : Cron trigger for monthly execution
1151
+ description : |
1152
+ Example of a cron trigger that runs on the first day of every month at midnight.
1153
+ value :
1154
+ db : monthly_data
1155
+ plugin_filename : monthly_cleanup.py
1156
+ trigger_name : monthly_cleanup_trigger
1157
+ trigger_specification : cron:0 0 0 1 * *
1082
1158
responses :
1083
- ' 201 ' :
1159
+ ' 200 ' :
1084
1160
description : Success. Processing engine trigger created.
1085
1161
' 400 ' :
1086
1162
description : Bad request.
@@ -1157,7 +1233,7 @@ paths:
1157
1233
$ref : ' #/components/schemas/ProcessingEngineTriggerRequest'
1158
1234
responses :
1159
1235
' 200 ' :
1160
- description : Success. The processing engine trigger has been enabled.
1236
+ description : Success. The processing engine trigger is enabled.
1161
1237
' 400 ' :
1162
1238
description : Bad request.
1163
1239
' 401 ' :
@@ -1170,7 +1246,14 @@ paths:
1170
1246
post :
1171
1247
operationId : PostInstallPluginPackages
1172
1248
summary : Install plugin packages
1173
- description : Installs packages for the plugin environment.
1249
+ description : |
1250
+ Installs the specified Python packages into the processing engine plugin environment.
1251
+
1252
+ This endpoint is synchronous and blocks until the packages are installed.
1253
+
1254
+ ### Related guides
1255
+
1256
+ - [Processing engine and Python plugins](/influxdb3/core/plugins/)
1174
1257
parameters :
1175
1258
- $ref : ' #/components/parameters/ContentType'
1176
1259
requestBody :
@@ -1179,10 +1262,30 @@ paths:
1179
1262
application/json :
1180
1263
schema :
1181
1264
type : object
1182
- additionalProperties : true
1265
+ properties :
1266
+ packages :
1267
+ type : array
1268
+ items :
1269
+ type : string
1270
+ description : |
1271
+ A list of Python package names to install.
1272
+ Can include version specifiers (e.g., "scipy==1.9.0").
1273
+ example :
1274
+ - influxdb3-python
1275
+ - scipy
1276
+ - pandas==1.5.0
1277
+ - requests
1278
+ required :
1279
+ - packages
1280
+ example :
1281
+ packages :
1282
+ - influxdb3-python
1283
+ - scipy
1284
+ - pandas==1.5.0
1285
+ - requests
1183
1286
responses :
1184
1287
' 200 ' :
1185
- description : Success. The packages have been installed.
1288
+ description : Success. The packages are installed.
1186
1289
' 400 ' :
1187
1290
description : Bad request.
1188
1291
' 401 ' :
@@ -1193,7 +1296,15 @@ paths:
1193
1296
post :
1194
1297
operationId : PostInstallPluginRequirements
1195
1298
summary : Install plugin requirements
1196
- description : Installs requirements for the plugin environment.
1299
+ description : |
1300
+ Installs requirements from a requirements file (also known as a "pip requirements file") into the processing engine plugin environment.
1301
+
1302
+ This endpoint is synchronous and blocks until the requirements are installed.
1303
+
1304
+ ### Related
1305
+
1306
+ - [Processing engine and Python plugins](/influxdb3/core/plugins/)
1307
+ - [Python requirements file format](https://pip.pypa.io/en/stable/reference/requirements-file-format/)
1197
1308
parameters :
1198
1309
- $ref : ' #/components/parameters/ContentType'
1199
1310
requestBody :
@@ -1202,7 +1313,17 @@ paths:
1202
1313
application/json :
1203
1314
schema :
1204
1315
type : object
1205
- additionalProperties : true
1316
+ properties :
1317
+ requirements_location :
1318
+ type : string
1319
+ description : |
1320
+ The path to the requirements file containing Python packages to install.
1321
+ Can be a relative path (relative to the plugin directory) or an absolute path.
1322
+ example : requirements.txt
1323
+ required :
1324
+ - requirements_location
1325
+ example :
1326
+ requirements_location : requirements.txt
1206
1327
responses :
1207
1328
' 200 ' :
1208
1329
description : Success. The requirements have been installed.
@@ -1248,18 +1369,18 @@ paths:
1248
1369
parameters :
1249
1370
- name : plugin_path
1250
1371
description : |
1251
- The path configured in the ` trigger-spec ` for the plugin.
1372
+ The path configured in the request trigger specification "path:<plugin_path>" ` for the plugin.
1252
1373
1253
1374
For example, if you define a trigger with the following:
1254
1375
1255
- ```
1256
- trigger-spec: "request :hello-world"
1376
+ ```json
1377
+ trigger-spec: "path :hello-world"
1257
1378
```
1258
1379
1259
1380
then, the HTTP API exposes the following plugin endpoint:
1260
1381
1261
1382
```
1262
- <INFLUXDB_HOST >/api/v3/engine/hello-world
1383
+ <INFLUXDB3_HOST >/api/v3/engine/hello-world
1263
1384
```
1264
1385
in : path
1265
1386
required : true
@@ -1269,7 +1390,7 @@ paths:
1269
1390
operationId : GetProcessingEnginePluginRequest
1270
1391
summary : On Request processing engine plugin request
1271
1392
description : |
1272
- Sends a request to invoke an _On Request_ processing engine plugin.
1393
+ Executes the On Request processing engine plugin specified in `<plugin_path>` .
1273
1394
The request can include request headers, query string parameters, and a request body, which InfluxDB passes to the plugin.
1274
1395
1275
1396
An On Request plugin implements the following signature:
@@ -1296,7 +1417,7 @@ paths:
1296
1417
operationId : PostProcessingEnginePluginRequest
1297
1418
summary : On Request processing engine plugin request
1298
1419
description : |
1299
- Sends a request to invoke an _On Request_ processing engine plugin.
1420
+ Executes the On Request processing engine plugin specified in `<plugin_path>` .
1300
1421
The request can include request headers, query string parameters, and a request body, which InfluxDB passes to the plugin.
1301
1422
1302
1423
An On Request plugin implements the following signature:
@@ -1335,8 +1456,6 @@ paths:
1335
1456
description : |
1336
1457
Creates an admin token.
1337
1458
An admin token is a special type of token that has full access to all resources in the system.
1338
-
1339
- This endpoint is only available in InfluxDB 3 Enterprise.
1340
1459
responses :
1341
1460
' 201 ' :
1342
1461
description : |
@@ -1357,8 +1476,6 @@ paths:
1357
1476
summary : Regenerate admin token
1358
1477
description : |
1359
1478
Regenerates an admin token and revokes the previous token with the same name.
1360
-
1361
- This endpoint is only available in InfluxDB 3 Enterprise.
1362
1479
parameters : []
1363
1480
responses :
1364
1481
' 201 ' :
@@ -1429,7 +1546,6 @@ components:
1429
1546
schema :
1430
1547
type : string
1431
1548
description : |
1432
- The name of the database.
1433
1549
The name of the database.
1434
1550
InfluxDB creates the database if it doesn't already exist, and then
1435
1551
writes all points in the batch to the database.
@@ -1747,15 +1863,69 @@ components:
1747
1863
type : string
1748
1864
plugin_filename :
1749
1865
type : string
1866
+ description : |
1867
+ The path and filename of the plugin to execute--for example,
1868
+ `schedule.py` or `endpoints/report.py`.
1869
+ The path can be absolute or relative to the `--plugins-dir` directory configured when starting InfluxDB 3.
1870
+
1871
+ The plugin file must implement the trigger interface associated with the trigger's specification (`trigger_spec`).
1750
1872
trigger_name :
1751
1873
type : string
1752
1874
trigger_specification :
1753
1875
type : string
1876
+ description : |
1877
+ Specifies when and how the processing engine trigger should be invoked.
1878
+
1879
+ ## Supported trigger specifications:
1880
+
1881
+ ### Cron-based scheduling
1882
+ Format: `cron:CRON_EXPRESSION`
1883
+
1884
+ Uses extended (6-field) cron format (second minute hour day_of_month month day_of_week):
1885
+ ```
1886
+ ┌───────────── second (0-59)
1887
+ │ ┌───────────── minute (0-59)
1888
+ │ │ ┌───────────── hour (0-23)
1889
+ │ │ │ ┌───────────── day of month (1-31)
1890
+ │ │ │ │ ┌───────────── month (1-12)
1891
+ │ │ │ │ │ ┌───────────── day of week (0-6, Sunday=0)
1892
+ │ │ │ │ │ │
1893
+ * * * * * *
1894
+ ```
1895
+ Examples:
1896
+ - `cron:0 0 6 * * 1-5` - Every weekday at 6:00 AM
1897
+ - `cron:0 30 14 * * 5` - Every Friday at 2:30 PM
1898
+ - `cron:0 0 0 1 * *` - First day of every month at midnight
1899
+
1900
+ ### Interval-based scheduling
1901
+ Format: `every:DURATION`
1902
+
1903
+ Supported durations: `s` (seconds), `m` (minutes), `h` (hours), `d` (days):
1904
+ - `every:30s` - Every 30 seconds
1905
+ - `every:5m` - Every 5 minutes
1906
+ - `every:1h` - Every hour
1907
+ - `every:1d` - Every day
1908
+
1909
+ ### Table-based triggers
1910
+ - `all_tables` - Triggers on write events to any table in the database
1911
+ - `table:TABLE_NAME` - Triggers on write events to a specific table
1912
+
1913
+ ### On-demand triggers
1914
+ Format: `path:ENDPOINT_NAME`
1915
+
1916
+ Creates an HTTP endpoint `/api/v3/engine/ENDPOINT_NAME` for manual invocation:
1917
+ - `path:hello-world` - Creates endpoint `/api/v3/engine/hello-world`
1918
+ - `path:data-export` - Creates endpoint `/api/v3/engine/data-export`
1919
+ pattern : ^(cron:[0-9 *,/-]+|every:[0-9]+[smhd]|all_tables|table:[a-zA-Z_][a-zA-Z0-9_]*|path:[a-zA-Z0-9_-]+)$
1920
+ example : cron:0 0 6 * * 1-5
1754
1921
trigger_arguments :
1755
1922
type : object
1756
1923
additionalProperties : true
1924
+ description : Optional arguments passed to the plugin.
1757
1925
disabled :
1758
1926
type : boolean
1927
+ default : false
1928
+ description : Whether the trigger is disabled.
1759
1929
required :
1760
1930
- db
1761
1931
- plugin_filename
@@ -1879,8 +2049,6 @@ components:
1879
2049
scheme : bearer
1880
2050
bearerFormat : JWT
1881
2051
description : |
1882
- _During Alpha release, an API token is not required._
1883
-
1884
2052
A Bearer token for authentication.
1885
2053
1886
2054
Provide the scheme and the API token in the `Authorization` header--for example:
0 commit comments