Gazer Upgrades

Gazer has recently gone through a number of upgrades.

Of course, the first is that it has been upgraded to use API 4.0. As part of that update, the "space" object was renamed as "folder". Gazer has been updated to reflect that.

Second, a `--trim` switch has been added to many of the `gzr OBJECT cat` commands, like `gzr dashboard cat` and `gzr look cat`. The `--trim` switch doesn't return the full sized json object, but strips out most of the fields that are read only and not needed to import the object later. That results in smaller objects. If you want to track changes to these objects, they are easier to diff against older versions and won't generate so much useless noise in the diff process.

Third, a new login system has been implemented. Gazer normally logs in, performs one action, then logs out. The command `gzr session login` will write a token to a file in your home directory that is good for the next hour. Any subsequent commands with the `--token-file` switch will use that token and that login session. The command `gzr session update dev --token-file` will switch that persistent session to dev mode, which is required for certain commands pertaining to projects, and will evaluate queries against the version of LookML in development branches of git rather than the production branch.

Fourth, the new commands for managing connections are now available. Namely `gzr connection import` and `gzr connection test` have been added to create and test connections. Of course this also means there is a `gzr connection cat` and `gzr connection rm` as well.

Fifth, project management commands have been added. `gzr project import` will create a project. `gzr project deploy_key` will get the deploy key which can be added to the git service. `gzr project update` will modify the project, allowing the git configuration to be added after the deploy key has been registered with the git service. `gzr project branch` will list the active branch and all available branches in dev mode. `gzr project checkout` will checkout a branch for the user's dev mode. `gzr project deploy` will deploy dev mode branch to production. These commands require dev mode, so need to be run with a persistent login token and after the `gzr session update` command has been run.

Sixth, model management is added. `gzr model cat` will retrieve info about a model, and `gzr model import` will create or update a model config. The key part of this is that each model must be authorized to access the appropriate data sources.

The end result of these updates is that a script can be written that completely sets up a new project and data source in an otherwise empty Looker instance without any manual intervention. An example of such a script is at https://github.com/looker-open-source/gzr/blob/main/examples/add_project.sh.

Seventh, a set of `gzr alert` commands have been added to manage alerts. Alerts are included in `gzr dashboard cat` and `gzr dashboard import`. Alerts can be listed and read from the command line, and thresholds can be changed.

Eighth, commands to manage permissions sets `gzr permission set ...` have been added, as well as `gzr permission tree`. Commands to manage model sets with `gzr model set ...` are added as well. Now roles can be created with an associated permission set and model set, then users and groups added to said roles, all from the command line or a script.

More features may be added in the 3rd and 4th quarters of 2023. Please don't hesitate to make feature requests at https://github.com/looker-open-source/gzr/issues.

1 2 433
2 REPLIES 2

@Dr__Strangelove regarding alerts on dashboard cat. Why is this included by default with no flag to not pull them. I cant think of a reason as to why the logic differs to schedules. If you want alerts you would want schedules and if not want one you wouldn't want either....however you can only turn off schedule on db cat and not alerts?

Hello, I tried to export 'dashboard' from a folder (1093) in our looker instance,

see below, I get error, please help

C:\Users\username>gzr space export 1093 --host myhosturl: --no-verify-ssl --zip demo.zip
Error querying query(12345)
(GET https://myhosturl:19999/api/4.0/queries/12345 : 404 - Not found
// See: https://cloud.google.com/looker/docs/r/err/4.0/404/get/queries/:query_id 
// And: https://marketplace-api.looker.com/errorcodes/404.md )
I find there is a zip file generated in my local folder however, there is No dashboard json file, I only see some Look json files and one folder json file,
by the way, when I run "gzr user me" with the same host below, it is working fine.
Please advise

By the way, currently Gazer version is gazer-0.3.14
Ruby version is ruby 3.2.3 (2024-01-18 revision 52bb2ac0a6) [x64-mingw-ucrt]

I find this command 'gzr dashboard import' works on some dashboards and fails on the others.