Skip to main content
Presets are rules that assign configuration or provision scripts to devices based on a precondition filter, an optional schedule, and optional TR-069 event triggers. When a device session starts, GenieACS evaluates all presets whose precondition matches the device and applies their configurations.

Create or update a preset

PUT /presets/<preset_name>
Creates a new preset or replaces an existing one with the same name.
preset_name
string
required
A unique name for the preset.
Request body: JSON object representing the preset. Response: 200 OK on success. Example — set a 5-minute inform interval for all devices tagged “test”:
{
  "weight": 0,
  "precondition": "{\"_tags\": \"test\"}",
  "configurations": [
    {
      "type": "value",
      "name": "InternetGatewayDevice.ManagementServer.PeriodicInformEnable",
      "value": "true"
    },
    {
      "type": "value",
      "name": "InternetGatewayDevice.ManagementServer.PeriodicInformInterval",
      "value": "300"
    }
  ]
}
curl -i 'http://localhost:7557/presets/inform' \
-X PUT \
--data '{"weight": 0, "precondition": "{\"_tags\": \"test\"}", "configurations": [{"type": "value", "name": "InternetGatewayDevice.ManagementServer.PeriodicInformEnable", "value": "true"}, {"type": "value", "name": "InternetGatewayDevice.ManagementServer.PeriodicInformInterval", "value": "300"}]}'

Delete a preset

DELETE /presets/<preset_name>
preset_name
string
required
The name of the preset to delete.
curl -i 'http://localhost:7557/presets/inform' -X DELETE

List presets

GET /presets/
Returns all presets as a JSON array.
curl 'http://localhost:7557/presets/'

Preset object fields

weight
number
required
Integer controlling evaluation priority. Presets with lower weight values are applied first.
precondition
string
required
A JSON-encoded string containing a MongoDB-style filter that determines which devices the preset applies to. The value is a string (not an inline object) so it must be double-encoded.Examples:
  • "{\"param\": \"value\"}" — match devices where param equals value
  • "{\"_tags\": \"test\"}" — match devices with the “test” tag
  • "{\"param\": \"value\", \"param2\": {\"$ne\": \"value2\"}}" — compound filter
Supported operators: $gt, $lt, $gte, $lte, $ne.
configurations
object[]
required
Array of configuration entries to apply when the preset matches. See configuration types below.
schedule
string
Optional cron expression. When set, the preset is only applied according to this schedule.
events
string[]
Optional array of TR-069 event codes. When set, the preset is only applied when one of these events is present in the inform.

Configuration entry types

Each entry in the configurations array has a type field that determines its behavior.

value — set a parameter value

{
  "type": "value",
  "name": "InternetGatewayDevice.ManagementServer.PeriodicInformInterval",
  "value": "300"
}
FieldDescription
nameFull TR-069 parameter path.
valueThe value to set on the device.

provision — run a provision script

{
  "type": "provision",
  "name": "YourProvisionName"
}
FieldDescription
nameThe name of a provision script stored in the provisions collection.

add_object — add an object instance

{
  "type": "add_object",
  "name": "object_parent",
  "object": "object_name"
}
FieldDescription
nameParent path under which the new instance will be created.
objectThe object name to add.

delete_object — delete an object instance

{
  "type": "delete_object",
  "name": "object_parent",
  "object": "object_name"
}
FieldDescription
nameParent path containing the instance.
objectThe specific instance name to delete.

Full configuration example

[
  {
    "type": "value",
    "name": "InternetGatewayDevice.ManagementServer.PeriodicInformEnable",
    "value": "true"
  },
  {
    "type": "value",
    "name": "InternetGatewayDevice.ManagementServer.PeriodicInformInterval",
    "value": "300"
  },
  {
    "type": "delete_object",
    "name": "object_parent",
    "object": "object_name"
  },
  {
    "type": "add_object",
    "name": "object_parent",
    "object": "object_name"
  },
  {
    "type": "provision",
    "name": "YourProvisionName"
  }
]

Build docs developers (and LLMs) love