Looker API to generate lookml file and view from database

Hi,

I want to know if there is any API that can create a project, including generating files for views and models based on a database schema, similar to what is available in the UI. I noticed that in the API Explorer 4.0, it only seems to allow creating a project with the create_project endpoint. Is there an endpoint for generating LookML from a database schema?

Thanks!

0 6 615
6 REPLIES 6

Hi there - if I follow, you should be able to create all items for a project from the LookML model endpoints. 

I have tried using the endpoint to create a LookML model, but it only creates a model without generating the files and views automatically from the BigQuery connection. Here is the JSON request I used:

 
{ "allowed_db_connection_names": [], "name": "", "project_name": "", "unlimited_db_connections": false }

Is there something I'm missing in the request? I am using the Looker API in my Spring Boot Java application.

Thank you!

Also using pylookml, you might be able to achieve the same thing: https://pylookml.readthedocs.io/en/latest/examples.html 

@Amanda-Google , I'm experiencing the same issue that @Herkus  mentioned. Is there a way to automatically generate models and views via an API? Or is there a method to directly create models and views with content?

@Herkus Are you able to solve the problem?

Hi there -

Yes you can't do it via the API but you can use pylookml to do so: https://pylookml.readthedocs.io/en/latest/examples.html 

This answer by another community poster has additional information as well: https://www.googlecloudcommunity.com/gc/Modeling/Automatically-create-Lookml-Views-Model-Explores/m-... 

@Amanda-Google My tech stack is in Go lang. Is there any library available in Go lang to auto generate Views and Models?