title | weight |
---|---|
CoAP |
4702 |
This trigger provides your flogo application the ability to start a flow via CoAP
flogo add trigger github.com/TIBCOSoftware/flogo-contrib/trigger/coap
Settings, Outputs and Endpoint:
"settings": [
{
"name": "port",
"type": "integer",
}
],
"output": [
{
"name": "payload",
"type": "string"
}
],
"endpoint": {
"settings": [
{
"name": "method",
"type": "string",
"required" : true
},
{
"name": "path",
"type": "string",
"required" : true
}
]
}
Setting | Description |
---|---|
port | Used to override the standard CoAP server port of 5683 |
Setting | Description |
---|---|
method | The CoAP method |
path | The resource path |
Triggers are configured via the triggers.json of your application. The following are some example configuration of the CoAP Trigger.
Configure the Trigger to handle a CoAP POST message with path /device/refresh
{
"triggers": [
{
"name": "flogo-coap",
"settings": {},
"endpoints": [
{
"actionType": "flow",
"actionURI": "embedded://myflow",
"settings": {
"method": "POST",
"path": "/device/refresh"
}
}
]
}
]
}
Do to some simple testing of the CoAP trigger, you can use the Copper (Cu) plugin for Firefox.
Once you have the plugin installed, you can interact with the trigger by going to: coap://localhost:5683 in Firefox.