Tasks are operations sent to a CPE device — reading or writing parameters, rebooting, triggering a firmware download, and more. Tasks are queued in MongoDB and executed during the next CWMP session, or immediately if a connection request is triggered.
Enqueue a task
POST /devices/<device_id>/tasks
Enqueues a task for a device and optionally triggers an immediate connection request.
The ID of the target device.
When present, GenieACS sends a TR-069 connection request to the device to execute the task immediately.
Timeout in milliseconds to wait for the device session to complete. If not specified, the server default (cwmp.deviceOnlineThreshold, default 4000 ms) is used.
Response codes:
| Code | Meaning |
|---|
200 | Task executed successfully in a completed session. |
202 | Task queued; will be processed at the next inform. |
404 | Device not found. |
503 | Device is currently in a CWMP session; cannot acquire lock. |
The response body is the task object as stored in the database, including its _id field.
Query tasks
GET /tasks/?query=<query>
Lists tasks matching a MongoDB-style query.
Show pending tasks for a device:
{"device": "202BC1-BM632w-000000"}
curl -i 'http://localhost:7557/tasks/?query=%7B%22device%22%3A%22202BC1-BM632w-000000%22%7D'
Retry a task
POST /tasks/<task_id>/retry
Clears the fault associated with a failed task so it will be retried at the next inform.
The _id of the task as returned by GET /tasks.
curl -i 'http://localhost:7557/tasks/5403908ef28ea3a25c138adc/retry' -X POST
Delete a task
Deletes a task from the queue.
The _id of the task as returned by GET /tasks.
curl -i 'http://localhost:7557/tasks/5403908ef28ea3a25c138adc' -X DELETE
Response: 503 Service Unavailable if the device is currently in a session.
Task types
getParameterValues
Retrieves the current value of one or more TR-069 parameters from the device. After the task completes, fetch the device document to read the updated values.
{
"name": "getParameterValues",
"parameterNames": [
"InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnectionNumberOfEntries",
"InternetGatewayDevice.Time.NTPServer1",
"InternetGatewayDevice.Time.Status"
]
}
curl -i 'http://localhost:7557/devices/00236a-96318REF-SR360NA0A4%252D0003196/tasks?timeout=3000&connection_request' \
-X POST \
--data '{"name": "getParameterValues", "parameterNames": ["InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnectionNumberOfEntries", "InternetGatewayDevice.Time.NTPServer1", "InternetGatewayDevice.Time.Status"] }'
After the task executes, retrieve the updated values:
{"_id": "00236a-96318REF-SR360NA0A4%2D0003196"}
curl -i 'http://localhost:7557/devices/?query=%7B%22_id%22%3A%2200236a-96318REF-SR360NA0A4%252D0003196%22%7D'
refreshObject
Refreshes all parameters under a given object path. Pass an empty string "" to refresh the entire device parameter tree.
curl -i 'http://localhost:7557/devices/202BC1-BM632w-000000/tasks?connection_request' \
-X POST \
--data '{"name": "refreshObject", "objectName": ""}'
curl -i 'http://localhost:7557/devices/00236a-SR552n-SR552NA084%252D0003269/tasks?timeout=3000&connection_request' \
-X POST \
--data '{"name": "refreshObject", "objectName": "InternetGatewayDevice.WANDevice.1.WANConnectionDevice"}'
setParameterValues
Sets the value of one or more TR-069 parameters. Each entry is a [path, value, type?] triple. Multiple values can be set in a single task.
Set a single parameter:
curl -i 'http://localhost:7557/devices/00236a-SR552n-SR552NA084%252D0003269/tasks?timeout=3000&connection_request' \
-X POST \
--data '{"name": "setParameterValues", "parameterValues": [["InternetGatewayDevice.ManagementServer.UpgradesManaged",false]]}'
Set multiple parameters at once:
{
"name": "setParameterValues",
"parameterValues": [
["InternetGatewayDevice.ManagementServer.UpgradesManaged", false],
["InternetGatewayDevice.Time.Enable", true],
["InternetGatewayDevice.Time.NTPServer1", "pool.ntp.org"]
]
}
Set WiFi SSID and password:
{
"name": "setParameterValues",
"parameterValues": [
["InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.SSID", "GenieACS", "xsd:string"],
["InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.PreSharedKey.1.PreSharedKey", "hello world", "xsd:string"]
]
}
curl -i 'http://localhost:7557/devices/202BC1-BM632w-000000/tasks?connection_request' \
-X POST \
--data '{"name":"setParameterValues", "parameterValues": [["InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.SSID", "GenieACS", "xsd:string"],["InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.PreSharedKey.1.PreSharedKey", "hello world", "xsd:string"]]}'
addObject
Creates a new instance under a multi-instance object.
curl -i 'http://localhost:7557/devices/00236a-SR552n-SR552NA084%252D0003269/tasks?timeout=3000&connection_request' \
-X POST \
--data '{"name":"addObject","objectName":"InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection"}'
deleteObject
Deletes a specific instance of a multi-instance object.
curl -i 'http://localhost:7557/devices/00236a-SR552n-SR552NA084%252D0003269/tasks?timeout=3000&connection_request' \
-X POST \
--data '{"name":"deleteObject","objectName":"InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1"}'
reboot
Reboots the device.
curl -i 'http://localhost:7557/devices/00236a-SR552n-SR552NA084%252D0003269/tasks?timeout=3000&connection_request' \
-X POST \
--data '{"name": "reboot"}'
factoryReset
Resets the device to factory defaults.
This operation is irreversible. The device will lose all configuration and may need to be re-provisioned.
curl -i 'http://localhost:7557/devices/00236a-SR552n-SR552NA084%252D0003269/tasks?timeout=3000&connection_request' \
-X POST \
--data '{"name": "factoryReset"}'
download
Instructs the device to download a file from the GenieACS file server. The file must first be uploaded via the Files API.
curl -i 'http://localhost:7557/devices/00236a-SR552n-SR552NA084%252D0003269/tasks?timeout=3000&connection_request' \
-X POST \
--data '{"name": "download", "file": "mipsbe-6-42-lite.xml"}'
The filename as uploaded to the GenieACS file store. Must match the name used in PUT /files/<file_name>.