How to get a template file
StackState Self-hosted v5.1.x
Export the StackState configuration
You can get a complete dump of all configuration using the StackState CLI:
sts settings describe --file <PATH_TO_FILE.stj>From StackState v5.0, the old sts CLI has been renamed to stac and there is a new sts CLI. The command(s) provided here are for use with the new sts CLI.
stac graph export > <PATH_TO_FILE.stj>β οΈ From StackState v5.0, the old sts CLI is called stac. The old CLI is now deprecated.
The new sts CLI replaces the stac CLI. It's advised to install the new sts CLI and upgrade any installed instance of the old sts CLI to stac. For details see:
Follow the preparation steps below to prepare the .stj file, that has only configuration nodes pertaining to your StackPack.
If all of your configuration nodes already have been assigned to the right namespace you can get all the nodes of your StackPack using the command:
sts settings describe --namespace <NAMESPACE> --file <PATH_TO_FILE.stj>From StackState v5.0, the old sts CLI has been renamed to stac and there is a new sts CLI. The command(s) provided here are for use with the new sts CLI.
stac graph export --namespace <namespace> > <PATH_TO_FILE.stj>β οΈ From StackState v5.0, the old sts CLI is called stac. The old CLI is now deprecated.
The new sts CLI replaces the stac CLI. It's advised to install the new sts CLI and upgrade any installed instance of the old sts CLI to stac. For details see:
Prepare the template file
A .stj file has a number of configuration nodes. Each of the configuration nodes represents a configuration item in StackState, for example Layer, Domain and Environment. This file has all the configuration of your StackState instance, which means you have to take out configuration nodes that are unnecessary for your StackPack. Take the steps below to prepare your template file:
Remove all configuration nodes that are owned by another StackPack. They all have a field called
ownedBy.Items that are extended from the
Custom SynchronizationStackPack, will have their urnidentifierfield with the following structure:urn:stackpack:autosync:{type_name}:{object_name}.StackState uses an urn-based identifiers, you can go ahead and define an urn for each of your configuration objects.
Typical
identifierpattern that you can find across our StackPacks configuration is:urn:stackpack:{stackpack_name}:{type_name}:{object_name}For StackPacks that can have multiple instances, the identifier has a slightly different pattern:
urn:stackpack:{stackpack_name}:instance:{{instanceId}}:{type_name}:{object_name}where{{instanceId}}is uniquely generated for every instance of the StackPack.
The only way to add/modify the identifiers is the manual edit of the configuration file. This option will be available also through the UI starting from the 1.15 release.
Last updated