StackState Template Json (STJ)

All configuration of StackState is described using StackState Templated Json.

This page describes StackState version 4.1.

The StackState 4.1 version range is End of Life (EOL) and no longer supported. We encourage customers still running the 4.1 version range to upgrade to a more recent release.

Go to the documentation for the latest StackState release.

Templates are used to convert raw synchronization data to components. Templates are defined in JSON extended with support for parameters, loops and conditions.

Handlebars syntax

StackState template files are using handlebars - a content that is placed between double curly brackets {{ some content }}. Below example shows a few handlebars used by a component template:

[{
  "_type": "Component",
  "checks": [],
  "streams": [],
  "labels": [],
  "name": "{{ name }}",
  "description": "{{ description }}",
  "type" : {{ componentTypeId }},
  "layer": {{ layerId }},
  "domain": {{ domainId }},
  "environments": [{{ environmentId }}]
}]

StackState extends on that concept and allows to include different types of content within handlebars inside .stj files:

  • you can include a script (Groovy): {{ include "path/to/script.groovy" }}

  • you can include an icon: {{ include "path/to/icon.png" "base64" }}

  • you can include a template: {{ include "path/to/template.handlebars" }}

Component and Relation templates

Please find more information on the Component and Relation templates page.

Last updated