The required parameters of the API for UF Add-ins can be read out as follows:

  1. Log in to the web interface of the Unified Firewall.
  2. Open the Developer Tools in your browser (usually F12) and switch to the menu Network.
  3. Perform the desired configuration locally and record it in Developer Tools.
  4. Copy the payload from request with status 201.

API for Unified Firewall Add-ins

Including the API as a variable simplifies calls to the following methods.

var ufApi = config.getUfApi();

The configuration of a Unified Firewall consist of entities and singletons.

  • Entities: Entities are configuration parameters where multiple entries can be made (e.g. network-connections).

  • Singletons: A singleton is a configuration parameter that exists only once in the Unified firewall (e.g. device name).

API methods for Unified Firewall Add-ins

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.

  • ExampleufAPI.raw({ method: PUT|POST|GET|DELETE , uri: URI, body: { key: value, key: value, key: value }, failOnError: true|false })

Auxiliary methods:

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 (e.g. Ethernet interfaces).
    • ExampleufAPI.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).

    • ExampleufAPI.createObject("Entity", { key: value, key: value, key: value });

ufAPI.modifyObject/ufAPI.modifySettings:

  • The ufAPI.modifyObject method can be used to edit configurations of entities (e.g. network connections).
    • ExampleufAPI.modifyObject("Entity", ufAPI.lookup, { key: value, key: value, key: value })
  • To customize singletons (e.g. firewall device name), the ufAPI.ModifySettings method is used.
    • ExampleufAPI.modifySettings("Singleton", { key: value });