Stop OTA Job¶
Stop an OTA job.
Operation Permissions¶
Required Authorization |
Required Operation Permission |
---|---|
Device Management |
Full Access |
Request Format¶
POST https://{apigw-address}/connect-service/v2.1/ota-jobs?action=stop
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 |
The job ID. |
Error Codes¶
Code |
Message |
Description |
---|---|---|
24404 |
Job not found |
The job cannot be found. |
24616 |
Job has stopped |
The job has already stopped. |
Samples¶
Request Sample¶
url: https://{apigw-address}/connect-service/v2.1/ota-jobs?action=stop&orgId=yourOrgId&jobId=yourJobId
method: POST
Return Sample¶
{
"code":0,
"msg":"OK",
"requestId":"a37e8666-212c-4b18-91d1-c7254724aec8",
"data":null
}
Java SDK Sample¶
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);
}
}