未验证 提交 fcd211a7 编写于 作者: C CloudWise-Lukemiao 提交者: GitHub

[IOTDB-2313][REST API Doc] how to avoid GC overhead (#4926)

Co-authored-by: NSteve Yurong Su <rong@apache.org>
上级 288f3797
...@@ -22,13 +22,26 @@ ...@@ -22,13 +22,26 @@
## RESTful Services ## RESTful Services
IoTDB's RESTful services can be used for query, write, and management operations, using the OpenAPI standard to define interfaces and generate frameworks. IoTDB's RESTful services can be used for query, write, and management operations, using the OpenAPI standard to define interfaces and generate frameworks.
### Enable RESTful Services
RESTful services are disabled by default.
* Developer
Find the `IoTDBrestServiceConfig` class under `org.apache.iotdb.db.conf.rest` in the sever module, and modify `enableRestService=true`.
* User
Find the `conf/iotdb.properties` file under the IoTDB installation directory and set `enable_rest_service` to `true` to enable the module.
```properties
enable_rest_service=true
```
### Authentication ### Authentication
RESTful services use the basic authentication. Each URL request needs to carry `'Authorization': 'Basic ' + base64.encode(username + ':' + password)`. RESTful services use the basic authentication. Each URL request needs to carry `'Authorization': 'Basic ' + base64.encode(username + ':' + password)`.
### Interface ### Interface
#### ping #### ping
...@@ -96,6 +109,8 @@ Response parameters: ...@@ -96,6 +109,8 @@ Response parameters:
**Examples:** **Examples:**
Tip: Statements like `select * from root.xx.**` are not recommended because those statements may cause OOM.
**Expression query** **Expression query**
```shell ```shell
......
...@@ -213,6 +213,8 @@ Here are some examples of valid CONTROL content: ...@@ -213,6 +213,8 @@ Here are some examples of valid CONTROL content:
* `group by ([0, 20), 2ms, 3ms), level=1` * `group by ([0, 20), 2ms, 3ms), level=1`
Tip: Statements like `select * from root.xx.**` are not recommended because those statements may cause OOM.
#### Support for variables and template functions #### Support for variables and template functions
This plugin supports Grafana's variables and templates (https://grafana.com/docs/grafana/v7.0/variables/) feature. This plugin supports Grafana's variables and templates (https://grafana.com/docs/grafana/v7.0/variables/) feature.
......
...@@ -22,7 +22,19 @@ ...@@ -22,7 +22,19 @@
## RESTful 服务 ## RESTful 服务
IoTDB 的 RESTful 服务可用于查询、写入和管理操作,它使用 OpenAPI 标准来定义接口并生成框架。 IoTDB 的 RESTful 服务可用于查询、写入和管理操作,它使用 OpenAPI 标准来定义接口并生成框架。
### 开启RESTful 服务
RESTful 服务默认情况是关闭的
* 开发者
找到sever模块中`org.apache.iotdb.db.conf.rest` 下面的`IoTDBRestServiceConfig`类,修改`enableRestService=true`即可。
* 使用者
找到IoTDB安装目录下面的`conf/iotdb.properties`文件,将 `enable_rest_service` 设置为 `true` 以启用该模块。
```properties
enable_rest_service=true
```
### 鉴权 ### 鉴权
RESTful 服务使用了基础(basic)鉴权,每次 URL 请求都需要在 header 中携带 `'Authorization': 'Basic ' + base64.encode(username + ':' + password)` RESTful 服务使用了基础(basic)鉴权,每次 URL 请求都需要在 header 中携带 `'Authorization': 'Basic ' + base64.encode(username + ':' + password)`
...@@ -96,6 +108,8 @@ query 接口可以用于处理数据查询和元数据查询。 ...@@ -96,6 +108,8 @@ query 接口可以用于处理数据查询和元数据查询。
请求示例如下所示: 请求示例如下所示:
提示:为了避免OOM问题,不推荐使用select * from root.xx.** 这种查找方式。
请求示例 表达式查询: 请求示例 表达式查询:
```shell ```shell
curl -H "Content-Type:application/json" -H "Authorization:Basic cm9vdDpyb290" -X POST --data '{"sql":"select s3, s4, s3 + 1 from root.sg27 limit 2"}' http://127.0.0.1:18080/rest/v1/query curl -H "Content-Type:application/json" -H "Authorization:Basic cm9vdDpyb290" -X POST --data '{"sql":"select s3, s4, s3 + 1 from root.sg27 limit 2"}' http://127.0.0.1:18080/rest/v1/query
......
...@@ -220,7 +220,7 @@ CONTROL 输入框为非必须填写项目,填写内容应当是控制查询类 ...@@ -220,7 +220,7 @@ CONTROL 输入框为非必须填写项目,填写内容应当是控制查询类
* `group by ((2017-11-01T00:00:00, 2017-11-07T23:00:00], 1d), level=1` * `group by ((2017-11-01T00:00:00, 2017-11-07T23:00:00], 1d), level=1`
* `group by ([0, 20), 2ms, 3ms), level=1` * `group by ([0, 20), 2ms, 3ms), level=1`
提示:为了避免OOM问题,不推荐使用select * from root.xx.** 这种语句在Grafana plugin中使用。
#### 变量与模板功能的支持 #### 变量与模板功能的支持
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册