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, 好比 JSONViewjavascript

若是須要其它的REST API, 請提交建議或發郵件: file an issue or send us an email.html

Helium REST API 清單

列出全部可用的 helium packages

Description This GET method returns all the available helium packages in configured registries.
URL http://[zeppelin-server]:[zeppelin-port]/api/helium/all
Success code 200
Fail code 500
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 應用

Description This GET method returns suggested helium application for the paragraph.
URL http://[zeppelin-server]:[zeppelin-port]/api/helium/suggest/[Note ID]/[Paragraph ID]
Success code 200
Fail code 404 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

 

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

 

載入打包好的可視化 script

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

 

啓用 package

Description This POST method enables a helium package. Needs artifact name in input payload
URL http://[zeppelin-server]:[zeppelin-port]/api/helium/enable/[Package Name]
Success code 200
Fail code 500
Sample input
zeppelin-examples/zeppelin-example-clock/target/zeppelin-example-clock-0.7.0-SNAPSHOT.jar
Sample JSON response
{"status":"OK"}

 

禁用 package

Description This POST method disables a helium package.
URL http://[zeppelin-server]:[zeppelin-port]/api/helium/disable/[Package Name]
Success code 200
Fail code 500
Sample JSON response {"status":"OK"}

 

可到可視化顯示順序

Description This GET method returns display order of enabled visualization packages.
URL http://[zeppelin-server]:[zeppelin-port]/api/helium/visualizationOrder
Success code 200
Fail code 500
Sample JSON response {"status":"OK","body":["zeppelin_horizontalbar","zeppelin-bubblechart"]}

 

設置可視化顯示順序

Description This POST method sets visualization packages display order.
URL http://[zeppelin-server]:[zeppelin-port]/api/helium/visualizationOrder
Success code 200
Fail code 500
Sample JSON input ["zeppelin-bubblechart", "zeppelin_horizontalbar"]
Sample JSON response {"status":"OK"}
相關文章
相關標籤/搜索