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.
|
pagination |
Optional |
Pagination Request Struct |
See Pagination Request Struct>>
|
Response Parameters¶
Name |
Data Type |
Description |
---|---|---|
pagination |
Pagination Request Struct |
|
code |
Number |
Return code of a request.
+ |
msg |
String |
The explanation to the return code. Its value is |
requestId |
String |
A unique ID to identify a request. |
data |
Struct |
For more information, see CommandJob Struct. |
CommandJob Struct ¶
Name |
Data Type |
Description |
---|---|---|
orgId |
String |
The organization ID which the asset belongs to. How to get orgId>> |
jobId |
String |
The command job ID of the command task. |
name |
StringI18n |
The job name. For more details on the structure and locales supported, see Internationalized name struct. |
targetScope |
Struct |
See TargetScope Struct. |
schedulePolicy |
Struct |
|
timeoutPolicy |
Struct |
See TimeoutPolicy Struct. |
retryPolicy |
Struct |
See RetryPolicy Struct. |
status |
String |
Command Job status. |
desc |
String |
Command Jobdescription. |
commandInfo |
Struct |
See CommandInfo Struct. |
createTimestamp |
Number |
Create the time stamp. |
TargetScope Struct ¶
Name |
Data Type |
Description |
---|---|---|
targetType |
String |
You can choose |
targetDevices |
Struct |
targetDevicesStruct contains:
|
SchedulePolicy Struct ¶
Name |
Data Type |
Description |
---|---|---|
scheduleType |
String |
You can choose |
disposableSchedulePolicy |
Struct |
The struct contains |
TimeoutPolicy Struct ¶
Name |
Data Type |
Description |
---|---|---|
inProgressTimeoutInSeconds |
Integer |
From 1 to 900(30 by default) |
ttlTimeoutInSeconds |
Integer |
From 0 to 172800(0 by default) |
RetryPolicy Struct ¶
Name |
Data Type |
Description |
---|---|---|
enableRetry |
Boolean |
|
retryIntervalInSeconds |
Number |
Automatic retry interval time (in seconds) after failure. Effective only when enableRetry is true. From 0 to 86400 (300 by default). |
retryCount |
Number |
Maximum number of automatic retries. Effective only when enableRetry is true. From 1 to 10 (3 by default). |
CommandInfo Struct ¶
Name |
Data Type |
Description |
---|---|---|
commandType |
String |
You can choose |
setMeasurepointInfo |
Struct |
The struct contains
|
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
}
}