绑定完请刷新页面
取消
刷新

分享好友

×
取消 复制
Zeppelin 可视化模块Helium REST API
2022-06-16 14:54:59

概览

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

分享好友

分享这个小栈给你的朋友们,一起进步吧。

Helium
创建时间:2022-04-12 15:29:26
Helium
展开
订阅须知

• 所有用户可根据关注领域订阅专区或所有专区

• 付费订阅:虚拟交易,一经交易不退款;若特殊情况,可3日内客服咨询

• 专区发布评论属默认订阅所评论专区(除付费小栈外)

技术专家

查看更多
  • LCR_
    专家
戳我,来吐槽~