REST action
::: v-pre
REST service usually requires a specific data format. That can be imposed by the common sink property dataTemplate
. Please check the data template. Below is a sample configuration for connecting to Edgex Foundry core command. The dataTemplate {{.key}}
means it will print out the value of key, that is result[key]. So the template here is to select only field key
in the result and change the field name to . sendSingle
is another common property. Set to true means that if the result is an array, each element will be sent individually.
:::
Use text json create rules SQL and Actions
There are many scenarios that we need to sink to dynamic url and configurations through REST sink. The properties method
, url
,bodyType
and headers
support dynamic property through jsonpath syntax. Let’s look at an example to modify the previous sample to a dynamic version. Assume we receive data which have metadata like http method and url postfix. We can modify the SQL to fetch these metadata in the result. The rule result will be like: