概览
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"} |