use of com.qcloud.cos.model.ciModel.job.MediaJobObject in project cos-java-sdk-v5 by tencentyun.
the class MediaJobTest method describeMediaJobsTest.
@Test
public void describeMediaJobsTest() {
if (!judgeUserInfoValid()) {
return;
}
MediaQueueRequest queueRequest = new MediaQueueRequest();
queueRequest.setBucketName(bucket);
MediaListQueueResponse queueResponse = cosclient.describeMediaQueues(queueRequest);
if (queueResponse != null && queueResponse.getQueueList().size() != 0) {
MediaJobsRequest request = new MediaJobsRequest();
request.setBucketName(bucket);
String queueId = queueResponse.getQueueList().get(0).getQueueId();
request.setQueueId(queueId);
request.setTag(TAG);
MediaListJobResponse response = cosclient.describeMediaJobs(request);
List<MediaJobObject> jobsDetail = response.getJobsDetailList();
for (MediaJobObject mediaJobObject : jobsDetail) {
assertEquals(TAG, mediaJobObject.getTag());
assertEquals(queueId, mediaJobObject.getQueueId());
}
}
}
use of com.qcloud.cos.model.ciModel.job.MediaJobObject in project cos-java-sdk-v5 by tencentyun.
the class JobDemo method describeMediaJobs.
/**
* describeMediaJobs 查询任务列表
*
* @param client
*/
public static void describeMediaJobs(COSClient client) {
// 1.创建任务请求对象
MediaJobsRequest request = new MediaJobsRequest();
// 2.添加请求参数 参数详情请见api接口文档
request.setBucketName("DemoBucket-123456789");
request.setQueueId("p9900025e4ec44b5e8225e70a5217****");
request.setTag("Transcode");
// 3.调用接口,获取任务响应对象
MediaListJobResponse response = client.describeMediaJobs(request);
List<MediaJobObject> jobsDetail = response.getJobsDetailList();
for (MediaJobObject mediaJobObject : jobsDetail) {
System.out.println(mediaJobObject.getOperation().getTranscode());
}
}
use of com.qcloud.cos.model.ciModel.job.MediaJobObject in project cos-java-sdk-v5 by tencentyun.
the class MediaJobTest method describeMediaJobTest.
@Test
public void describeMediaJobTest() {
if (!judgeUserInfoValid()) {
return;
}
MediaQueueRequest queueRequest = new MediaQueueRequest();
queueRequest.setBucketName(bucket);
MediaListQueueResponse queueResponse = cosclient.describeMediaQueues(queueRequest);
if (queueResponse != null && queueResponse.getQueueList().size() != 0) {
MediaJobsRequest request = new MediaJobsRequest();
request.setBucketName(bucket);
String queueId = queueResponse.getQueueList().get(0).getQueueId();
request.setQueueId(queueId);
request.setTag(TAG);
MediaListJobResponse response = cosclient.describeMediaJobs(request);
List<MediaJobObject> jobsDetail = response.getJobsDetailList();
for (MediaJobObject mediaJobObject : jobsDetail) {
request = new MediaJobsRequest();
request.setBucketName(bucket);
request.setJobId(mediaJobObject.getJobId());
MediaJobResponse jobResponse = cosclient.describeMediaJob(request);
System.out.println(jobResponse);
assertEquals(queueId, jobResponse.getJobsDetail().getQueueId());
}
}
}
Aggregations