본문으로 건너뛰기

FunctionCondition

Cron-triggered Python condition. On each scheduled occurrence, the condition runs code with params and proceeds to the reaction actions only when the code returns true.

languageLanguage (string)필수
상수 값: python
codeCode (string)필수

Python function body executed by this action.

params object

Bound parameters passed to the function

property name*any

Bound parameters passed to the function

schedule object

5-field cron; the cadence that wakes the condition (1 min floor). Exactly one of schedule / rrule.

하나 이상(anyOf)
string
rrule object

iCal RRULE (RFC 5545), e.g. FREQ=MONTHLY;BYDAY=-1FR;BYHOUR=9 — the cadences cron cannot say (last Friday of the month, every other week). A cadence of a day or longer (FREQ DAILY or coarser, at most 24 fires a day); a finer one is a cron schedule. Evaluated in the scheduler's timezone; a DTSTART must carry one. Exactly one of schedule / rrule, same 1 min floor.

하나 이상(anyOf)
string
context object

Values carried as-is into the payload's context on every firing — which report to run, a threshold, a channel

property name*any

Values carried as-is into the payload's context on every firing — which report to run, a threshold, a channel

kindKind (string)필수
상수 값: function
schema object

JSON Schema of the dict run returns; declared, it is what the actions' {{context.*}} references are validated against at save time and the return value at run time

하나 이상(anyOf)
object
FunctionCondition
{
"language": "python",
"code": "string",
"params": {},
"schedule": "string",
"rrule": "string",
"context": {},
"kind": "function",
"schema": {}
}