From 1671ba9d5297ada018aad931b523625605523c41 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Tue, 13 Sep 2022 17:12:48 +0800 Subject: [PATCH] docs: add schemaless writing for cloud (#16801) * docs: add schemaless writing for cloud * docs: add section description and remove http from url --- docs/en/07-data-in/05-rest-schemaless.md | 82 +++++++++++++++++++ .../{02-prometheus.md => 10-prometheus.md} | 0 .../{03-telegraf.md => 20-telegraf.md} | 0 3 files changed, 82 insertions(+) create mode 100644 docs/en/07-data-in/05-rest-schemaless.md rename docs/en/07-data-in/{02-prometheus.md => 10-prometheus.md} (100%) rename docs/en/07-data-in/{03-telegraf.md => 20-telegraf.md} (100%) diff --git a/docs/en/07-data-in/05-rest-schemaless.md b/docs/en/07-data-in/05-rest-schemaless.md new file mode 100644 index 0000000000..91eb1057e9 --- /dev/null +++ b/docs/en/07-data-in/05-rest-schemaless.md @@ -0,0 +1,82 @@ +--- +sidebar_label: REST and Schemaless +title: REST and Schemaless +description: Insert data using REST API or Schemaless +--- + + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + +In this section we will explain how to write into TDengine cloud service using REST API or schemaless protocols over REST interface. + +## 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 Data using REST API + +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 "INSERT INTO d1001 VALUES (1538548685000, 10.3, 219, 0.31)" \ + $TDENGINE_CLOUD_URL/rest/sql/test?token=$TDENGINE_CLOUD_TOKEN +``` + +## Schemaless + +### InfluxDB Line Protocol + +You can use any client that supports the http protocol to access the RESTful interface address `/influxdb/v1/write` to write data in InfluxDB compatible format to TDengine. The EndPoint is as follows: + +```text +/influxdb/v1/write?db=&token= +``` + +Support InfluxDB query parameters as follows. + +- `db` Specifies the database name used by TDengine +- `precision` The time precision used by TDengine + +Note: InfluxDB token authorization is not supported at present. Only Basic authorization and query parameter validation are supported. + +### OpenTSDB Json and Telnet Protocol + +You can use any client that supports the http protocol to access the RESTful interface address `/opentsdb/v1/put` to write data in OpenTSDB compatible format to TDengine. The EndPoint is as follows: + +```text +/opentsdb/v1/put/json/?token= +/opentsdb/v1/put/telnet/?token= +``` diff --git a/docs/en/07-data-in/02-prometheus.md b/docs/en/07-data-in/10-prometheus.md similarity index 100% rename from docs/en/07-data-in/02-prometheus.md rename to docs/en/07-data-in/10-prometheus.md diff --git a/docs/en/07-data-in/03-telegraf.md b/docs/en/07-data-in/20-telegraf.md similarity index 100% rename from docs/en/07-data-in/03-telegraf.md rename to docs/en/07-data-in/20-telegraf.md -- GitLab