简体   繁体   English

Apache 超集 Rest API 获取图表截图

[英]Apache Superset Rest API get chart screenshot

I want to get a screenshot of the chart on Superset via Rest API, but I can't do that.我想通过 Rest API 获取 Superset 图表的屏幕截图,但我做不到。

When I just run queries, everything goes well, I get good responses.当我只是运行查询时,一切都很顺利,我得到了很好的回应。 But when I try to get a screenshot through Get using something like this:但是,当我尝试通过 Get 获取屏幕截图时,使用如下内容:

curl -X 'GET' \
  'http://localhost:8088/api/v1/chart/132/cache_screenshot/?q=%7B%0A%20%20%22force%22%3A%20true%2C%0A%20%20%22thumb_size%22%3A%20%5B%0A%20%20%20%201000%0A%20%20%5D%2C%0A%20%20%22window_size%22%3A%20%5B%0A%20%20%20%201000%0A%20%20%5D%0A%7D' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MzkwNTAxNTcsIm5iZiI6MTYzOTA1MDE1NywianRpIjoiY2MyMjI5ZDQtNmIwMi00ZTRhLTg1NmItYWQ5MzcyNmFkOWM2IiwiZXhwIjoxNjM5MDUxMDU3LCJpZGVudGl0eSI6MSwiZnJlc2giOnRydWUsInR5cGUiOiJhY2Nlc3MifQ.SlLRk-BHoTzI3zEEzpl4GVGpUFQRlStT4-Sondnz-pg'

I'm getting error 404:我收到错误 404:

{
  "message": "Not found"
}

Also, I can't find good documentation about Apache Superset Rest API.另外,我找不到关于 Apache Superset Rest API 的好的文档。 Could anybody help my with this issue?有人可以帮我解决这个问题吗?

This is due to the improper configuration of the webdriver.这是由于 webdriver 配置不正确造成的。 You should check the logs of superset worker.您应该检查超集工作人员的日志。 For me the error was:对我来说,错误是:

selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.

In order to install, you can have a look at the thread: superset screenshot issue为了安装,你可以看看线程: superset screenshot issue

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM