Search in sources :

Example 1 with GetAsyncFetchTaskRequest

use of com.qcloud.cos.model.fetch.GetAsyncFetchTaskRequest in project cos-java-sdk-v5 by tencentyun.

the class GetAsyncFetchTaskDemo method getAsyncFetchTask.

public static void getAsyncFetchTask() {
    EndpointBuilder builder = new UserSpecifiedEndpointBuilder(String.format("%s.migration.myqcloud.com", region), "service.cos.myqcloud.com");
    COSClient cosClient = createCosClient();
    cosClient.getClientConfig().setEndpointBuilder(builder);
    GetAsyncFetchTaskRequest request = new GetAsyncFetchTaskRequest();
    request.setBucketName(bucketName);
    request.setTaskId(taskId);
    GetAsyncFetchTaskResult result = cosClient.getAsyncFetchTask(request);
    System.out.println(result.getCosRequestId());
    System.out.println(result.getCode());
    System.out.println(result.getMessage());
    System.out.println(result.getRequestId());
    for (Entry<String, String> entry : result.getData().entrySet()) {
        System.out.println(entry.getKey());
        System.out.println(entry.getValue());
    }
}
Also used : COSClient(com.qcloud.cos.COSClient) GetAsyncFetchTaskResult(com.qcloud.cos.model.fetch.GetAsyncFetchTaskResult) GetAsyncFetchTaskRequest(com.qcloud.cos.model.fetch.GetAsyncFetchTaskRequest) UserSpecifiedEndpointBuilder(com.qcloud.cos.endpoint.UserSpecifiedEndpointBuilder) UserSpecifiedEndpointBuilder(com.qcloud.cos.endpoint.UserSpecifiedEndpointBuilder) EndpointBuilder(com.qcloud.cos.endpoint.EndpointBuilder)

Aggregations

COSClient (com.qcloud.cos.COSClient)1 EndpointBuilder (com.qcloud.cos.endpoint.EndpointBuilder)1 UserSpecifiedEndpointBuilder (com.qcloud.cos.endpoint.UserSpecifiedEndpointBuilder)1 GetAsyncFetchTaskRequest (com.qcloud.cos.model.fetch.GetAsyncFetchTaskRequest)1 GetAsyncFetchTaskResult (com.qcloud.cos.model.fetch.GetAsyncFetchTaskResult)1