Querying a Migration Task
Function
This API is used to query details about a task with a specified ID.
Calling Method
For details, see Calling APIs.
URI
GET /v2/{project_id}/tasks/{task_id}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
The project ID. Minimum length: 1 character Maximum length: 1,024 characters |
task_id |
Yes |
String |
The task ID. Minimum length: 1 character Maximum length: 1,024 characters |
Request
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
The token used for IAM authentication. Minimum length: 1 character Maximum length: 16,384 characters |
Response
Status code: 200
Parameter |
Type |
Description |
---|---|---|
bandwidth_policy |
Array of BandwidthPolicyDto objects |
The traffic limiting rules. A maximum of five traffic limiting rules can be set for a single task. Array length: 0 to 5 |
complete_size |
Long |
The size (in bytes) of the objects that have been migrated in the task. Minimum value: 0 Maximum value: 9223372036854775807 |
description |
String |
The task description. If this parameter is not set, the value is an empty string. Minimum length: 0 characters Maximum length: 255 characters |
dst_node |
DstNodeResp object |
The destination node information. |
enable_failed_object_recording |
Boolean |
Indicates whether to record the objects that failed to be migrated. If this function is enabled, information about objects that fail to be migrated will be stored in the destination bucket. |
enable_kms |
Boolean |
Indicates whether to use KMS to encrypt the data to be stored in the destination OBS bucket. |
enable_metadata_migration |
Boolean |
Indicates whether metadata migration is enabled. The default value is false. Even if this function is disabled, the ContentType metadata will still be migrated to ensure a successful migration. |
enable_restore |
Boolean |
Indicates whether to restore archive data in the source bucket. It takes a long time to restore archive data in the source bucket, which will greatly slow down the migration speed. You are advised to restore the archive objects before the migration. After this function is enabled, archive objects will be automatically restored and then migrated. By default, this function is disabled, archive objects will be ignored during the migration, and the information about these objects will be recorded in the list of failed objects. |
error_reason |
ErrorReasonResp object |
The task failure cause. The value is an empty string if the task is not in the Migration failed state. |
failed_num |
Long |
The number of objects that failed to be migrated. Minimum value: 0 Maximum value: 9223372036854775807 |
failed_object_record |
FailedObjectRecordDto object |
The records of the objects that failed to be migrated. If the record is successful, the path for storing the list of failed objects is displayed. If the record fails, the failure cause is displayed. |
group_id |
String |
The ID of migration task group to which the task belongs. If a task is created by a migration task group, the ID of the migration task group is included. Minimum length: 0 characters Maximum length: 36 characters |
id |
Long |
The task ID. Minimum value: 0 Maximum value: 999999999999999 |
is_query_over |
Boolean |
Indicates whether the source object statistics are scanned for the migration task. |
left_time |
Long |
The remaining time (in milliseconds) of the task. Minimum value: 0 Maximum value: 9223372036854775807 |
migrate_since |
Long |
The specified migration time (timestamp, in milliseconds). Only source objects that are modified after the specified time will be migrated. Default value 0 indicates that no time is specified. Minimum value: 0 Maximum value: 9223372036854775807 |
migrate_speed |
Long |
The migration speed (byte/s). Minimum value: 0 Maximum value: 9223372036854775807 |
name |
String |
The task name. Minimum length: 0 characters Maximum length: 10,240 characters |
progress |
Double |
The task progress. For example, 0.522 represents the progress is 52.2%, and 1 represents the progress is 100%. Minimum value: 0 Maximum value: 1 |
real_size |
Long |
The total size (in bytes) of the migrated objects. The size of ignored objects is not counted. Minimum value: 0 Maximum value: 9223372036854775807 |
skipped_num |
Long |
The number of objects that are skipped during the migration. The following objects will be skipped: objects whose last modification time is earlier than the specified migration time, and objects that exist in the destination bucket. Minimum value: 0 Maximum value: 9223372036854775807 |
src_node |
SrcNodeResp object |
The source node information. |
start_time |
Long |
The start time (UNIX timestamp, in milliseconds) of the migration task. Minimum value: 0 Maximum value: 9223372036854775807 |
status |
Integer |
The task status. 1: Waiting, 2: Migrating, 3: Paused, 4: Failed, 5: Succeeded, 7: Pausing Minimum value: 1 Maximum value: 7 |
successful_num |
Long |
The number of successfully migrated objects. Minimum value: 0 Maximum value: 9223372036854775807 |
task_type |
String |
The task type. list indicates migrating objects using an object list. object indicates migrating selected files or folders. prefix indicates migrating objects with specified prefixes. url_list indicates migrating objects using a URL object list. Default value: object The value can be: |
group_type |
String |
The task group type. NORMAL_TASK indicates a general migration task. SYNC_TASK indicates a migration task to which a synchronization task belongs. GROUP_TASK indicates a subtask in a migration task group. Default value: NORMAL_TASK The value can be: |
total_num |
Long |
The total number of the objects that have been migrated in the task. Minimum value: 0 Maximum value: 9223372036854775807 |
total_size |
Long |
The size (in bytes) of the objects that have been migrated in the task. Minimum value: 0 Maximum value: 9223372036854775807 |
total_time |
Long |
The total time used (in milliseconds). Minimum value: 0 Maximum value: 9223372036854775807 |
smn_info |
SmnInfo object |
The SMN notification results. |
source_cdn |
SourceCdnResp object |
Indicates whether migration from CDN is enabled. If it is enabled, the source objects to be migrated are obtained from the specified CDN domain name during migration. If this field is included, migration from CDN is supported. Otherwise, it is not supported. |
success_record_error_reason |
String |
The error code returned for the failure in recording the list of objects that are successfully migrated. If the list is recorded successfully, this parameter is left blank. Minimum length: 0 characters Maximum length: 255 characters |
skip_record_error_reason |
String |
The error code returned for the failure in recording the list of objects that are ignored. If the list is recorded successfully, this parameter is left blank. Minimum length: 0 characters Maximum length: 255 characters |
object_overwrite_mode |
String |
Indicates whether to skip a source object or allow the source object to overwrite its paired destination object. The default value is SIZE_LAST_MODIFIED_COMPARISON_OVERWRITE. NO_OVERWRITE: indicates the system never allows overwrite. The system always skips source objects and keeps their paired destination objects. SIZE_LAST_MODIFIED_COMPARISON_OVERWRITE: indicates the system allows overwrite based on the results of size or modification time checks. It is the default setting. If a source object is not as large as or was last modified more recently than its paired destination object, the source object will overwrite the destination object. Otherwise, the source object will be skipped. CRC64_COMPARISON_OVERWRITE: indicates the system allows overwrite if the source and destination objects have different CRC64 checksums. This option is only available for migration on Huawei Cloud or from Alibaba Cloud or Tencent Cloud. If a source object has a CRC64 checksum different from the paired destination object, the source object will overwrite the destination object. Otherwise, the source object will be skipped. If one of them does not have a CRC64 checksum, their sizes and last modification times are checked. FULL_OVERWRITE: indicates the system always allows overwrite. The system always allows source objects to overwrite their paired destination objects. The value can be: |
dst_storage_policy |
String |
The destination storage class. STANDARD indicates the Huawei Cloud OBS Standard. IA indicates the Huawei Cloud OBS Infrequent Access. ARCHIVE indicates the Huawei Cloud OBS Archive. DEEP_ARCHIVE indicates the Huawei Cloud OBS Deep Archive. SRC_STORAGE_MAPPING converts the source storage class into an OBS storage class based on the predefined rules. Default value: STANDARD Minimum length: 0 characters Maximum length: 128 characters The value can be: |
consistency_check |
String |
The consistency check method, which is used to check whether objects are consistent before and after migration. The selected check method and results will be recorded in the object list. The default value is size_last_modified. size_last_modified: It is the default setting. The system checks object consistency with object size and last modification time. If a source object is as large as but was last modified earlier than its paired destination object, the system considers the source object does not need to be migrated or has been already migrated successfully. crc64: This option is only available for migration on Huawei Cloud or from Alibaba Cloud or Tencent Cloud. If a source object and its paired destination object have CRC64 checksums, the checksums are checked. Otherwise, their sizes and last modification times are checked. no_check: This option is only available for migration of HTTP/HTTPS data. This option takes effect for source objects whose sizes cannot be obtained using the content-length field in the standard HTTP protocol. These source objects will overwrite their paired destination objects directly. If the size of a source object can be obtained, its size and last modification time will be checked. The value can be: |
enable_requester_pays |
Boolean |
Indicates whether to let the requester make payment. After this function is enabled, the requester pays for the request and data transmission. |
task_priority |
String |
The task priority. Default value: MEDIUM The value can be: |
Parameter |
Type |
Description |
---|---|---|
end |
String |
The end time of the traffic limiting rule. The format is hh:mm, for example, 12:03. |
max_bandwidth |
Long |
The maximum traffic bandwidth allowed in the specified time period. The unit is byte/s. The value ranges from 1,048,576 bytes/s (equivalent to 1 MB/s) to 209,715,200 bytes/s (equivalent to 200 MB/s). Minimum value: 1048576 Maximum value: 209715200 |
start |
String |
The start time of the traffic limiting rule. The format is hh:mm, for example, 12:03. |
Parameter |
Type |
Description |
---|---|---|
bucket |
String |
The name of the destination bucket. Maximum length: 1,024 characters |
region |
String |
The region where the destination bucket is located. The value must be the same as that of the service endpoint. Minimum length: 0 characters Maximum length: 100 characters |
save_prefix |
String |
The path prefix in the destination bucket. The prefix is added before an object key to form a new key. The length of the new key cannot exceed 1,024 characters. Minimum length: 0 characters Maximum length: 1,024 characters |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
The error code returned for a migration failure. Minimum length: 0 characters Maximum length: 10 characters |
error_msg |
String |
The migration failure cause. Minimum length: 0 characters Maximum length: 1,024 characters |
Parameter |
Type |
Description |
---|---|---|
result |
Boolean |
Indicates whether to retransmit failed objects. |
list_file_key |
String |
The path for storing the list of failed objects. Minimum length: 0 characters Maximum length: 1,024 characters |
error_code |
String |
The error code returned when the list of failed objects fails to be uploaded. Minimum length: 0 characters Maximum length: 10 characters |
Parameter |
Type |
Description |
---|---|---|
bucket |
String |
The name of the source bucket. Minimum length: 0 characters Maximum length: 1,024 characters |
cloud_type |
String |
The source cloud service provider. The value can be AWS, Azure, Aliyun, Tencent, HuaweiCloud, QingCloud, KingsoftCloud, Baidu, Google, Qiniu, URLSource, or UCloud. The default value is Aliyun. The value can be: |
region |
String |
The region where the source bucket is located. Minimum length: 0 characters Maximum length: 100 characters |
app_id |
String |
This parameter is returned when cloud_type is Tencent. Minimum length: 0 characters Maximum length: 255 characters |
object_key |
Array of strings |
If the task_type is object, this parameter indicates the names of the objects to be migrated. If the task_type is prefix, this parameter indicates the name prefixes of the objects to be migrated. Minimum length: 0 characters Maximum length: 1,024 characters Array length: 0 to 500 |
list_file |
ListFile object |
The list file configuration. list_file is mandatory when task_type is set to list or url_list. |
Parameter |
Type |
Description |
---|---|---|
list_file_key |
String |
The object names in the object list file or URL list file. Minimum length: 1 character Maximum length: 1,024 characters |
obs_bucket |
String |
The name of the OBS bucket for storing the object list files. Ensure that the OBS bucket is in the same region as the destination bucket, or the task will fail to be created. Minimum length: 0 characters Maximum length: 1,024 characters |
list_file_num |
String |
The number of stored object list files. Minimum length: 0 characters Maximum length: 65,535 characters |
Parameter |
Type |
Description |
---|---|---|
notify_result |
Boolean |
Indicates whether the SMN messages are sent successfully after migration tasks are complete. |
notify_error_message |
String |
The error codes that record why the SMN messages failed to be sent. The value is empty if migration tasks are successful. Minimum length: 0 characters Maximum length: 1,024 characters |
topic_name |
String |
The SMN topic name. The value is empty if SMN messages are sent successfully. Minimum length: 0 characters Maximum length: 5,120 characters |
Parameter |
Type |
Description |
---|---|---|
domain |
String |
The domain name from which to obtain objects to be migrated. Minimum length: 0 characters Maximum length: 1,024 characters |
protocol |
String |
The protocol type. The value can be: |
authentication_type |
String |
The authentication type. The value can be: |
Status code: 404
Parameter |
Type |
Description |
---|---|---|
error_msg |
String |
The error message. |
error_code |
String |
The error code. |
Example Request
This example queries the details of task 191297407830872 in project 2c0689c860ad4728a497c91ec0844383.
GET https://{endpoint}/v2/2c0689c860ad4728a497c91ec0844383/tasks/191297407830872
Example Response
Status code: 200
OK
{ "bandwidth_policy" : [ { "end" : "23:59", "max_bandwidth" : 0, "start" : "00:00" } ], "complete_size" : 0, "description" : "test log", "dst_node" : { "bucket" : "dst_bucket", "region" : "cn-north-1" }, "enable_failed_object_recording" : true, "enable_kms" : true, "enable_restore" : false, "error_reason" : { "error_code" : "string", "error_msg" : "string" }, "failed_num" : 0, "failed_object_record" : { "result" : true, "list_file_key" : "string", "error_code" : "string" }, "group_id" : "string", "id" : 0, "is_query_over" : true, "left_time" : 0, "migrate_since" : 0, "migrate_speed" : 0, "name" : "string", "progress" : 0, "real_size" : 0, "skipped_num" : 0, "src_node" : { "bucket" : "src_bucket", "cloud_type" : "AWS", "region" : "cn-north-1", "app_id" : "string", "object_key" : [ "string", "string" ], "list_file" : { "list_file_key" : "object_list_file.txt", "obs_bucket" : "obs_bucket" } }, "start_time" : 0, "status" : 0, "successful_num" : 0, "task_type" : "list", "total_num" : 0, "total_size" : 0, "total_time" : 0, "smn_info" : { "notify_result" : true, "notify_error_message" : "string", "topic_name" : "string" }, "source_cdn" : { "domain" : "xxx.xxx.xxx", "protocol" : "http", "authentication_type" : "string" } }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
404 |
Not Found |
Error Codes
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot