Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.

Creating a project with bare repo via API

I'm trying to automate our looker project deployment procedure. Now I'm stuck at the creating a project with bare repo via API. 

Database connection creation(OK):

curl -s -X POST https://localhost:19999/api/4.0/connections -H Authorization: token $MY_TOKEN -H Content-Type: application/json -d {"name": "cname", "host": null, "database": "dbname", "dialect_name": "oracle", "username": "dwh_looker", "file_type": "json"}

Switch to dev mode(OK):

curl -k -X PATCH "https://localhost:19999/api/4.0/session" \
-H "Authorization: token $MY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"workspace_id": "dev"}'

Create project(OK):

curl -k -X POST "https://localhost:19999/api/4.0/projects" \
-H "Authorization: token $MY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "projectName"}'

Link project with bare repo(NOK):

curl -k -X PATCH "https://localhost:19999/api/4.0/projects/ei_bi_looker" \
-H "Authorization: token $MY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"git_remote_url": "../../bare_models/projectName.git",
"uses_git": true
}'

{"message":"Validation Failed","errors":[{"field":"git_remote_url","code":"invalid","message":"Invalid git_remote_url.","documentation_url":"https://cloud.google.com/looker/docs/r/err/4.0/422/patch/projects/:project_id"}],"documentation_url":"https://cloud.google.com/looker/docs/r/err/4.0/422/patch/projects/:project_id"}

Any comments, help or code samples are much appreciated!

 

 

0 1 128
1 REPLY 1

Looker at the API Explorer, it tells me:

To set up a Looker project with a git repository residing on the Looker server (a 'bare' git repo):

  1. Call update_session to select the 'dev' workspace.
  2. Call update_project setting git_remote_url to null and git_service_name to "bare".