Stop OTA Job¶
停止一个OTA job。
操作权限¶
需授权的资源 |
所需操作权限 |
---|---|
设备管理 |
Full Access |
请求格式¶
POST https://{apigw-address}/connect-service/v2.1/ota-jobs?action=stop
请求参数(URI)¶
名称 |
位置(Path/Query) |
必需/可选 |
数据类型 |
描述 |
---|---|---|---|---|
orgId |
Query |
必需 |
String |
资产所属的组织ID。如何获取orgId信息>> |
jobId |
Query |
必需 |
String |
需要停止的OTA job ID。 |
错误码¶
代码 |
错误信息 |
描述 |
---|---|---|
24404 |
Job not found |
找不到OTA job。 |
24616 |
Job has stopped |
OTA job已停止. |
示例¶
请求示例¶
url: https://{apigw-address}/connect-service/v2.1/ota-jobs?action=stop&orgId=yourOrgId&jobId=yourJobId
method: POST
返回示例¶
{
"code":0,
"msg":"OK",
"requestId":"a37e8666-212c-4b18-91d1-c7254724aec8",
"data":null
}
Java SDK调用示例¶
package com.envisioniot.enos.connect_service.ota.job;
import com.envision.apim.poseidon.config.PConfig;
import com.envision.apim.poseidon.core.Poseidon;
import com.envisioniot.enos.connect_service.v2_1.ota.job.StopJobRequest;
import com.envisioniot.enos.connect_service.v2_1.ota.job.StopJobResponse;
public class StopJob {
public static void main(String[] args) {
final String appKey = "yourAppKey";
final String appSecret = "yourAppSecret";
String serverUrl = "yourServerUrl";
String orgId = "yourOrgId";
String jobId = "yourJobId";
StopJobRequest request = new StopJobRequest();
request.setOrgId(orgId);
request.setJobId(jobId);
StopJobResponse response = Poseidon
.config(PConfig.init().appKey(appKey).appSecret(appSecret).debug())
.url(serverUrl)
.getResponse(request, StopJobResponse.class);
}
}