The required parameters of the API for UF Add-ins can be read out as follows: - Log in to the web interface of the LANCOM R&S Unified Firewall.
- Open the Developer Tools in your browser (usually F12) and switch to the Network tab.
- Perform desired configuration locally and record it in Dev-Tools.
- Copy payload from request with status 201.
Including the API as a variable to simplify calls to the following methods. var ufApi = config.getUfApi();
LANCOM R&S Unified Firewall configurations consist of entities and singletons. Entities: Entities are configurations where multiple entries can be made (e.g. network-connections). Singletons: A singleton is a configuration that exists only once in the Unfied firewall (e.g. device name).
ufAPI.raw: Raw API Requests are the general way how the API for UF Add-ins can be addressed. Various methods can be used to create, edit and delete configurations. Furthermore, it is possible to query configuration values. - Example:
ufAPI.raw({ method: PUT|POST|GET|DELETE , uri: URI, body: { key: value, key: value, key: value }, failOnError: true|false })
The following methods simplify RAW requests: ufAPI.lookup/ufAPI.lookupField: Various requests require the query of a UUID or a name field in the firewall configuration. The ufAPI.lookup method can be used to retrieve the UUID for required parameters (for example, Ethernet interfaces). Example: ufAPI.lookup("Entity", { key: value });
Parameters that do not have a UUID (e.g. routing table) are queried with the ufAPI.lookup.Field method. Example: ufAPI.lookupField("Singleton", { key: value });
ufAPI.createObject: The ufAPI.createObject method is used to configure entities (e.g. network connections). ufAPI.modifyObject/ufAPI.modifySettings: The ufAPI.modifyObject method can be used to edit configurations of entities (e.g. network connections). - Example:
ufAPI.modifyObject("Entity", ufAPI.lookup, { key: value, key: value, key: value });
To customize singletons (e.g. firewall device name), the ufAPI.ModifySettings method is used.
|