Zeppelin 可视化模块Helium REST API

Zeppelin 可视化模块Helium REST API

概览

Apache Zeppelin 提供了多个REST APIs用于远程功能交互操作。 所有的REST APIs 都通过 endpoint http://[zeppelin-server]:[zeppelin-port]/api 进行操作。注意,Apache Zeppelin 的REST APIs 都接受和返回 JSON 对象, 建议安装 JSON viewers, 比如 JSONView

如果需要其它的REST API, 请提交建议或发邮件: file an issue or send us an email.

Helium REST API 清单

列出所有可用的 helium packages

DescriptionThis GET method returns all the available helium packages in configured registries.
URLhttp://[zeppelin-server]:[zeppelin-port]/api/helium/all
Success code200
Fail code500
Sample JSON response
{
  "status": "OK",
  "message": "",
  "body": {
    "zeppelin.clock": [
      {
        "registry": "local",
        "pkg": {
          "type": "APPLICATION",
          "name": "zeppelin.clock",
          "description": "Clock (example)",
          "artifact": "zeppelin-examples\/zeppelin-example-clock\/target\/zeppelin-example-clock-0.7.0-SNAPSHOT.jar",
          "className": "org.apache.zeppelin.example.app.clock.Clock",
          "resources": [
            [
              ":java.util.Date"
            ]
          ],
          "icon": "icon"
        },
        "enabled": false
      }
    ],
    "zeppelin-bubblechart": [
      {
        "registry": "local",
        "pkg": {
          "type": "VISUALIZATION",
          "name": "zeppelin-bubblechart",
          "description": "Animated bubble chart",
          "artifact": ".\/..\/helium\/zeppelin-bubble",
          "icon": "icon"
        },
        "enabled": true
      },
      {
        "registry": "local",
        "pkg": {
          "type": "VISUALIZATION",
          "name": "zeppelin-bubblechart",
          "description": "Animated bubble chart",
          "artifact": "zeppelin-bubblechart@0.0.2",
          "icon": "icon"
        },
        "enabled": false
      }
    ],
    "zeppelin_horizontalbar": [
      {
        "registry": "local",
        "pkg": {
          "type": "VISUALIZATION",
          "name": "zeppelin_horizontalbar",
          "description": "Horizontal Bar chart (example)",
          "artifact": ".\/zeppelin-examples\/zeppelin-example-horizontalbar",
          "icon": "icon"
        },
        "enabled": true
      }
    ]
  }
}

 

建议的 Helium 应用

DescriptionThis GET method returns suggested helium application for the paragraph.
URLhttp://[zeppelin-server]:[zeppelin-port]/api/helium/suggest/[Note ID]/[Paragraph ID]
Success code200
Fail code404 on note or paragraph not exists
500
Sample JSON response
{
  "status": "OK",
  "message": "",
  "body": {
    "available": [
      {
        "registry": "local",
        "pkg": {
          "type": "APPLICATION",
          "name": "zeppelin.clock",
          "description": "Clock (example)",
          "artifact": "zeppelin-examples\/zeppelin-example-clock\/target\/zeppelin-example-clock-0.7.0-SNAPSHOT.jar",
          "className": "org.apache.zeppelin.example.app.clock.Clock",
          "resources": [
            [
              ":java.util.Date"
            ]
          ],
          "icon": "icon"
        },
        "enabled": true
      }
    ]
  }
}

 

载入 helium 应用到 paragraph

 

DescriptionThis GET method returns a helium Application id on success.
URLhttp://[zeppelin-server]:[zeppelin-port]/api/helium/load/[Note ID]/[Paragraph ID]
Success code200
Fail code404 on note or paragraph not exists
500 for any other errors
Sample JSON response
{
  "status": "OK",
  "message": "",
  "body": "app2C5FYRZ1E-20170108-0404492068241472zeppelin_clock"
}

 

载入打包好的可视化 script

DescriptionThis GET method returns bundled helium visualization javascript. When refresh=true (optional) is provided, Zeppelin rebuild bundle. otherwise, provided from cache
URLhttp://[zeppelin-server]:[zeppelin-port]/api/helium/visualizations/load[?refresh=true]
Success code200 reponse body is executable javascript
Fail code200 reponse body is error message string starts with ERROR:

 

启用 package

DescriptionThis POST method enables a helium package. Needs artifact name in input payload
URLhttp://[zeppelin-server]:[zeppelin-port]/api/helium/enable/[Package Name]
Success code200
Fail code500
Sample input
zeppelin-examples/zeppelin-example-clock/target/zeppelin-example-clock-0.7.0-SNAPSHOT.jar
Sample JSON response
{"status":"OK"}

 

禁用 package

DescriptionThis POST method disables a helium package.
URLhttp://[zeppelin-server]:[zeppelin-port]/api/helium/disable/[Package Name]
Success code200
Fail code500
Sample JSON response{"status":"OK"}

 

可到可视化显示顺序

DescriptionThis GET method returns display order of enabled visualization packages.
URLhttp://[zeppelin-server]:[zeppelin-port]/api/helium/visualizationOrder
Success code200
Fail code500
Sample JSON response{"status":"OK","body":["zeppelin_horizontalbar","zeppelin-bubblechart"]}

 

设置可视化显示顺序

DescriptionThis POST method sets visualization packages display order.
URLhttp://[zeppelin-server]:[zeppelin-port]/api/helium/visualizationOrder
Success code200
Fail code500
Sample JSON input["zeppelin-bubblechart", "zeppelin_horizontalbar"]
Sample JSON response{"status":"OK"}

转载于:https://my.oschina.net/u/2306127/blog/894685

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值