All project JSON files are in a template defined by Jsonnet files. Jsonnet builds on JSON syntax, meaning that valid JSON is also valid Jsonnet. In addition, Jsonnet offers more language constructs, such as conditions, cycles, and variables.
In addition to the standard Jsonnet functions, the following functions are also available:
ConfigId(string configId) string
my-config
.5038695485
.ConfigId
function is most commonly used in the template manifest, but it can also be applied in any Jsonnet file.For example, you can compose a bucket ID containing a configuration ID as follows:
{
storage: {
input: {
tables: [
{source: "in.c-keboola-ex-aws-s3-" + ConfigId("config-with-output-mapping") + ".table"},
],
},
},
}
ConfigRowId(string rowId) string
ConfigId
, but for configuration rows.Input(string inputId) string
false
:
0
for int
, false
for bool
, etc.Example:
{
parameters: {
api: {
baseUrl: Input("base-url"),
},
},
}
InputIsAvailable(string inputId) string
true
if the input has been filled in by the user and false
if the step has been skipped or showIf = false
.InstanceId() string
V1StGXR8IZ5jdHi6BAmyT
InstanceIdShort() string
V1StGXR8
ComponentIsAvailable(string componentId) bool
true
if the component is available; otherwise, it returns false
.SnowflakeWriterComponentId() string
componentId
of the Snowflake writer.
keboola.wr-db-snowflake
for AWS stacks.keboola.wr-snowflake-blob-storage
for Azure stacks.keboola.wr-db-snowflake-gcs
for GCP stacks and the BigQuery backend.keboola.wr-db-snowflake-gcs-s3
for GCP stacks and the Snowflake backend.HasProjectBackend(backend string) bool
true
if the backend is available; otherwise, it returns false
.RandomID() string