drill 学习 十 drill rest api

drill 提供了web ui 以及rest api 我们基于rest api 可以开发相关的业务系统(不需要依赖jdbc 驱动)
以下是简单梳理rest api 的使用(关于暴露的系统ui api 没有说明)

查询

api 地址:POST /query.json
请求提内容

 
{
      "queryType" : "SQL",
      "query" : "<Drill query>",
      "autoLimit" : "<rows returned>"
}

profile

  • profile 信息查看
    api 地址:GET /profiles.json
  • 获取指定查询的信息
    api 地址: GET /profiles/{queryid}.json
  • 取消指定查询
    api 地址: GET /profiles/cancel/{queryid}

存储插件

  • 获取存储配置列表
    api 地址: GET /storage.json
  • 获取指定存储信息的配置
    api 地址: GET /storage/{name}.json
  • 启用禁用配置存储
    api 地址: GET /storage/{name}/enable/{val} val 为true,false
  • 创建存储配置
    api 地址: POST /storage/{name}.json
  • 删除存储配置
    api 地址: DELETE /storage/{name}.json

metrics

  • 获取集群信息
    api 地址: GET /cluster.json
  • 获取drill 状态
    api 地址: /status
  • 获取当前内存信息
    api 地址: GET /status/
  • 线程信息获取
    api 地址: GET /status/threads
  • 系统配置信息获取
    api 地址: GET /options.json

api 请求验证

从1.18 开始支持的

  • basic 认证
    配置: drill-override.conf 文件
 
http: {
    enabled: true,
    auth: {
        # Http Auth mechanisms to configure. If not provided but user.auth is enabled
        # then default value is ["FORM"].
        mechanisms: ["BASIC", "FORM"]
    }
}
  • 表单认证
    配置: drill-override.conf 文件
 
http: {
    enabled: true,
    auth: {
        # Http Auth mechanisms to configure. If not provided but user.auth is enabled
        # then default value is ["FORM"].
        mechanisms: ["BASIC", "FORM"]
    }
} 

参考资料

https://drill.apache.org/docs/rest-api-introduction/

posted on 2020-10-06 15:04  荣锋亮  阅读(288)  评论(0编辑  收藏  举报

导航