From 2d25f9d845a561a2a68f47f982bc3f8c79a85d4e Mon Sep 17 00:00:00 2001 From: Eluso Date: Thu, 29 Oct 2020 14:52:15 +0800 Subject: [PATCH] Update rest.md --- docs/en_US/rules/sinks/rest.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/docs/en_US/rules/sinks/rest.md b/docs/en_US/rules/sinks/rest.md index c3510ef1cd..1a09b71db0 100644 --- a/docs/en_US/rules/sinks/rest.md +++ b/docs/en_US/rules/sinks/rest.md @@ -22,4 +22,32 @@ REST service usually requires a specific data format. That can be imposed by the "sendSingle": true } } -``` \ No newline at end of file +``` + +## Visualization mode + +Use visualization create rules SQL and Actions + +## Text mode + +Use text json create rules SQL and Actions + +Example for taosdb rest: +```json +{"id": "rest1", + "sql": "SELECT tele[0]-\u003eTag00001 AS temperature, tele[0]-\u003eTag00002 AS humidity FROM neuron", + "actions": [ + { + "rest": { + "bodyType": "text", + "dataTemplate": "insert into mqtt.kuiper values (now, {{.temperature}}, {{.humidity}})", + "debugResp": true, + "headers": {"Authorization": "Basic cm9vdDp0YW9zZGF0YQ=="}, + "method": "POST", + "sendSingle": true, + "url": "http://xxx.xxx.xxx.xxx:6041/rest/sql" + } + } + ] +} +```