V2.5 Search Command Jobs


Search command jobs by conditions.

Request Format

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

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.

  • name supports``like``.

  • 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 (10 by default).

Response Parameters

Name

Data Type

Description

pagination

Pagination Request Struct

See Pagination Request Struct>>

code

Number

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

For more information, see CommandJob Struct.

Samples

Request Sample

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

Return Sample

{
    "code": 0,
    "msg": "OK",
    "requestId": "c30c7225-ed42-454d-8409-ff4b5426e868",
    "data": [{
        "orgId": "yourOrgId",
        "jobId": "jobId",
        "name": {
            "defaultValue": "commandJobName",
            "i18nValue": {
                "en_US": "name",
                "zh_CN": "t中文名"
            }
        },
        "targetScope": {
            "targetType": "DEVICE_LIST",
            "targetDevices": [{
                "assetId": null,
                "productKey": "productKey",
                "deviceKey": "deviceKey"
            }]
        },
        "schedulePolicy": {
            "scheduleType": "DISPOSABLE",
            "disposableSchedulePolicy": {
                "triggerTs": 1718952446317
            }
        },
        "timeoutPolicy": {
            "inProgressTimeoutInSeconds": 30,
            "ttlTimeoutInSeconds": 20
        },
        "retryPolicy": {
            "enableRetry": true,
            "retryIntervalInSeconds": 300,
            "retryCount": 3
        },
        "desc": "commandJobDescription",
        "status": "ENABLED",
        "commandInfo": {
            "commandType": "SERVICE_INVOKE",
            "serviceInvokeInfo": {
                "serviceId": "serviceId",
                "inputData": {
                    "input": 22
                }
            },
            "measurepointSetInfo": null
        },
        "createTimestamp": 1718952422050
    }],
    "pagination": {
        "sortedBy": null,
        "pageNo": 1,
        "pageSize": 100,
        "totalSize": 1
    }
}