Mapper functions
StackState Self-hosted v4.5.x
Mapper Function is defined by a groovy script and input parameters that groovy script requires. The goal of a Mapper Function is to process topology data from an external system and prepare parameters for use by a template function.
Mapper function
There are two specific Mapper Function parameters:
  • ExtTopoComponent / ExtTopoRelation - these are the required system parameters. Every Mapper Function must define one of these. They are used internally by StackState and cannot be changed using the API. They indicate the type of element - component or relation - that the Mapper Function supports.
  • TemplateLambda - this is an optional parameter that specifies which template functions must be used with the Mapper Function.
An example of a simple Mapper Function:
1
def params = [
2
'name': element.getExternalId(),
3
'description': element.getData().getString("description").get()
4
];
5
6
context.runTemplate(template, params)
Copied!
Last modified 20d ago
Copy link