Template engine for ioFog YAML Specification
Variables, filter and template "queries" can now be used as values for any field in your deployment YAMLs (And therefore, any value of the JSON body of most PUT/POST/PATCH Controller REST API requests).
Those variables allow you to reference the same document, or any resource preexisting on your Controller, adding a lot of flexibility in your deployments.
The values are interpolated (replaced) when the request is made to Controller. The variable value is a snapshot of the referenced value when the request is made. Any subsequent modification of the underlying value will NOT be repercussed.
The engine in the background is liquidjs, to see all the capabilities about filters and tags, see the documentation.
Quick capabilities overview
- Defining a variable:
{{variable-name}} - Using a filter:
{{"agent-name" | findAgent}} - Assigning a value:
{% assign agent = "agent-name" | findAgent %} - Example: Getting the host value of the agent named
zebra-1:{% assign agent = "zebra-1" | findAgent %}{{ agent.host }}
ioFog filters and values
Filters
| Name | Description | Usage | Returns |
|---|---|---|---|
| findAgent | Lookup an existing ioFog Agent, by name | "agent-name" | findAgent | An ioFog Agent, as defined by Controller API |
| findApplication | Lookup an existing ioFog Application, by name | "app-name" | findApplication | An ioFog Applicaiton, as defined by Controller REST API |
| findEdgeResource | Lookup an existing ioFog Edge Resource, by name (and version) | "resName" | findEdgeResource OR "resName" | findEdgeResource: "version" | An Edge Resource, or a list of Edge Resources, as defined by Controller REST API |