title | weight |
---|---|
REST |
4706 |
This trigger provides your flogo application the ability to start a flow via REST over HTTP
flogo add trigger github.com/TIBCOSoftware/flogo-contrib/trigger/rest
Settings, Outputs and Endpoint:
{
"settings": [
{
"name": "port",
"type": "integer"
}
],
"output": [
{
"name": "pathParams",
"type": "params"
},
{
"name": "queryParams",
"type": "params"
},
{
"name": "header",
"type": "params"
},
{
"name": "content",
"type": "object"
}
],
"endpoint": {
"settings": [
{
"name": "method",
"type": "string",
"required" : true
},
{
"name": "path",
"type": "string",
"required" : true
}
]
}
}
Setting | Description |
---|---|
port | The port to listen on |
Setting | Description |
---|---|
method | The HTTP method |
path | The resource path |
Triggers are configured via the triggers.json of your application. The following are some example configuration of the REST Trigger.
Configure the Trigger to handle a POST on /device
{
"triggers": [
{
"name": "flogo-rest",
"settings": {
"port": "8080"
},
"endpoints": [
{
"actionType": "flow",
"actionURI": "embedded://new_device_flow",
"settings": {
"method": "POST",
"path": "/device"
}
}
]
}
]
}
Configure the Trigger to handle a GET on /device/:id
{
"triggers": [
{
"name": "flogo-rest",
"settings": {
"port": "8080"
},
"endpoints": [
{
"actionType": "flow",
"actionURI": "embedded://get_device_flow",
"settings": {
"method": "GET",
"path": "/device/:id"
}
}
]
}
]
}