You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/08/05 10:35:53 UTC

[GitHub] [incubator-doris] morningman opened a new pull request #4261: [Doc][RESTfulAPI] Develop a specification document for restful api

morningman opened a new pull request #4261:
URL: https://github.com/apache/incubator-doris/pull/4261


   ## Proposed changes
   
   In the future, Doris needs to separate the front(UI) and back(Server) ends,
   so a standardized RESTful api document is needed to guide the subsequent api design.
   
   ## Types of changes
   
   - [x] Documentation Update (if none of the other choices apply)
   
   ## Checklist
   
   - [x] I have create an issue on #4260, and have described the bug/feature there in detail
   - [x] If this change need a document change, I have updated the document
   
   ## Further comments
   
   This CL only contains docs in Chinese, after discussion, I will add English doc later.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] blackfox1983 commented on a change in pull request #4261: [Doc][RESTfulAPI] Develop a specification document for restful api

Posted by GitBox <gi...@apache.org>.
blackfox1983 commented on a change in pull request #4261:
URL: https://github.com/apache/incubator-doris/pull/4261#discussion_r465683575



##########
File path: docs/zh-CN/administrator-guide/http-actions/fe/bootstrap-action.md
##########
@@ -0,0 +1,125 @@
+---
+{
+    "title": "Bootstrap Action",
+    "language": "zh-CN"
+}
+---
+
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# Bootstrap Action
+
+## Request
+
+`GET /api/bootstrap`
+
+## Description
+
+用于判断FE是否启动完成。当不提供任何参数时,仅返回是否启动成功。如果提供了 `token` 和 `cluster_id`,则返回更多详细信息
+    
+## Path parameters
+
+无
+
+## Query parameters
+
+* `cluster_id`
+
+    集群id。可以在 `palo-meta/image/VERSION` 文件中查看。
+    
+* `token`
+
+    集群token。可以在 `palo-meta/image/VERSION` 文件中查看。
+
+## Request body
+
+无
+
+## Response
+
+* 不提供参数
+
+    ```
+    {
+    	"msg": "OK",
+    	"code": 0,
+    	"data": null,
+    	"count": 0
+    }
+    ```
+    
+    code 为 200 表示FE节点启动成功。非 200 的错误码表示其他错误。
+    
+* 提供 `token` 和 `cluster_id`
+
+    ```
+    {
+    	"msg": "OK",
+    	"code": 0,
+    	"data": {
+    		"queryPort": 9030,
+    		"rpcPort": 9020,
+    		"maxReplayedJournal": 17287
+    	},

Review comment:
       可否提供be的信息呢?比如be hosts、port、alive……
   
   主要是 有时候想看系统状态的时候,想一键都看到。且fe是master,可以拿到总览全局的数据。




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] blackfox1983 commented on a change in pull request #4261: [Doc][RESTfulAPI] Develop a specification document for restful api

Posted by GitBox <gi...@apache.org>.
blackfox1983 commented on a change in pull request #4261:
URL: https://github.com/apache/incubator-doris/pull/4261#discussion_r465687494



##########
File path: docs/zh-CN/administrator-guide/http-actions/fe/row-count-action.md
##########
@@ -0,0 +1,84 @@
+---
+{
+    "title": "Row Count Action",
+    "language": "zh-CN"
+}
+---
+
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# Row Count Action
+
+## Request
+
+`GET /api/rowcount`
+
+## Description
+
+用于手动更新指定表的行数统计信息。在更新行数统计信息的同时,也会以 JSON 格式返回表以及对应rollup的行数

Review comment:
       这个接口可否是/api/tablemeta?
   
   主要考虑
   1、获取行、表的存储空间。都是表的meta信息。可以统一返回
   2、其实需要的是一个类似unix file stat的接口:)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] blackfox1983 commented on a change in pull request #4261: [Doc][RESTfulAPI] Develop a specification document for restful api

Posted by GitBox <gi...@apache.org>.
blackfox1983 commented on a change in pull request #4261:
URL: https://github.com/apache/incubator-doris/pull/4261#discussion_r465686553



##########
File path: docs/zh-CN/administrator-guide/http-actions/fe/profile-action.md
##########
@@ -0,0 +1,80 @@
+---
+{
+    "title": "Profile Action",
+    "language": "zh-CN"
+}
+---
+
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# Profile Action
+
+## Request
+
+`GET /api/profile`
+
+## Description
+
+用于获取指定 query id 的 query profile
+    
+## Path parameters
+
+无
+
+## Query parameters
+
+* query_id
+
+    指定的 query id
+
+## Request body
+
+无
+
+## Response
+
+```
+{
+	"msg": "success",
+	"code": 0,
+	"data": {
+		"profile": "query profile ..."
+	},
+	"count": 0
+}
+```
+    
+## Examples
+
+1. 获取指定 query_id 的 query profile
+
+    ```
+    GET /api/profile?query_id=f732084bc8e74f39-8313581c9c3c0b58
+    

Review comment:
       这个queryid如何获取呢?
   或者说,可否这样:
   1、用户知道的是哪个sql。以及查询的时间范围。这个容易理解也很容易拿到
   2、基于这两个获取对应的profile、queryid?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] blackfox1983 commented on a change in pull request #4261: [Doc][RESTfulAPI] Develop a specification document for restful api

Posted by GitBox <gi...@apache.org>.
blackfox1983 commented on a change in pull request #4261:
URL: https://github.com/apache/incubator-doris/pull/4261#discussion_r465688826



##########
File path: docs/zh-CN/administrator-guide/http-actions/fe/table-row-count-action.md
##########
@@ -0,0 +1,88 @@
+---
+{
+    "title": "Table Row Count Action",
+    "language": "zh-CN"
+}
+---
+
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# Table Row Count Action
+
+## Request
+
+`GET /api/<db>/<table>/_count`
+
+## Description
+
+用于获取指定表的行数统计信息。该接口目前用于 Spark-Doris-Connector 中,Spark 获取 Doris 的表统计信息。
+    

Review comment:
       这个定位是否是spark专用?如果的话,命名为spark_count是否更可读




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] blackfox1983 commented on a change in pull request #4261: [Doc][RESTfulAPI] Develop a specification document for restful api

Posted by GitBox <gi...@apache.org>.
blackfox1983 commented on a change in pull request #4261:
URL: https://github.com/apache/incubator-doris/pull/4261#discussion_r465684860



##########
File path: docs/zh-CN/administrator-guide/http-actions/fe/connection-action.md
##########
@@ -0,0 +1,82 @@
+---
+{
+    "title": "Connection",
+    "language": "zh-CN"
+}
+---
+
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# Conection
+
+## Request
+
+`GET /api/connection`
+
+## Description
+
+给定一个 connection id,返回这个连接当前正在执行的,或最后一次执行完成的 query id。
+
+connection id 可以通过 MySQL 命令 `show processlist;` 中的 id 列查看。
+    
+## Path parameters
+
+无
+
+## Query parameters
+
+* `connection_id`
+
+    指定的 connection id
+
+## Request body
+
+无
+
+## Response
+
+```
+{
+	"msg": "OK",
+	"code": 0,
+	"data": {
+		"query_id": "b52513ce3f0841ca-9cb4a96a268f2dba"
+	},
+	"count": 0
+}
+```
+    
+## Examples
+
+1. 获取指定 connection id 的 query id
+

Review comment:
       这个还没用过。这个connectionid如何获取。。:)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman closed pull request #4261: [Doc][RESTfulAPI] Develop a specification document for restful api

Posted by GitBox <gi...@apache.org>.
morningman closed pull request #4261:
URL: https://github.com/apache/incubator-doris/pull/4261


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] blackfox1983 commented on a change in pull request #4261: [Doc][RESTfulAPI] Develop a specification document for restful api

Posted by GitBox <gi...@apache.org>.
blackfox1983 commented on a change in pull request #4261:
URL: https://github.com/apache/incubator-doris/pull/4261#discussion_r465685916



##########
File path: docs/zh-CN/administrator-guide/http-actions/fe/health-action.md
##########
@@ -0,0 +1,80 @@
+---
+{
+    "title": "Health Action",
+    "language": "zh-CN"
+}
+---
+
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# Health Action
+
+## Request
+
+`GET /api/health`
+
+## Description
+
+返回集群当前存活的 BE 节点数和宕机的 BE 节点数。
+    
+## Path parameters
+
+无
+
+## Query parameters
+
+无
+
+## Request body
+
+无
+
+## Response
+
+```
+{
+	"msg": "success",
+	"code": 0,
+	"data": {
+		"online_backend_num": 10,
+		"total_backend_num": 10
+	},
+	"count": 0
+}
+```
+    
+## Examples
+
+1. 获取集群节点健康信息
+
+    ```
+    GET /api/health
+    
+    Response:
+    {
+    	"msg": "success",
+    	"code": 0,
+    	"data": {
+    		"online_backend_num": 10,

Review comment:
       这个地方是否可以加上be的ip?
   
   这样可以知道哪个be出问题了。




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] blackfox1983 commented on a change in pull request #4261: [Doc][RESTfulAPI] Develop a specification document for restful api

Posted by GitBox <gi...@apache.org>.
blackfox1983 commented on a change in pull request #4261:
URL: https://github.com/apache/incubator-doris/pull/4261#discussion_r465684474



##########
File path: docs/zh-CN/administrator-guide/http-actions/fe/check-decommission-action.md
##########
@@ -0,0 +1,84 @@
+---
+{
+    "title": "Check Decommission Action",
+    "language": "zh-CN"
+}
+---
+
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# Check Decommission Action
+
+## Request
+
+`GET /api/check_decommission`
+
+## Description
+
+用于指定的BE是否能够被下线。比如判断节点下线后,剩余的节点是否能够满足空间要求和副本数要求等。
+    
+## Path parameters
+
+无
+
+## Query parameters
+
+* `host_ports`
+
+    指定一个多个BE,由逗号分隔。如:`ip1:port1,ip2:port2,...`。
+
+    其中 port 为 BE 的 heartbeat port。
+
+## Request body
+
+TODO
+
+## Response
+
+返回可以被下线的节点列表
+
+```
+{
+	"msg": "OK",
+	"code": 0,
+	"data": ["192.168.10.11:9050", "192.168.10.11:9050"],
+	"count": 0
+}
+```
+    
+## Examples
+
+1. 查看指定BE节点是否可以下线
+
+    ```
+    GET /api/check_decommission?host_ports=192.168.10.11:9050,192.168.10.11:9050
+    
+    Response:
+    {
+    	"msg": "OK",
+    	"code": 0,
+    	"data": ["192.168.10.11:9050"],

Review comment:
       这里如果第一步可以拿到集群信息的话,这里填写be的ip会很方便。不然得现查。
   最起码就可以自动化到平台,勾选ip了。而不用人肉输入




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman commented on pull request #4261: [Doc][RESTfulAPI] Develop a specification document for restful api

Posted by GitBox <gi...@apache.org>.
morningman commented on pull request #4261:
URL: https://github.com/apache/incubator-doris/pull/4261#issuecomment-669218601


   > sql explain、profile是我这边的刚需。我这边做平台化目前这俩信息获取很费劲。期待考虑下comments:)
   
   No problem. This PR is only a demo to show the common structure of the response body of RESTful API.
   Almost APIs need to be enhanced to get more infomation.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org