未验证 提交 854b15c0 编写于 作者: sangshuduo's avatar sangshuduo 提交者: GitHub

docs: adjust rest api and schemaless doc (#17045)

* docs: add schemaless writing for cloud

* docs: add section description and remove http from url

* docs: adjust schemaless and rest api doc
上级 684ebf6e
--- ---
sidebar_label: REST and Schemaless sidebar_label: REST
title: REST and Schemaless title: REST
description: Insert data using REST API or Schemaless description: Insert data using REST API
--- ---
<!-- exclude --> <!-- exclude -->
...@@ -10,7 +10,7 @@ import TabItem from '@theme/TabItem'; ...@@ -10,7 +10,7 @@ import TabItem from '@theme/TabItem';
<!-- exclude-end --> <!-- exclude-end -->
In this section we will explain how to write into TDengine cloud service using REST API or schemaless protocols over REST interface. In this section we will explain how to write into TDengine cloud service using REST API.
## REST API ## REST API
...@@ -45,7 +45,7 @@ $env:TDENGINE_CLOUD_URL="<url>" ...@@ -45,7 +45,7 @@ $env:TDENGINE_CLOUD_URL="<url>"
</TabItem> </TabItem>
</Tabs> </Tabs>
### Insert Data using REST API ### Insert
Following command below show how to insert data into the table `d1001` of the database `test` via the command line utility `curl`. Following command below show how to insert data into the table `d1001` of the database `test` via the command line utility `curl`.
...@@ -55,28 +55,3 @@ curl -L \ ...@@ -55,28 +55,3 @@ curl -L \
$TDENGINE_CLOUD_URL/rest/sql/test?token=$TDENGINE_CLOUD_TOKEN $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 `<cloud_url>/influxdb/v1/write` to write data in InfluxDB compatible format to TDengine. The EndPoint is as follows:
```text
/influxdb/v1/write?db=<db_name>&token=<cloud_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 `<cloud_url>/opentsdb/v1/put` to write data in OpenTSDB compatible format to TDengine. The EndPoint is as follows:
```text
/opentsdb/v1/put/json/<db>?token=<cloud_token>
/opentsdb/v1/put/telnet/<db>?token=<cloud_token>
```
---
sidebar_label: Schemaless - InfluxDB Line Protocol
title: Schemaless - InfluxDB Line Protocol
description: Insert data in Schemaless Line Protocol
---
<!-- exclude -->
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
<!-- exclude-end -->
In this section we will explain how to write into TDengine cloud service using schemaless InfluxDB line protocols over REST interface.
## Config
Run this command in your terminal to save the TDengine cloud token and URL as variables:
<Tabs defaultValue="bash">
<TabItem value="bash" label="Bash">
```bash
export TDENGINE_CLOUD_TOKEN="<token>"
export TDENGINE_CLOUD_URL="<url>"
```
</TabItem>
<TabItem value="cmd" label="CMD">
```bash
set TDENGINE_CLOUD_TOKEN="<token>"
set TDENGINE_CLOUD_URL="<url>"
```
</TabItem>
<TabItem value="powershell" label="Powershell">
```powershell
$env:TDENGINE_CLOUD_TOKEN="<token>"
$env:TDENGINE_CLOUD_URL="<url>"
```
</TabItem>
</Tabs>
## Insert
You can use any client that supports the http protocol to access the RESTful interface address `<cloud_url>/influxdb/v1/write` to write data in InfluxDB compatible format to TDengine. The EndPoint is as follows:
```text
/influxdb/v1/write?db=<db_name>&token=<cloud_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.
---
sidebar_label: Schemaless - OpenTSDB JSON Protocol
title: Schemaless - OpenTSDB JSON Protocol
description: Insert data in OpenTSDB JSON Protocol
---
<!-- exclude -->
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
<!-- exclude-end -->
In this section we will explain how to write into TDengine cloud service using schemaless OpenTSDB JSON protocols over REST interface.
## Config
Run this command in your terminal to save the TDengine cloud token and URL as variables:
<Tabs defaultValue="bash">
<TabItem value="bash" label="Bash">
```bash
export TDENGINE_CLOUD_TOKEN="<token>"
export TDENGINE_CLOUD_URL="<url>"
```
</TabItem>
<TabItem value="cmd" label="CMD">
```bash
set TDENGINE_CLOUD_TOKEN="<token>"
set TDENGINE_CLOUD_URL="<url>"
```
</TabItem>
<TabItem value="powershell" label="Powershell">
```powershell
$env:TDENGINE_CLOUD_TOKEN="<token>"
$env:TDENGINE_CLOUD_URL="<url>"
```
</TabItem>
</Tabs>
### Insert
You can use any client that supports the http protocol to access the RESTful interface address `<cloud_url>/opentsdb/v1/put` to write data in OpenTSDB compatible format to TDengine. The EndPoint is as follows:
```text
/opentsdb/v1/put/json/<db>?token=<cloud_token>
```
---
sidebar_label: Schemaless - OpenTSDB Telnet Protocol
title: Schemaless - OpenTSDB Telnet Protocol
description: Insert data in OpenTSDB Telnet Protocol
---
<!-- exclude -->
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
<!-- exclude-end -->
In this section we will explain how to write into TDengine cloud service using schemaless OpenTSDB Telnet protocols over REST interface.
## Config
Run this command in your terminal to save the TDengine cloud token and URL as variables:
<Tabs defaultValue="bash">
<TabItem value="bash" label="Bash">
```bash
export TDENGINE_CLOUD_TOKEN="<token>"
export TDENGINE_CLOUD_URL="<url>"
```
</TabItem>
<TabItem value="cmd" label="CMD">
```bash
set TDENGINE_CLOUD_TOKEN="<token>"
set TDENGINE_CLOUD_URL="<url>"
```
</TabItem>
<TabItem value="powershell" label="Powershell">
```powershell
$env:TDENGINE_CLOUD_TOKEN="<token>"
$env:TDENGINE_CLOUD_URL="<url>"
```
</TabItem>
</Tabs>
### Insert
You can use any client that supports the http protocol to access the RESTful interface address `<cloud_url>/opentsdb/v1/put` to write data in OpenTSDB compatible format to TDengine. The EndPoint is as follows:
```text
/opentsdb/v1/put/telnet/<db>?token=<cloud_token>
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册