Keywords
The following tables list the keywords used in Unlang
. These keywords
implement the "flow control" of the policies.
Flow Control Keywords
The flow control keywords allow if / then / else checks, simple looping, etc.
Keyword | Description |
---|---|
Exit early from a |
|
Match inside of a |
|
catch an error from a previous "try" |
|
Do something when an |
|
Check for condition when a previous |
|
Loop over a list of attributes. |
|
Check for a condition, and execute a sub-policy if it matches. |
|
Immediately stop processing a section. |
|
Check for multiple values. |
|
Group operations into a transaction which can be reverted on failure. |
|
try / catch blocks |
Attribute Editing Keywords
The attribute editing keywords allow policies to add, delete, and modify attributes in any list or packet.
Keyword | Description |
---|---|
Map database fields to server attributes. |
|
Creating, modifying, and deleting attributes. |
|
DEPRECATED - v3 compatible attribute editing. |
Grouping Keywords
The grouping keywords allow policies to be organized into groups, including fail-over, load-balancing, limits, etc.
Keyword | Description |
---|---|
Group a series of statements. |
|
Define a load balancing group without fail-over. |
|
Limit the number of requests in a section |
|
Define a redundant group with fail-over. |
|
Define a redundant group with fail-over and load balancing. |
|
Enforce a timeout for processing a section |
Parent-Child Keywords
The parent-child keywords allow for creation of parent-child relationships between requests.
For example, it is possible to create a child request, edit its
attributes, and then proxy that packet to an external destination.
This process must be specified manually, unlike in version 3, the
child was created automatically when the proxy
list was used.
The benefit of these new keywords is that it is now possible to
control when child requests are created. It is also possible to
control whether or not the parent waits for the child to finish, or
operates independently of the child. It is also finally possible to
have multiple child requests via the parallel
keyword.
These new keywords can unfortunately make some simple configurations more complex than they would have been in version 3. The trade-off is that many complex configurations now become trivial, where they were impossible to create before.
Keyword | Description |
---|---|
Call one virtual server from another |
|
Check if the request is from a parent |
|
Detach a child from a parent |
|
Create multiple parallel child requests |
|
Create a child request |
Module Keywords
The module keywords refer pre-packaged libraries that implement
specific functionality, such as connecting to SQL, LDAP, etc. The
name used here is not the literal string module
. Instead, it is the
name of an instance of a pre-packaged module such as sql
, or ldap
, or
eap
.
The documentation below describes how to reference modules. That is,
how to use sql
, etc. in the policies. Please see the
module configuration and the
configuring modules howto
pages for information on configuring and using the modules.
Keyword | Description |
---|---|
Execute a named module, e.g., |
|
Execute a particular method of a named module, e.g., |
|
Built-in modules, e.g., |