V2.5 Get Command Jobs¶
Get command job details.
Request Format¶
GET https://{apigw-address}/connect-service/v2.5/commands?action=getJob
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>> |
jobId | Query | Mandatory | String | Command job ID. |
Response Parameters¶
Name | Data Type | Description |
---|---|---|
code | number | Failed or succeeded to create an alert. 0: succeeded, -1: failed. |
msg | String | Returns OK if successful. Other returned values indicate failure. |
requestId | String | A unique ID to identify a request. |
data | Struct | See CommandInfo Struct. |
CommandInfo Struct ¶
Name | Data Type | Description |
---|---|---|
orgId | String | Organization ID. |
jobId | String | Command Job ID. |
name | StringI18n | Job name. |
targetScope | Struct | See TargetScope Struct. |
schedulePolicy | Struct | See SchedulePolicy Struct. |
timeoutPolicy | Struct | See TimeoutPolicy Struct. |
retryPolicy | Struct | See RetryPolicy Struct. |
status | String | The command job status |
desc | String | The job description with no more than 100 characters. |
commandInfo | Struct | See commandInfo Struct. |
createTimestamp | Number | Create the time stamp. |
TargetScope Struct ¶
Name | Data Type | Description |
---|---|---|
targetType | String | You can choose device_list 、product_key |
targetDevices | Struct | targetDevicesStruct contains:
|
SchedulePolicy Struct ¶
Name | Data Type | Description |
---|---|---|
scheduleType | String | You can choose DISPOSABLE , which currently triggers a one-time job. |
disposableSchedulePolicy | Struct | The struct contains triggerTs : Number, triggering the timestamps. |
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 SERVICE_INVOKE 、MEASUREPOINT_SET |
setMeasurepointInfo | Struct | The struct contains
|
serviceInvokeInfo | Struct | The struct contains
|
Samples¶
Request Sample¶
url: https://{apigw-address}/connect-service/v2.5/commands?action=getJob&jobId=jobId&orgId=yourOrgId
method: GET
Return Sample¶
{
"code": 0,
"msg": "OK",
"requestId": "3029e3d8-a297-41cf-9fce-00ce39dfbfef",
"data": {
"orgId": "yourOrgId",
"jobId": "jobId",
"name": {
"defaultValue": "commandJobName",
"i18nValue": {
"en_US": "name",
"zh_CN": "中文名"
}
},
"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
}
}