Canceling a Packaging Task
Notes
- To cancel a task, you need to provide the task ID.
- The task to be canceled must be a task in the task queue. A packaging task that has been started or completed cannot be deleted.
Core Code
1 2 3 |
String taskId = "1234";
BaseResponse deleteResponse = mpcClient.cancelRemuxTask(taskId);
System.out.println("cancel: " + gson.toJson(deleteResponse) + "\n");
|
Full Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import com.google.gson.Gson;
import com.huawei.mpc.client.MpcClient;
import com.huawei.mpc.client.MpcConfig;
import com.huawei.mpc.model.BaseResponse;
Gson gson = new Gson();
// Initialize the client.
MpcConfig mpcConfig = new MpcConfig();
mpcConfig.setEndPoint("mpc.cn-north-4.myhuaweicloud.com");
mpcConfig.setProjectId("ca225055625d48f6888f60730fb82657");
mpcConfig.setAk("Your project ID");
mpcConfig.setSk("****************************************");
MpcClient mpcClient = new MpcClient(mpcConfig);
String taskId = "1234";
BaseResponse deleteResponse = mpcClient.cancelRemuxTask(taskId);
System.out.println("cancel: " + gson.toJson(deleteResponse) + "\n");
|
Last Article: Querying Packaging Tasks
Next Article: Transcoding Templates
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.