Search in sources :

Example 1 with MediaListJobResponse

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;
}
Also used : MediaJobsRequest(com.qcloud.cos.model.ciModel.job.MediaJobsRequest) Unmarshallers(com.qcloud.cos.internal.Unmarshallers) MediaListJobResponse(com.qcloud.cos.model.ciModel.job.MediaListJobResponse)

Example 2 with MediaListJobResponse

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());
        }
    }
}
Also used : MediaJobsRequest(com.qcloud.cos.model.ciModel.job.MediaJobsRequest) MediaQueueRequest(com.qcloud.cos.model.ciModel.queue.MediaQueueRequest) MediaListQueueResponse(com.qcloud.cos.model.ciModel.queue.MediaListQueueResponse) MediaJobObject(com.qcloud.cos.model.ciModel.job.MediaJobObject) MediaListJobResponse(com.qcloud.cos.model.ciModel.job.MediaListJobResponse) Test(org.junit.Test)

Example 3 with MediaListJobResponse

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());
    }
}
Also used : MediaJobsRequest(com.qcloud.cos.model.ciModel.job.MediaJobsRequest) MediaJobObject(com.qcloud.cos.model.ciModel.job.MediaJobObject) MediaListJobResponse(com.qcloud.cos.model.ciModel.job.MediaListJobResponse)

Example 4 with MediaListJobResponse

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());
        }
    }
}
Also used : MediaJobsRequest(com.qcloud.cos.model.ciModel.job.MediaJobsRequest) MediaQueueRequest(com.qcloud.cos.model.ciModel.queue.MediaQueueRequest) MediaJobResponse(com.qcloud.cos.model.ciModel.job.MediaJobResponse) MediaListQueueResponse(com.qcloud.cos.model.ciModel.queue.MediaListQueueResponse) MediaJobObject(com.qcloud.cos.model.ciModel.job.MediaJobObject) MediaListJobResponse(com.qcloud.cos.model.ciModel.job.MediaListJobResponse) Test(org.junit.Test)

Aggregations

MediaJobsRequest (com.qcloud.cos.model.ciModel.job.MediaJobsRequest)4 MediaListJobResponse (com.qcloud.cos.model.ciModel.job.MediaListJobResponse)4 MediaJobObject (com.qcloud.cos.model.ciModel.job.MediaJobObject)3 MediaListQueueResponse (com.qcloud.cos.model.ciModel.queue.MediaListQueueResponse)2 MediaQueueRequest (com.qcloud.cos.model.ciModel.queue.MediaQueueRequest)2 Test (org.junit.Test)2 Unmarshallers (com.qcloud.cos.internal.Unmarshallers)1 MediaJobResponse (com.qcloud.cos.model.ciModel.job.MediaJobResponse)1