Delete OTA Job¶
删除一个OTA job。
操作权限¶
需授权的资源 |
所需操作权限 |
---|---|
设备管理 |
Full Access |
请求格式¶
POST https://{apigw-address}/connect-service/v2.1/ota-jobs?action=delete
请求参数(URI)¶
名称 |
位置(Path/Query) |
必需/可选 |
数据类型 |
描述 |
---|---|---|---|---|
orgId |
Query |
必需 |
String |
资产所属的组织ID。如何获取orgId信息>> |
jobId |
Query |
必需 |
String |
需要删除的OTA job ID。 |
错误码¶
代码 |
错误信息 |
描述 |
---|---|---|
24404 |
Job not found |
找不到OTA job。 |
24618 |
Not allowed to delete running job |
OTA job仍在运行,无法删除。 |
示例¶
请求示例¶
url: https://{apigw-address}/connect-service/v2.1/ota-jobs?action=delete&orgId=yourOrgId&jobId=yourJobId
method: POST
返回示例¶
{
"code":0,
"msg":"OK",
"requestId":"dcf62008-7904-4560-9db6-6a9e3519c765",
"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.DeleteJobRequest;
import com.envisioniot.enos.connect_service.v2_1.ota.job.DeleteJobResponse;
public class DeleteJob {
public static void main(String[] args) {
final String appKey = "yourAppKey";
final String appSecret = "yourAppSecret";
String serverUrl = "yourServerUrl";
String orgId = "yourOrgId";
String jobId = "yourJobId";
DeleteJobRequest request = new DeleteJobRequest();
request.setOrgId(orgId);
request.setJobId(jobId);
DeleteJobResponse response = Poseidon
.config(PConfig.init().appKey(appKey).appSecret(appSecret).debug())
.url(serverUrl)
.getResponse(request, DeleteJobResponse.class);
}
}