All project JSON files in a template are 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 primarily used in the template manifest but can also be applied in any Jsonnet file.Example:
Composing a bucket ID containing a configuration ID:
{
storage: {
input: {
tables: [
{source: "in.c-keboola-ex-aws-s3-" + ConfigId("config-with-output-mapping") + ".table"},
],
},
},
}
ConfigRowId(string rowId) string
ConfigId
, but applies to 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 by the user.false
if the step was skipped or showIf = false
.InstanceId() string
V1StGXR8IZ5jdHi6BAmyT
InstanceIdShort() string
V1StGXR8
ComponentIsAvailable(string componentId) bool
true
if the component is available, otherwise returns false
.SnowflakeWriterComponentId() string
keboola.wr-db-snowflake
keboola.wr-snowflake-blob-storage
keboola.wr-db-snowflake-gcs
keboola.wr-db-snowflake-gcs-s3
inputs.jsonnet
because project backends are unknown before template loading.HasProjectBackend(backend string) bool
true
if the specified backend is available, otherwise returns false
.RandomID() string