REST API Reference
The TR-069 Emulator exposes two REST controllers. Both are served on the same host/port (8555) and documented interactively in Swagger UI.
Overview
| Base path | UI mode | Purpose |
|---|---|---|
|
Configure and run a batch of emulated CPEs; device-level speed/WiFi/invoke helpers. |
|
|
Full per-device lifecycle: start/stop individual devices, browse and edit the parameter tree, trigger events, read logs. MCP-friendly. |
Base URLs
http://localhost:8555/api # Load Test controller http://localhost:8555/apiV2 # Single Mode controller
The emulator also serves /farm/stats, /farm/serials and /farm/decisions. These read-only endpoints are not part of the /api control contract and are not in Swagger UI. See Farm Endpoints.
Interactive Documentation
http://localhost:8555/swagger-ui.html # Swagger UI http://localhost:8555/v3/api-docs # OpenAPI 3 spec (JSON)
For a lightweight liveness check use GET /api/status (returns 200 with Running/Stopped) or GET /apiV2/activeEmulators. The Spring Boot Actuator endpoints (/actuator/**) are not exposed by the running service.
Load Test API (/api)
Backs Load Test Mode. The emulator keeps one shared configuration (the EmulatorParameter set, persisted to start_params.properties); Start launches a batch from it.
Configuration & Status
| Method & Path | Description | Body / Response |
|---|---|---|
|
Get the current emulator configuration |
Response: EmulatorPropertiesDto |
|
Update the configuration (ACS, batch size, options) and persist it |
Body: EmulatorPropertiesDto → |
|
Current run status |
|
|
Header Total / Active counters: devices the batch started and has not stopped, and those of them in a CWMP session with the ACS right now (Single Emulator devices are not counted) |
|
|
Get the periodic-inform interval |
Response: |
|
Set the periodic-inform interval (seconds) |
Body: |
Lifecycle
| Method & Path | Description | Body / Response |
|---|---|---|
|
Start the configured batch |
no body → |
|
Stop everything: the batch and the Single Emulator devices too |
no body → |
|
Stop everything, optionally clearing caches |
Body: |
|
Stop only the Load Test devices and the batch runner. Single Emulator devices keep their schedule, sessions, XMPP connection and updatable parameters; with |
Either body above → |
A Load Start right after a stop waits (at most 30 seconds) for the runner of the stopped run to end before it begins. A stop that arrives during that wait cancels the Start: the run does not begin, whichever scope the stop had.
Every stop answers 204 with the header X-Stopped-Devices: <n>, the number of devices it stopped (all devices without scope, the Load Test devices with scope=load). scope is all (the default) or load; any other value answers 400 INVALID_STOP_SCOPE.
A stop of everything also ends the servers and threads all devices share: the Connection Request listener, the bulk-data scheduler and the updatable-parameters thread. scope=load leaves them running. A Single Emulator device started after a stop of everything (POST /apiV2/start, /apiV2/startStored, /apiV2/startProtocol, /apiV2/factoryReset) starts them again, so its Connection Requests, Bulk Data reports and updatable parameters work without a Load Test start or a restart. A device’s Bulk Data schedule lives exactly as long as the configuration its ACS set (BulkData.Enable, BulkData.Profile.N.*), and reports are sent only while the device is running. The stop of one Single Emulator device, a stop of everything that clears the caches (the plain POST /api/stop, which does), and a factory reset drop that configuration and the schedule with it; the device starts without its ACS-set profiles. A stop of everything with clearCaches: false (POST /api/stop with a body), and the Load Test stop with clearCaches: false (POST /api/stop?scope=load with that body; without a body it clears the caches), keep both — the Load Test devices' too, whose serials the next Load Test Start builds again over the kept configuration — so a profile that is still enabled reports again at the next start; a device never shows Enable=true while sending nothing. The deletion of a stored Single Emulator device (POST /apiV2/deleteStoredDevice) drops its ACS-set configuration with the schedule.
Device Actions
All take a serial body: { "serial": "SERIAL001" }.
| Method & Path | Description |
|---|---|
|
Trigger a |
|
Apply a 3-second speed delay to the device |
|
Clear the speed delay for the device |
|
Reset WiFi parameters (channel and SNR) for the device |
Parameter Tree Files
| Method & Path | Description | Body / Response |
|---|---|---|
|
List XML files in |
Response: |
|
Get the active device-tree file |
Response: |
|
Set the active device-tree file (reloads the tree) |
Body: |
|
Upload an XML file (form field |
|
|
Delete an XML file (not the active one) |
Body: |
Updatable Parameters
| Method & Path | Description | Body / Response |
|---|---|---|
|
Get the global auto-update list |
Response: array of Parameter |
|
Replace the global auto-update list; an empty array |
Body: array of Parameter → |
|
Replace the global auto-update list from an |
|
Logs
Used by the Logs panels of both modes.
| Method & Path | Description | Body / Response |
|---|---|---|
|
Download |
|
|
Download |
|
|
Download every log of |
|
Single Mode API (/apiV2)
Backs Single Emulator Mode. Operations are per device, addressed by serial. Designed to be automation/MCP friendly.
Configuration
| Method & Path | Description | Body / Response |
|---|---|---|
|
Frontend config (default ACS URL) |
Response: |
Device Lifecycle
| Method & Path | Description | Body / Response |
|---|---|---|
|
Start a new device. Query |
Body: InitDeviceDto → |
|
Stop and remove a running device |
Body: |
|
List running devices |
Response: array of |
|
Is the device running? |
Response: |
|
Is the device in an active TR-069 session? |
Response: |
|
Reset uptime and fire a |
Body: |
|
Restart from stored config and fire |
Body: |
|
Copy a device config to a new serial |
Body: |
|
TR-069 DeviceId (Manufacturer, OUI, ProductClass, SerialNumber, …). It returns the values applied from the identity members. |
Response: string map |
|
Overall counts |
Response: |
Stored Devices
| Method & Path | Description | Body / Response |
|---|---|---|
|
List saved configurations |
Response: array of InitDeviceDto |
|
Get one saved configuration |
Response: InitDeviceDto ( |
|
Save a configuration without starting |
Body: InitDeviceDto → |
|
Delete a saved configuration. A device the engine still runs (scheduled or in a session), or whose start is still in progress, is not deleted |
Body: |
|
Start from a saved configuration |
Body: |
|
Start from a base tree in |
Body: |
Parameter Operations
| Method & Path | Description | Body / Response |
|---|---|---|
|
Full parameter tree (can be large) |
Response: array of |
|
Parameters under a path prefix |
Response: array of ParameterInfo |
|
Names under a path (TR-069 GetParameterNames). |
Response: array of |
|
Single value lookup |
Response: |
|
Full metadata for one parameter |
Response: ParameterInfo ( |
|
Existence check; |
Response: |
|
Search by name/value (default |
Response: array of ParameterInfo |
|
Set one value (no ValueChange event) |
Body: |
|
Set many values; fires ValueChange if any has active notification |
Body: |
|
Set one value the way a real CPE does; fires a |
Body: |
|
Set notification level: |
Body: |
|
Add an object instance (e.g. a new SSID) |
Body: |
|
Add one parameter; type/writable/notification resolved from the CWMP template |
Body: |
|
Delete an object/branch and everything under it |
Body: |
Events
| Method & Path | Description | Body / Response |
|---|---|---|
|
Trigger a TR-069 event (see TR-069 Event Codes). A |
Body: |
|
Set the periodic-inform interval (seconds; |
Body: |
Logs
| Method & Path | Description | Body / Response |
|---|---|---|
|
Download the full log file |
|
|
Log content for live viewing; supports incremental reads |
|
|
Log counts |
Response: |
|
Clear the device log |
Body: |
Updatable Parameters & Tree Files
| Method & Path | Description | Body / Response |
|---|---|---|
|
Get the device’s auto-update list |
Response: array of Parameter |
|
Set the device’s auto-update list |
Body: |
|
Read an auto-update list from an |
|
|
List available parameter-tree templates |
Response: |
|
Upload a parameter-tree XML (form field |
|
TR-069 Event Codes
Used by POST /apiV2/invoke (TransferComplete and DUStateChangeComplete answer 400; eventName, case-sensitive — use the exact names below). See also Protocol Support — Event Codes.
| Event Name | Code | Meaning |
|---|---|---|
|
0 |
Initial setup / factory reset |
|
1 |
Device reboot |
|
2 |
Scheduled inform |
|
4 |
Parameter with active notification changed |
|
6 |
ACS-initiated connection request |
|
7 |
Download/upload completed (refused by |
|
8 |
Diagnostics complete |
|
11 |
Deployment-unit state change complete (refused by |
The Single Mode Invoke Event dropdown exposes codes 0, 1, 2, 4, 6, 8. TransferComplete (7) and DUStateChangeComplete (11) cannot be triggered by hand: only the RPC that raises them (Download/Upload, ChangeDUState) does.
|
Data Models
EmulatorPropertiesDto (/api)
Mirrors the EmulatorParameter set. Used by GET/POST /api/properties.
| Field | Type | Example | Description |
|---|---|---|---|
|
string |
|
ACS protocol ( |
|
string |
|
ACS host |
|
integer |
|
ACS port |
|
string |
|
ACS URL path |
|
integer |
|
Number of device groups |
|
integer |
|
Devices per group |
|
integer |
|
Registration group id |
|
integer |
|
Delay between registration batches (seconds) |
|
integer |
|
Startup spread |
|
string |
`` |
Scheduled start ( |
|
boolean |
|
Enable periodic inform |
|
boolean |
|
Enable Connection Request listener |
|
boolean |
|
Skip the initial inform |
|
boolean |
|
Randomise retry counts |
|
boolean |
|
Emulate Download/Upload transfers |
|
string |
|
Transfer delay(s) |
|
string |
|
Event of the first session of every device after a start: |
|
boolean |
|
Lightweight (inform-only) mode |
|
boolean |
|
Per-device file logging |
|
string |
|
Active parameter-tree file |
|
integer |
|
GetParameterValues execution delay (s) |
|
integer |
|
SetParameterValues execution delay (s) |
|
integer |
|
GetParameterNames execution delay (s) |
|
integer |
|
GetParameterAttributes execution delay (s) |
|
integer |
|
SetParameterAttributes execution delay (s) |
|
integer |
|
AddObject execution delay (s) |
|
integer |
|
DeleteObject execution delay (s) |
|
integer |
|
Download execution delay (s) |
|
integer |
|
Upload execution delay (s) |
|
integer |
|
Reboot execution delay (s) |
|
integer |
|
FactoryReset execution delay (s) |
|
integer |
|
ChangeDUState (TR-157) execution delay (s) |
|
integer |
|
GetRPCMethods execution delay (s) |
|
Task execution delays hold the emulated CPE for the given number of seconds before it
processes each ACS-issued RPC, modelling real-CPE "thinking time". The default is |
InitDeviceDto (/apiV2)
Used by start, saveDevice, cloneDevice and the storedDevices responses.
| Field | Type | Example | Required | Description |
|---|---|---|---|---|
|
string |
|
Yes |
Unique device serial |
|
string |
No |
ACS URL (defaults to |
|
|
string |
|
No |
Tree file from |
|
boolean |
|
No |
Start value of the TR-181 parameter |
|
string |
|
No |
Device identity: written to |
|
string |
|
No |
Device identity: written to |
|
string |
|
No |
Device identity: written to |
|
string |
|
No |
Device identity: written to |
|
array |
see Parameter |
No |
Auto-updating parameters |
|
boolean |
|
No |
Managed by the system |
Device identity members
manufacturer, manufacturerOui, productClass and softwareVersion set the DeviceInfo identity of one Single Mode device.
<root> is InternetGatewayDevice. for a TR-098 tree and Device. for a TR-181 tree.
-
The emulator writes each member that is set to
<root>DeviceInfo.<Name>before the first0 BOOTSTRAPInform. The InformDeviceIdcarries the values. -
If a member is absent or
null, the device keeps the value of its parameter tree. -
manufacturer,productClassandsoftwareVersionare 1 to 64 printable ASCII characters. The characters"and=are not allowed. A blank value is refused. -
manufacturerOuiis exactly 6 upper-case hexadecimal digits. -
If a member is invalid, the answer is
400INVALID_REQUESTand the message names the member. The message and the log never show the value. Nothing is started, stored or cloned. -
If the tree has no matching DeviceInfo parameter,
startanswers400INVALID_REQUESTand nothing is left for the serial.saveDevicechecks only the member values, so it stores such a device and a later start is refused. A boot restore logs one WARN with the member name and skips the device. -
A factory reset keeps the identity.
-
POST /apiV2/cloneDevicecopies the four members from the source. An invalid stored member refuses the clone with400INVALID_REQUEST. -
GET /apiV2/deviceId?serial=returns the applied Manufacturer, OUI and ProductClass, because it reads the tree. -
POST /apiV2/startProtocol, Load Test devices and Farm devices do not take these members. -
An older emulator ignores the members and answers
200with the values of the tree. To prove that the emulator applied them, read<root>DeviceInfo.ProductClassafter the start.
Parameter (auto-update entry)
| Field | Type | Description |
|---|---|---|
|
string |
Full parameter path |
|
|
Data type (default |
|
|
Update mode (default |
|
integer |
Value range (numeric types) |
|
integer |
Step size for increment/decrement |
|
string[] |
Optional fixed value set |
Error Handling
Standard HTTP status codes are used:
| Status | Meaning |
|---|---|
|
Success with a response body |
|
Success, no body (most mutations) |
|
Invalid parameters or file |
|
Device, parameter or stored config not found |
|
Operation conflicts with current state (e.g. already running, device in session) |
|
Unexpected server error |
|
A start waited up to 25 seconds for a stop of everything that was accepted and has not ended; nothing was started, retry later |
Error responses of /apiV2 use the body
{ "code": "INVALID_SERIAL", "message": "Error message description", "details": null }
code is a stable name to branch on; message is for people and may change, so never match on its text. The codes are
INVALID_SERIAL and EVENT_NOT_INVOCABLE (400), INVALID_REQUEST (400), DEVICE_NOT_FOUND (404),
DEVICE_RUNNING, TREE_IN_USE and RESET_REFUSED (409), INTERNAL_ERROR (500), STOP_IN_PROGRESS (503). Spring’s own request errors (a
missing or mistyped parameter, an unreadable body) keep their status (400) and carry this body too.
Two /apiV2 endpoints still answer a rejected auto-update list with the older body { "error": "…" } (400):
POST /apiV2/updatableParameters and POST /apiV2/updatableParameters/parse (the latter also 500 { error } when
the file cannot be read). /api (v1) endpoints, including /api/updatableParameters/upload and /api/logs/*,
answer their refusals (400, 404, 500 of a known cause) with { "error": "…" } too.
An unexpected exception on any controller under api.** — /apiV2, /api (v1), /api/logs, /farm — answers
500 { "code": "INTERNAL_ERROR", "message": "…", "details": null } as JSON with a fixed message, also on the
text/plain endpoints (/api/status, /farm/serials, /farm/serial-prefix): its text and stack trace go to the
emulator log only. A client that disconnects mid-response (an aborted log download) and an exception after the
response was committed are not answered with JSON.
start, startStored, startProtocol, a refused factoryReset (409 RESET_REFUSED) and the 400 INVALID_REQUEST of saveDevice and cloneDevice (a TR-098 tree with enableHttpConnectionRequest=false, or an invalid device identity member) and of startStored (an invalid stored identity member) keep the older body
{ success: false, serial, message } and add code with the same names. A successful start has no code. The HTTP
status comes from code, not from the message. The 500 of an unexpected exception during a start is the general
{ code, message, details } body, without success.
503 STOP_IN_PROGRESS: a stop of everything holds the lock of the shared servers for its whole run, and it can take
minutes (its XMPP connections close one after the other). It also waits for the starts that are already building their
device, and POST /api/stop answers 204 before the stop has taken the lock. start, startStored, startProtocol
and the restart of factoryReset therefore wait for every stop of everything that has been accepted and has not
finished, also while it waits for starts already building, at most 25 seconds in all (one deadline), then answer 503
with nothing registered or started, not even the device’s first session to the ACS; the same request succeeds once the
stop ended. While no such stop exists, starts of different devices run side by side and do not wait for each other. The 25 seconds are below the 30 seconds that
emulator-client waits for an answer by default, so a refusal always arrives as the 503 instead of a timeout of the
client’s own request. The bound covers the wait for the stop only: a start that gets through late builds its device
afterwards (the parameter tree, the DNS lookup of the ACS host), and a slow build can end after the client’s 30 seconds — the client then does not know whether the device started and reads
parameterValue(serial, <root>DeviceInfo.SerialNumber), which equals the serial once the device is registered (the stored
flag of GET /apiV2/isEmulatorRunning is not the engine’s truth). A start that was
already building when the stop was accepted is completed first; the stop then ends the device with the rest. The stop
itself never gives up waiting.
409 DEVICE_RUNNING for a start: the device runs, or a start or factory reset of the same serial is still in progress (building, or waiting for a stop; a client that
repeats a request after its own timeout). The second start is refused at once and waits for nothing; the first goes on.
Starts of different serials are not affected. factoryReset and deleteStoredDevice take the same per-serial guard: while a
start or a factory reset (up to 3 s of stop plus a start wait of up to 25 s) of the serial is in progress they are refused at once with 409 and touch nothing (no stop, no cache wipe, no change
of the stored configuration).