From 2de9f1922dde49e9ddcba642a328c6de6053bc12 Mon Sep 17 00:00:00 2001 From: gccgdb1234 Date: Thu, 29 Sep 2022 18:03:28 +0800 Subject: [PATCH] doc: add rest for data out --- docs/en/09-data-out/02-rest.md | 56 ++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 docs/en/09-data-out/02-rest.md diff --git a/docs/en/09-data-out/02-rest.md b/docs/en/09-data-out/02-rest.md new file mode 100644 index 0000000000..048b66a71f --- /dev/null +++ b/docs/en/09-data-out/02-rest.md @@ -0,0 +1,56 @@ +--- +sidebar_label: REST +title: REST +description: Insert data using REST API +--- + + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + +In this section we will explain how to query data from TDengine cloud service using REST API. + +## Config + +Run this command in your terminal to save the TDengine cloud token and URL as variables: + + + + +```bash +export TDENGINE_CLOUD_TOKEN="" +export TDENGINE_CLOUD_URL="" +``` + + + + +```bash +set TDENGINE_CLOUD_TOKEN="" +set TDENGINE_CLOUD_URL="" +``` + + + + +```powershell +$env:TDENGINE_CLOUD_TOKEN="" +$env:TDENGINE_CLOUD_URL="" +``` + + + + +## Insert + +Following command below show how to insert data into the table `d1001` of the database `test` via the command line utility `curl`. + +```bash +curl -L \ + -d "select name, ntables, status from information_schema.ins_databases;" \ + $TDENGINE_CLOUD_URL/rest/sql/test?token=$TDENGINE_CLOUD_TOKEN +``` + +Please refer to [REST-API](https://docs.tdengine.com/reference/rest-api/) for detailed documentation. -- GitLab