bind_unit_driver
The bind_unit_driver function is used to assign drivers to units or to separate them from units.
svc=resource/bind_unit_driver¶ms={"resourceId":<long>,
"unitId":<long>,
"driverId":<long>,
"time":<uint>,
"mode":<bool>
}
Parameters
Name | Description |
---|---|
resourceId | Resource ID. |
unitId | Unit ID. |
driverId | Driver ID. |
time | Time (0 — current time). |
mode | Modes:
|
Returned result
If the request is successful, an empty JSON is returned.
{ }
If not, an error code is returned. Possible error codes:
Code | Description |
---|---|
7 | Failed to fetch the resource with the desired ACL (ADF_ACL_AVL_RES_EDIT_DRIVERS) or failed to fetch the unit with the desired ACL (ADF_ACL_ITEM_VIEW). |
6 | Failed to assign the driver. |
4 | Failed to fetch the driver with the desired driverId or wrong input parameters. |
Request examples
Sent request for assigning a driver:
svc=resource/bind_unit_driver¶ms={"resourceId":930849,"driverId":2,"time":0,"unitId":24675341,"mode":1}
Returned result:
{ }
Sent request for separating a driver:
svc=resource/bind_unit_driver¶ms={"resourceId":930849,"driverId":2,"time":0,"unitId":24675341,"mode":0}
Returned result:
{ }
Assign driver on Feb 07 2022 07:07:00:
svc=resource/bind_unit_driver¶ms={"resourceId":930849, "driverId":17, "time":1644217620, "unitId":22361100, "mode":1}
Returned result:
{ }
Separate driver on Feb 07 2022 09:08:00:
svc=resource/bind_unit_driver¶ms={"resourceId":930849,"driverId":17,"time":1644224880,"unitId":22361100,"mode":0}
Returned result:
{ }
You also can merge these two requests into one using core/batch:
svc=core/batch¶ms={"params":[{"svc":"resource/bind_unit_driver","params":{"resourceId":930849,"driverId":17,"time":1644217620,"unitId":22361100,"mode":true}},{"svc":"resource/bind_unit_driver","params":{"resourceId":930849,"driverId":17,"time":1644224880,"unitId":22361100,"mode":false}}],"flags":0}
For the returned result, see the response section for the batch function.