Documentation
¶
Index ¶
- Constants
- func AddRule(rule models.Rule) errors.EdgeX
- func DeleteRuleByName(name string) errors.EdgeX
- func GetAllRule() []models.Rule
- func GetRuleByName(name string) (models.Rule, errors.EdgeX)
- func InitRuleApplication(l logger.LoggingClient, portService int, ...) error
- func TriggerRuleById(id string, contentTrigger models.ContentTrigger)
- func UpdateRuleByName(name string, rule models.Rule) errors.EdgeX
Constants ¶
View Source
const ( StreamName = "events" StreamSQLTemplate = string(`{"sql":"create stream %s () WITH (FORMAT=\"JSON\", TYPE=\"edgex\")"}`) AddRuleSQLTemplate = string(`{"id":"%s","sql":"SELECT (collect(%s)[1] %s %s) as v FROM %s GROUP BY PADCOUNTWINDOW(2,1) FILTER(WHERE meta(deviceName) = \"%s\") HAVING collect(%s)[0] %s %s OR collect(%s)[1] %s %s", "actions": [{ "rest": { "url": "http://%s:%d/api/v2/rule/id/%s", "method": "post", "dataTemplate": "{\"triggerState\":{{.v}},\"triggerIndex\":%d}", "sendSingle": true } } ]}`) UpdateRuleSQLTemplate = string(`{"sql":"SELECT (collect(%s)[1] %s %s) as v FROM %s GROUP BY PADCOUNTWINDOW(2,1) FILTER(WHERE meta(deviceName) = \"%s\") HAVING collect(%s)[0] %s %s OR collect(%s)[1] %s %s", "actions": [{ "rest": { "url": "http://%s:%d/api/v2/rule/id/%s", "method": "post", "dataTemplate": "{\"triggerState\":{{.v}},\"triggerIndex\":%d}", "sendSingle": true } } ]}`) )
Variables ¶
This section is empty.
Functions ¶
func DeleteRuleByName ¶
func GetAllRule ¶
func InitRuleApplication ¶
func InitRuleApplication(l logger.LoggingClient, portService int, hostService, urlCoreCommand, urlNotification, urlSchduler, urlRuleEngine string) error
func TriggerRuleById ¶
func TriggerRuleById(id string, contentTrigger models.ContentTrigger)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.