use of com.qcloud.cos.model.ciModel.job.MediaListJobResponse in project cos-java-sdk-v5 by tencentyun.
the class COSClient method describeMediaJobs.
@Override
public MediaListJobResponse describeMediaJobs(MediaJobsRequest req) {
this.checkCIRequestCommon(req);
rejectNull(req.getQueueId(), "The queueId parameter must be specified setting the object tags");
rejectNull(req.getTag(), "The tag parameter must be specified setting the object tags");
CosHttpRequest<MediaJobsRequest> request = createRequest(req.getBucketName(), "/jobs", req, HttpMethodName.GET);
addParameterIfNotNull(request, "queueId", req.getQueueId());
addParameterIfNotNull(request, "tag", req.getTag());
addParameterIfNotNull(request, "orderByTime", req.getOrderByTime());
addParameterIfNotNull(request, "nextToken", req.getNextToken());
addParameterIfNotNull(request, "size", req.getSize().toString());
addParameterIfNotNull(request, "states", req.getStates());
addParameterIfNotNull(request, "startCreationTime", req.getStartCreationTime());
addParameterIfNotNull(request, "endCreationTime", req.getEndCreationTime());
MediaListJobResponse response = invoke(request, new Unmarshallers.ListJobUnmarshaller());
this.checkMediaListJobResponse(response);
return response;
}
use of com.qcloud.cos.model.ciModel.job.MediaListJobResponse 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.MediaListJobResponse 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.MediaListJobResponse 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