A Configuration Template consists of a choice of Configuration Units. Each Configuration Unit has a number of input parameters that have to be filled with values or references.
The types of these input parameters are defined in the Configuration Unit, which can be queried using the REST endpoints /rest/cc/v1/confunittypes
as documented in https://campus.barracuda.com/product/nextgenfirewallf/api.
The Configuration Template defines how the inputs of the Configuration Units are filled. The following options are available:
Static values are defined in the Configuration Template. A static value of a certain input parameter type can be defined and is used for every instance based on the Configuration Template.
Configuration Templates parameter references, as defined in the template itself.
Configuration Template variable references: Variables can be defined in every Configuration Template. The idea of variables is to allow the user to define expressions (formulas) that derive values from the Configuration Template parameters.
Configuration Templates Variables
There are several operators and functions available to form variable expressions.
Binary Operators
Operator | Meaning |
---|---|
+ | Arithmetic plus |
- | Arithmetic minus |
* | Arithmetic multiplication |
/ | Arithmetic division |
% | Arithmetic modulo |
| | Arithmetic OR |
& | Bitwise AND |
|| | Logical OR |
&& | Logical AND |
> | Larger |
< | Smaller |
>= | Larger or equal |
<= | Smaller or equal |
== | Equal |
!= | Not equal |
++ | Increment by one |
-- | Decrement by one |
[ ] | Dereference |
! | Logical not |
~ | Bitwise inverse |
String Operators
Operator Example | Description |
---|---|
string + string | 'Adding' strings is done by concatenating multiple strings to a single one. |
Functions
Function Call | Description |
---|---|
| Convert a string to an integer. |
| Convert an integer to a string. |
| Compare two strings. |
| Compare two strings over a given length. |
| "Adds" the "partial" values of two IPv4 addresses. |
| Applies the OR operator to two IPv4 addresses. |
| Applies the digital, bitwise AND operator to the partials of an IPv4 address. |
| Applies the digital, bitwise AND operator to the partials of an IPv6 address. |
| Applies the digital, bitwise AND operator to the partials of an IPv4 address. |
| Calculates the IP address from a given CIDR network address. |
| Calculates the size of a network from a given CIDR network address. |
| Calculates the mask from a given IPv4 network address. |
| Calculates the mask from a given IPv6 network address. |
| Calculates whether an IPv4 address matches a certain IPv4 network address. |
| Calculates whether an IPv6 address matches a certain IPv6 network address. |
| Compares two given IPv4 addresses. If the addresses are equal, the function returns 0. Otherwise the function returns a value <> 0. |
| Compares two given IPv6 addresses. If the addresses are equal, the function returns 0. Otherwise the function returns a value <> 0. |
| Get the current date from the system using the format "dd mm yyyy". |
| Get the current time from the system using the format "hh mm ss". |
| Returns the time in Unix seconds. |
| Returns a randomly generated string with the length of <size>. |
| Returns the current date using the format "yyyy-mm-dd". |
Examples in TDL
TDL Script Content | Explanation |
---|---|
| Concatenates a static and a dynamic string set in a parameter. |
| Calculates an IP address based on an integer parameter and a static base-IP. |