Hi,
in the API documentation it says that for the import lookl dashboard request (i.e. POST/dashboards/{lookml_dashboard_id}/import/{space_id}) a "lookml_dashboard_id" is required.
What exactly should this lookml_dashboard_id look like?
The approach mentioned here does not work: https://www.googlecloudcommunity.com/gc/Technical-Tips-Tricks/How-can-I-find-the-id-of-a-LookML-dash...
An example of a correct post-request would be helpful.
(Also the option to import lookml-dashboards via the GUI is no longer possible, since the "lookml-dashboard-folder" is no linger visible).
Solved! Go to Solution.
Is the dashboard included in the model file?
Does the space with the id "123" definitely exist (check via https://developers.looker.com/api/explorer/4.0/methods/Folder/all_folders?s=folder)?
Hi
the lookml_dashboard_id is typically a string defined by model_name::dashboard_name.
A sample python snippet:
from looker_sdk import models as mdls
response = sdk.import_lookml_dashboard(
lookml_dashboard_id="model_name::lookml_dashboard_name",
space_id="216",
body=mdls.WriteDashboard(
hidden=false,
alert_sync_with_dashboard_filter_enabled=false,
crossfilter_enabled=false,
deleted=false,
enable_viz_full_screen=false,
filters_bar_collapsed=false,
filters_location_top=false,
show_filters_bar=false,
show_title=false,
appearance=mdls.DashboardAppearance(
page_side_margins=0,
tile_space_between=0,
tile_shadow=false
)
))
Thanks for the response - however as mentioned in the original inquiry this approach does not seem to work.
I either get the errore message
"Object of type DashboardAppearance is not JSON serializable"
or, if I leave out the paramter "appearance"
"Looker is unavailable"
however I can for example download data from explores via the API...
Could it be that the code snippet does not work for API Version 4.0?
For testing puposes I created a dashboard file "test_dashboard" containing the lookml_dashbord "test", i.e.
---
- dashboard: test
title: Test
It only contains a text-tile.
And I want to import it to folder 123
Assume model_name = my_model
Now, when I understood it correctly, the response should be
response = sdk.import_lookml_dashboard(
lookml_dashboard_id="my_model::test",
space_id="123",
body=mdls.WriteDashboard(
hidden=false,
alert_sync_with_dashboard_filter_enabled=false,
crossfilter_enabled=false,
deleted=false,
enable_viz_full_screen=false,
filters_bar_collapsed=false,
filters_location_top=false,
show_filters_bar=false,
show_title=false,
appearance=mdls.DashboardAppearance(
page_side_margins=0,
tile_space_between=0,
tile_shadow=false
)
))
however this leads to the first mentioned error message.
Do you have the possibility of installing the API Explorer extension on your instance or using the Interactive Reference (Run It on the right hand side) to rule out any python related issues first?
Yes, I do.
Always run into a 404.
Is the dashboard included in the model file?
Does the space with the id "123" definitely exist (check via https://developers.looker.com/api/explorer/4.0/methods/Folder/all_folders?s=folder)?
The include-statement in the model-file was commented out... This could have been much easier. Thanks for your support and patience!
Wicked, glad it works no!