BioT Non-Specific Plugins
BioT Non-Specific plugin is not subscribed to any events, and it can be called from its public address.
This plugin can also be invoked using the "CronScheduler" feature and run on a specific time frame, or can be invoked directly from your code.
When uploading a non-specific plugin as a stand alone, subscriptions dictionary needs to be empty, however it is possible to upload an interceptor plugin and a non-specific plugin combined (or any other combination), which means, that it the interceptor can be triggered by an event or API call and the non-specific can be triggered by directly accessing the public address.
Example of a Non-Specific plugin configuration file:
{
"name": "Non-Specific",
"displayName": "Non Specific",
"version": 1,
"runtime": "python3.12",
"handler": "index.handler",
"timeout": 3,
"memorySize": 128,
"environmentVariables": {
},
"subscriptions": {
},
"enabledState": "ENABLED"
}
Using Cron Scheduler
Since this plugin is not invoked automatically before or after any event or API calls, it is possible to schedule and automate the execution using a corn expression.
The cron expressions consist of a six field cron expression separated with white-spaces for fields: minutes,hours,day-of-month,month,day-of-week,year.
More information
More information on cron expressions can be found in this article
Each field can accept the following values:
Cron field | Value | Additional Value | Wildcards |
---|---|---|---|
Minutes | 0–59 | , - * / | |
Hours | 0-23 | , - * / | |
Day Of The Month | 1-31 | , - * ? / L W | |
Month | 1-12 | "Jan"/"Feb", etc. | , - * / |
Day Of The Week | 0-6 (0 is Sunday) | "Sun", "Mon", etc. | , - * ? L # |
Year | 4 digit year number (e.g, 2024) | , - * / |
Cron expression examples
"cronSchedule": "45 1/12 1-5 JAN,OCT ? *": This cron expression will trigger the plugin at 1:45 AM and 1:45 PM on the 1st through 5th of January and October, every year.
"cronSchedule": "0 6 15 1 ? 2024": This cron expression will trigger the plugin at 6:00 AM on the 15th of January, 2024, regardless of the day of the week.
"cronSchedule": "0 18 ? * 5 2024": This cron expression will trigger the plugin every Friday at 6:00 PM.
To implement the scheduler you need to pass it in the configuration data as follows:
{
"name": "Non-Specific",
"displayName": "Non Specific",
"version": 1,
"runtime": "python3.12",
"handler": "index.handler",
"timeout": 3,
"memorySize": 128,
"environmentVariables": {
},
"subscriptions": {
},
"enabledState": "ENABLED",
"cronSchedule": "45 1/12 1-5 JAN,OCT ? *"
}
Now the plugin will run 1:45AM and 1:45PM on the 1st through 5th of January and October, every year.
When invoking the plugin via a cron scheduler
There is no direct mechanism to pass a JWT token as part of the cron invocation. The scheduler is designed to trigger functions automatically based on time events, and it doesn’t provide a way to include custom headers or payloads like a JWT token in the request.
Updated about 2 months ago