Configuration¶
Laika reads reports definitions from a json file which must have this structure:
{
"include": [...],
"profiles": [...],
"connections": [...],
"reports": [...]
}
The configuration can be separated in multiple files. In this case there
must be a base configuration file that will have to include the other
files via "include"
field with a list of paths:
"include": [
"another_config.json",
"/some/config.json"
]
These files will be included in the configuration. The only constraint
is they can only have reports
, connections
and profiles
fields defined.
You can check the example configuration file for more information.
Profiles¶
Profiles are all kind of credentials used for accessing external APIs (like Google Drive). You must specify a name and a path to credentials for each profile. For example:
{
"name": "my_drive",
"credentials": "secret.json"
}
credentials
is always a path to a json file, but it’s format depends
on each type of report or result. For example email credentials are
defined like this:
{
"username": "me@gmail.com",
"password": "secret"
}
Connections¶
Connections are used to access data sources or destinations. They must have a name and a type, and a set of specific fields. Currently supported connections are described below.
Postgres¶
PostgreSQL database connection is defined like this:
{
"name": "local",
"type": "postgre",
"constring": "postgresql://user@localhost:5432/database"
}
Email¶
Example of a smtp connection:
{
"name": "gmail_smtp",
"type": "email",
"host": "smtp.gmail.com",
"port": 587
}
Global configuration¶
In addition to reports, connections and profiles you can define this configurations:
- timezone: string of timezone to use. By default all the dates will be generated in UTC. You can overwrite it for each particular report.
- pwd: directory, to which laika will change before executing reports. In this directory it will, for example, read query files, or save file results (if relative path is specified).