From 31e2a43a2c062c044d05ff2fb5ade501d9a86005 Mon Sep 17 00:00:00 2001 From: t_max <1172915550@qq.com> Date: Mon, 6 Jan 2025 14:37:43 +0800 Subject: [PATCH] docs: fix taosAdapter and rest-api docs --- .../01-components/03-taosadapter.md | 17 ++++++++++++++++- .../en/14-reference/05-connector/60-rest-api.md | 3 +-- .../01-components/03-taosadapter.md | 16 +++++++++++++++- .../14-reference/05-connector/60-rest-api.mdx | 3 +-- 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/docs/en/14-reference/01-components/03-taosadapter.md b/docs/en/14-reference/01-components/03-taosadapter.md index 13b7c047f4..0d454756dd 100644 --- a/docs/en/14-reference/01-components/03-taosadapter.md +++ b/docs/en/14-reference/01-components/03-taosadapter.md @@ -268,7 +268,22 @@ An exporter used by Prometheus that exposes hardware and operating system metric ### Getting the VGroup ID of a table -You can access the HTTP interface `http://:6041/rest/vgid?db=&table=` to get the VGroup ID of a table. +You can send a POST request to the HTTP interface `http://:/rest/sql//vgid` to get the VGroup ID of a table. +The body should be a JSON array of multiple table names. + +Example: Get the VGroup ID for the database power and tables d_bind_1 and d_bind_2. + +```shell +curl --location 'http://127.0.0.1:6041/rest/sql/power/vgid' \ +--user 'root:taosdata' \ +--data '["d_bind_1","d_bind_2"]' +``` + +response: + +```json +{"code":0,"vgIDs":[153,152]} +``` ## Memory Usage Optimization Methods diff --git a/docs/en/14-reference/05-connector/60-rest-api.md b/docs/en/14-reference/05-connector/60-rest-api.md index 88e53f7618..3f0cd702f3 100644 --- a/docs/en/14-reference/05-connector/60-rest-api.md +++ b/docs/en/14-reference/05-connector/60-rest-api.md @@ -252,7 +252,7 @@ Description: - code: (`int`) 0 represents success. - column_meta: (`[][3]any`) Column information, each column is described by three values: column name (string), column type (string), and type length (int). - rows: (`int`) Number of data return rows. -- data: (`[][]any`) Specific data content (time format only supports RFC3339, result set for timezone 0). +- data: (`[][]any`) Specific data content (time format only supports RFC3339, result set for timezone 0, when specifying tz, the corresponding time zone is returned). Column types use the following strings: @@ -434,7 +434,6 @@ curl http://:/rest/login// Here, `fqdn` is the FQDN or IP address of the TDengine database, `port` is the port number of the TDengine service, `username` is the database username, and `password` is the database password. The return is in JSON format, with the fields meaning as follows: -- status: Flag of the request result. - code: Return code. - desc: Authorization code. diff --git a/docs/zh/14-reference/01-components/03-taosadapter.md b/docs/zh/14-reference/01-components/03-taosadapter.md index bf5060cec5..d2f21897a9 100644 --- a/docs/zh/14-reference/01-components/03-taosadapter.md +++ b/docs/zh/14-reference/01-components/03-taosadapter.md @@ -262,7 +262,21 @@ Prometheus 使用的由 \*NIX 内核暴露的硬件和操作系统指标的输 ### 获取 table 的 VGroup ID -可以访问 http 接口 `http://:6041/rest/vgid?db=&table=
` 获取 table 的 VGroup ID。 +可以 POST 请求 http 接口 `http://:/rest/sql//vgid` 获取 table 的 VGroup ID,body 是多个表名 JSON 数组。 + +样例:获取数据库为 power,表名为 d_bind_1 和 d_bind_2 的 VGroup ID + +```shell +curl --location 'http://127.0.0.1:6041/rest/sql/power/vgid' \ +--user 'root:taosdata' \ +--data '["d_bind_1","d_bind_2"]' +``` + +响应: + +```json +{"code":0,"vgIDs":[153,152]} +``` ## 内存使用优化方法 diff --git a/docs/zh/14-reference/05-connector/60-rest-api.mdx b/docs/zh/14-reference/05-connector/60-rest-api.mdx index df6adadcab..6693933eca 100644 --- a/docs/zh/14-reference/05-connector/60-rest-api.mdx +++ b/docs/zh/14-reference/05-connector/60-rest-api.mdx @@ -253,7 +253,7 @@ C 接口网络不可用相关错误码: - code:(`int`)0 代表成功。 - column_meta:(`[][3]any`) 列信息,每个列会用三个值来说明,分别为:列名(string)、列类型(string)、类型长度(int)。 - rows:(`int`)数据返回行数。 -- data:(`[][]any`)具体数据内容(时间格式仅支持 RFC3339,结果集为 0 时区)。 +- data:(`[][]any`)具体数据内容(时间格式仅支持 RFC3339,结果集为 0 时区,指定 tz 时返回对应时区)。 列类型使用如下字符串: @@ -435,7 +435,6 @@ curl http://:/rest/login// 其中,`fqdn` 是 TDengine 数据库的 FQDN 或 IP 地址,`port` 是 TDengine 服务的端口号,`username` 为数据库用户名,`password` 为数据库密码,返回值为 JSON 格式,各字段含义如下: -- status:请求结果的标志位。 - code:返回值代码。 - desc:授权码。