V2.5 Search Command Tasks


Search command tasks details, execution progress and status.

Request Format

POST https://{apigw-address}/connect-service/v2.5/commands?action=searchTask

Request Parameters (URI)

Name Location (Path/Query) Mandatory/Optional Data Type Description
orgId Query Mandatory String The organization ID which the asset belongs to. How to get orgId>>

Request Parameters (Body)

Name Mandatory/Optional Data Type Description
expression Optional String

The query expression, which supports sql-like query.

  • jobId supports eq in.
  • ztaskId supports eq in.
  • assetId pk dk supports``eq in``.
  • status supports``eq in``.
  • createTime supports eq lt lte gt gte

How to use expression>>

pagination Optional Pagination Request Struct

See Pagination Request Struct>>

  • pageNo: Number, starts from 1, with a default minimum value of 1 and supports eq in.
  • pageSize: Number, from 0 to 1000.

Response Parameters

Name Data Type Description
code Int Return code of a request. + 0 indicates success. + non-zero values indicates failure.
msg String The explanation to the return code. Its value is OK if the request is successful.
requestId String A unique ID to identify a request.
data Struct See TaskInfo Struct.

Samples

Request Sample

url: https://{apigw-address}/connect-service/v2.5/commands?action=searchTask&orgId=yourOrgId
method: POST
requestBody:
{
    "expression": "jobId in ('jobId')",
    "pagination": {
        "pageNo": 1,
        "pageSize": 100
    }
}

Return Sample

{
    "code": 0,
    "msg": "OK",
    "requestId": "2280717f-ad1f-4329-9168-b8504aa537c7",
    "data": [
        {
            "taskId": "taskId",
            "orgId": "yourOrgId",
            "assetId": "assetId",
            "productKey": "productKey",
            "deviceKey": "deviceKey",
            "jobId": "jobId",
            "status": "status",
            "commandInfo": {
                "commandType": "commandType",
                "serviceInvokeInfo": {
                    "serviceId": "serviceId",
                    "inputData": {
                        "input": 22
                    }
                },
                "measurepointSetInfo": null
            },
            "taskResult": null,
            "createTimestamp": 1718952422080,
            "updateTimestamp": 1718952422080,
            "autoRetryCount": 0,
            "manualRetryCount": 0
        }
    ],
    "pagination": {
        "sortedBy": null,
        "pageNo": 1,
        "pageSize": 100,
        "totalSize": 1
    }
}