driver_actions_cleanup
To delete the manual actions registered for a driver within a time interval, use the resource/driver_actions_cleanup method. Manual actions include assigning a driver to a unit, ending a driver’s assignment, and ignoring automatic driver assignment events (marking as false). To register a manual action, use resource/driver_actions_register. To view registered manual actions, use resource/driver_actions_list.
In Wialon Local, this method is available starting from version 2604.
Deleting an ignore action returns the affected automatic assignments and unassignments to the calculation. They appear again when the events are recalculated.
Endpoint
svc=resource/driver_actions_cleanup¶ms={
"resourceId": <long>,
"driverId": <long>,
"timeFrom": <uint>,
"timeTo": <uint>,
"action": <int>
}
Parameters
The request must contain the resourceId, driverId, timeFrom, and timeTo parameters. The action parameter is optional.
| Parameter | Description |
|---|---|
resourceId |
Resource ID. |
driverId |
Driver ID. |
timeFrom |
Beginning of the interval, UNIX time. |
timeTo |
End of the interval, UNIX time. |
action |
Type of the actions to delete: 0 for unassignment, 1 for assignment, 2 for ignore. If the parameter isn’t specified, the actions of all types are deleted. |
Response
If the request is completed successfully, an empty object is returned:
{}
Otherwise, an error code is returned.
Error codes
| Error code | Description |
|---|---|
| 3 | The required messages can’t be retrieved. |
| 4 | Wrong input parameters, or the specified driver isn’t found in the resource. |
| 6 | The operation can’t be completed. |
| 7 | No Create, edit, and delete drivers access right to the resource, or the resource is unavailable. |
Example
To delete only the ignore actions of the driver with ID 9 from the resource with ID 1003, use the following request:
svc=resource/driver_actions_cleanup¶ms={
"resourceId": 1003,
"driverId": 9,
"timeFrom": 1785542400,
"timeTo": 1788048000,
"action": 2
}