Skip to content

Getting Started

Dr. Strange Looker edited this page Jun 4, 2018 · 1 revision

Getting Started With Gazer

Installation

Gazer can be installed on most Linux and Mac OS computers that have Ruby and RubyGems installed. To install use the command...

gem install gazer

On some systems you may need to have root access to install gazer. In that case, use the command...

sudo gem install gazer

Once installed, verify that Gazer is running properly with the command...

gzr help

Your output should look like

$ gzr help
Commands:
  gzr connection [SUBCOMMAND]  # Commands pertaining to database connections and dialects
  gzr dashboard [SUBCOMMAND]   # Commands pertaining to dashboards
  gzr group [SUBCOMMAND]       # Commands pertaining to groups
  gzr help [COMMAND]           # Describe available commands or one specific command
  gzr look [SUBCOMMAND]        # Commands pertaining to looks
  gzr model [SUBCOMMAND]       # Commands pertaining to LookML Models
  gzr plan [SUBCOMMAND]        # Commands pertaining to plans
  gzr space [SUBCOMMAND]       # Commands pertaining to spaces
  gzr user [SUBCOMMAND]        # Commands pertaining to users
  gzr version                  # gzr version

Options:
  [--debug], [--no-debug]            # Run in debug mode
  [--host=HOST]                      # Looker Host
                                     # Default: localhost
  [--port=PORT]                      # Looker API Port
                                     # Default: 19999
  [--client-id=CLIENT_ID]            # API3 Client Id
  [--client-secret=CLIENT_SECRET]    # API3 Client Secret
  [--api-version=API_VERSION]        # Looker API Version
  [--ssl], [--no-ssl]                # Use ssl to communicate with host
                                     # Default: true
  [--verify-ssl], [--no-verify-ssl]  # Verify the SSL certificate of the host
                                     # Default: true
  [--force]                          # Overwrite objects on server
  [--su=SU]                          # After connecting, change to user_id given

Updating Gazer

The command gem update gazer can be used to update Gazer when a new version is installed.

Credentials

You need to have Looker API3 credentials in order to use Gazer. These are not your normal Looker user id and password. You can obtain API3 credentials with these instructions.

Your API3 credentials can be passed on the command line with the --client-id=... and possibly the --client-secret=... switches. If you provide a client-id but not a client-secret you will be prompted for the secret.

The easiest way to provide the credentials is to use a $HOME/.netrc file. This file in your home directory will store your client-id and client-secret. This file has the format...

machine dev.looker.example.com
  login dsagfSADFSDgdfasfsa 
  password erewaEWFSDFVfsG234w4

machine qa.looker.example.com
  login AbvasdfDSAFfgadDSFGDF
  password 35DFSDREfsdvdr4fsd

machine looker.example.com
  login fdsDSFdfgsdFdsAfsDgasd
  password 32rDFsfdsDFSASGG

The permissions on this file MUST be tightly controlled or else your credentials can leak. Gazer will not use the file if the permissions are not set to rw------- or 600. The command chmod 600 $HOME/.netrc will set the permissions properly.

Host and Port

The host is usually the same name as you use to connect to Looker through your web browser. So it you connect at https://looker.example.com then looker.example.com is the host name. To specify the host, use --host=looker.example.com on the command line. If you are using a $HOME/.netrc file for your credentials, your client-id and client-secret will be found in that file with the entry for machine looker.example.com.

The Looker API is usually available at port 19999. If this is the case, then you do not need to specify a port. If your administrators changed the port, then you will need to use --port=12345 on the command line to specify the proper port.

Other Connection Options

In almost all cases the Looker API is secured via SSL. If your administrators have disabled SSL, then you can use the --no-ssl switch to connect without SSL. It is possible for others to read the data you exchange with Looker in transit if SSL is not enabled. If you are not on a tightly controlled network then you should use SSL.

If your administrators are using a self-signed SSL certificate, you can use --no-verify-ssl to disable the validation of the certificates.

Testing the Connection

Try the following command first, using your host name.

gzr user me --host=looker.example.com

This should report back basic information about your account.