Get Details of Device Group Tasks

Last Updated on : 2023-07-06 08:00:32download

Get the details of the device group tasks by group ID.

API address

GET: /v1.0/iot-03/device-groups/{group_id}/tasks

Request parameter

Parameter nameTypeINRequiredDescription
group_idStringuritrueThe group ID.
reqGroupTaskQueryReqqueryfalseThe query criteria.

Description of req

Parameter nameTypeINRequiredDescription
task_idString falseThe task ID. Default value: the ID of the latest task.

Return parameter

Parameter nameTypeDescription
resultGroupTaskStatusVO

Description of result

Parameter nameTypeDescription
group_idStringThe group ID.
processing_statusIntegerSpecifies the execution status of asynchronous tasks of the device group. Valid values:
  • 0: The device operation is in progress.
  • 1: The operation of all devices is successful.
  • 2: The operation of some devices is successful.
  • 3: The operation of all devices failed.
failure_devicesListTe list of devices whose operation failed.

Description of failure_devices

Parameter nameTypeDescription
device_idStringThe device ID.
opIntegerThe operation type. Valid values:
  • 0: Add a device to the group.
  • 1: Remove a device from the group.
reasonStringThe failure reason.

Request example

GET: /v1.0/iot-03/device-groups/144779744804601****/tasks
{}

Return example

{
    "result": {
        "failure_devices": [
            {
                "op": 0,
                "reason": "SUB_DEVICE_TIMEOUT",
                "device_id": "vdevo1632553122****"
            },
            {
                "op": 0,
                "reason": "SUB_DEVICE_TIMEOUT",
                "device_id": "vdevo1632553121****"
            },
            {
                "op": 0,
                "reason": "SUB_DEVICE_TIMEOUT",
                "device_id": "vdevo1632553120****"
            },
            {
                "op": 0,
                "reason": "SUB_DEVICE_TIMEOUT",
                "device_id": "vdevo1632553119****"
            }
        ],
        "group_id": "144779744804601****",
        "processing_status": 2
    },
    "t": 1633945074303,
    "success": true
}

Error code

For more information, see error code.