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

docs: update cloud doc restapi (#16407)

* docs: add rest api to cloud doc

* docs: fix syntax and wording

* docs: fix tab format
上级 0cdcc085
...@@ -3,6 +3,9 @@ sidebar_label: REST API ...@@ -3,6 +3,9 @@ sidebar_label: REST API
title: REST API title: REST API
--- ---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
## Config ## Config
Run this command in your terminal to save the TDengine cloud token and URL as variables: Run this command in your terminal to save the TDengine cloud token and URL as variables:
......
...@@ -24,7 +24,7 @@ The following example lists all databases on the `TDengine Cloud URL` host. If y ...@@ -24,7 +24,7 @@ The following example lists all databases on the `TDengine Cloud URL` host. If y
```bash ```bash
curl -L \ curl -L \
-d "select name, ntables, status from information_schema.ins_databases;" \ -d "select name, ntables, status from information_schema.ins_databases;" \
<TDengine Service URL>/rest/sql?token=<TDengine Cloud Token> <TDengine Cloud URL>/rest/sql?token=<TDengine Cloud Token>
``` ```
The following return value results indicate that the verification passed. The following return value results indicate that the verification passed.
...@@ -68,7 +68,7 @@ The following return value results indicate that the verification passed. ...@@ -68,7 +68,7 @@ The following return value results indicate that the verification passed.
## HTTP request URL format ## HTTP request URL format
```text ```text
http://<TDENGINE_CLOUD_URL>/rest/sql/[db_name]?token=TDENGINE_CLOUD_TOKEN https://<TDENGINE_CLOUD_URL>/rest/sql/[db_name]?token=TDENGINE_CLOUD_TOKEN
``` ```
Parameter Description: Parameter Description:
...@@ -77,7 +77,7 @@ Parameter Description: ...@@ -77,7 +77,7 @@ Parameter Description:
- db_name: Optional parameter specifies the default database name for the executed SQL command. - db_name: Optional parameter specifies the default database name for the executed SQL command.
- token: used to access TDengine cloud service. - token: used to access TDengine cloud service.
For example, `http://gw-aws.cloud.tdengine.com:80/rest/sql/test?token=xxxxxxxxx` is a URL to `gw-aws.cloud.tdengine:80` and sets the default database name to `test`. For example, `https://gw-aws.cloud.tdengine.com:80/rest/sql/test?token=xxxxxxxxx` is a URL to `gw-aws.cloud.tdengine:80` and sets the default database name to `test`.
The HTTP request's BODY is a complete SQL command, and the data table in the SQL statement should be provided with a database prefix, e.g., `db_name.tb_name`. If the table name does not have a database prefix and the database name is not specified in the URL, the system will respond with an error because the HTTP module is a simple forwarder and has no awareness of the current DB. The HTTP request's BODY is a complete SQL command, and the data table in the SQL statement should be provided with a database prefix, e.g., `db_name.tb_name`. If the table name does not have a database prefix and the database name is not specified in the URL, the system will respond with an error because the HTTP module is a simple forwarder and has no awareness of the current DB.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册