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

docs: use json instead of table in rest api (#20895)

* docs: add rest api diff

* docs: use html table

* docs: use json instead of table in rest api doc
上级 c3abf5ed
...@@ -405,18 +405,12 @@ Response body: ...@@ -405,18 +405,12 @@ Response body:
### Response body ### Response body
<table> #### REST response body return from TDengine 2.x
<tr>
<td> Response body </td> <td> TDengine 2.x </td> <td> TDengine 3.0 </td> ```JSON
</tr> {
<tr> "status": "succ",
<td> Success </td> <td> "status": "succ",</td> <td> "code": 0,</td> "head": [
/<tr>
<tr>
<td> Column meta </td>
<td>
```
"head": [
"name", "name",
"created_time", "created_time",
"ntables", "ntables",
...@@ -435,37 +429,7 @@ Response body: ...@@ -435,37 +429,7 @@ Response body:
"precision", "precision",
"status" "status"
], ],
``` "data": [
</td>
<td>
```
"column_meta": [
[
"name",
"VARCHAR",
64
],
[
"ntables",
"BIGINT",
8
],
[
"status",
"VARCHAR",
10
]
],
```
</td>
</tr>
<tr>
<td>
Data
</td>
<td>
```
"data": [
[ [
"log", "log",
"2020-09-02 17:23:00.039", "2020-09-02 17:23:00.039",
...@@ -485,10 +449,10 @@ Data ...@@ -485,10 +449,10 @@ Data
"us", "us",
"ready" "ready"
] ]
], ],
"rows": 1
}
``` ```
</td>
<td>
``` ```
"data": [ "data": [
[ [
...@@ -503,9 +467,44 @@ Data ...@@ -503,9 +467,44 @@ Data
] ]
], ],
``` ```
</td>
</tr> #### REST response body return from TDengine 3.0
</table>
```JSON
{
"code": 0,
"column_meta": [
[
"name",
"VARCHAR",
64
],
[
"ntables",
"BIGINT",
8
],
[
"status",
"VARCHAR",
10
]
],
"data": [
[
"information_schema",
16,
"ready"
],
[
"performance_schema",
9,
"ready"
]
],
"rows": 2
}
```
## Reference ## Reference
......
...@@ -408,18 +408,12 @@ curl http://192.168.0.1:6041/rest/login/root/taosdata ...@@ -408,18 +408,12 @@ curl http://192.168.0.1:6041/rest/login/root/taosdata
### 响应代码和消息体 ### 响应代码和消息体
<table> #### TDengine 2.x 响应代码和消息体
<tr>
<td> 响应代码和消息体 </td> <td> TDengine 2.x </td> <td> TDengine 3.0 </td> ```JSON
</tr> {
<tr> "status": "succ",
<td> Success </td> <td> "status": "succ",</td> <td> "code": 0,</td> "head": [
/<tr>
<tr>
<td> Column meta </td>
<td>
```
"head": [
"name", "name",
"created_time", "created_time",
"ntables", "ntables",
...@@ -438,37 +432,7 @@ curl http://192.168.0.1:6041/rest/login/root/taosdata ...@@ -438,37 +432,7 @@ curl http://192.168.0.1:6041/rest/login/root/taosdata
"precision", "precision",
"status" "status"
], ],
``` "data": [
</td>
<td>
```
"column_meta": [
[
"name",
"VARCHAR",
64
],
[
"ntables",
"BIGINT",
8
],
[
"status",
"VARCHAR",
10
]
],
```
</td>
</tr>
<tr>
<td>
Data
</td>
<td>
```
"data": [
[ [
"log", "log",
"2020-09-02 17:23:00.039", "2020-09-02 17:23:00.039",
...@@ -488,10 +452,10 @@ Data ...@@ -488,10 +452,10 @@ Data
"us", "us",
"ready" "ready"
] ]
], ],
"rows": 1
}
``` ```
</td>
<td>
``` ```
"data": [ "data": [
[ [
...@@ -506,9 +470,45 @@ Data ...@@ -506,9 +470,45 @@ Data
] ]
], ],
``` ```
</td>
</tr> #### TDengine 3.0 响应代码和消息体
</table>
```JSON
{
"code": 0,
"column_meta": [
[
"name",
"VARCHAR",
64
],
[
"ntables",
"BIGINT",
8
],
[
"status",
"VARCHAR",
10
]
],
"data": [
[
"information_schema",
16,
"ready"
],
[
"performance_schema",
9,
"ready"
]
],
"rows": 2
}
```
## 参考 ## 参考
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册