Skip to content

Commit

Permalink
Update rest.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Jadeite09 authored and ngjaying committed Nov 2, 2020
1 parent 0441f17 commit 2d25f9d
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion docs/en_US/rules/sinks/rest.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,32 @@ REST service usually requires a specific data format. That can be imposed by the
"sendSingle": true
}
}
```
```

## 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"
}
}
]
}
```

0 comments on commit 2d25f9d

Please sign in to comment.