Listing Synchronization Tasks
Function
This API is used to list all synchronization tasks in an account.
Calling Method
For details, see Calling APIs.
URI
GET /v2/{project_id}/sync-tasks
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
The project ID. Minimum length: 1 character Maximum length: 1,024 characters |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
limit |
No |
Integer |
The maximum number of synchronization tasks displayed on one page. By default, 10 synchronization tasks are displayed on one page. A maximum of 100 migration tasks can be returned. Minimum value: 1 Maximum value: 100 Default value: 10 |
|
offset |
No |
Integer |
The start serial number of synchronization tasks. The default value is 0. The value must be greater than or equal to 0. If this parameter is set to 0, the query starts from the first record. Minimum value: 0 Maximum value: 10000 Default value: 0 |
|
status |
No |
String |
The synchronization task status. If this parameter is not specified, tasks in all statuses are queried. SYNCHRONIZING: being synchronizing STOPPED: already stopped Minimum length: 0 characters Maximum length: 255 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 |
|---|---|---|
|
tasks |
Array of SyncTaskInfo objects |
The details of queried synchronization tasks. Array length: 0 to 100 |
|
count |
Long |
The total number of synchronization tasks that meet the query criteria. Minimum value: 0 Maximum value: 9223372036854775807 |
|
Parameter |
Type |
Description |
|---|---|---|
|
sync_task_id |
String |
The synchronization task ID. Minimum length: 0 characters Maximum length: 255 characters |
|
src_cloud_type |
String |
The source cloud service provider. The value can be AWS, Azure, Aliyun, Tencent, HuaweiCloud, QingCloud, KingsoftCloud, Baidu, Qiniu, or UCloud. The default value is Aliyun. Enumerated values: |
|
src_region |
String |
The region where the source bucket is located. Minimum length: 0 characters Maximum length: 100 characters |
|
src_bucket |
String |
The name of the source bucket. Minimum length: 0 characters Maximum length: 1,024 characters |
|
create_time |
Long |
The time (Unix timestamp, in milliseconds) when the synchronization task was created. Minimum value: 0 Maximum value: 9223372036854775807 |
|
last_start_time |
Long |
The most recent time (Unix timestamp, in milliseconds) when the synchronization task was started. Minimum value: 0 Maximum value: 9223372036854775807 |
|
dst_bucket |
String |
The name of the destination bucket. Minimum length: 0 characters Maximum length: 1,024 characters |
|
dst_region |
String |
The region where the destination bucket is located. Minimum length: 0 characters Maximum length: 100 characters |
|
description |
String |
The task description, which cannot exceed 255 characters. The following special characters are not allowed: <>()"'& Minimum length: 0 characters Maximum length: 255 characters |
|
status |
String |
The synchronization task status. SYNCHRONIZING: being synchronizing STOPPED: already stopped Enumerated values: |
|
enable_kms |
Boolean |
Whether KMS encryption is enabled. This function is disabled by default. |
|
enable_metadata_migration |
Boolean |
Whether metadata migration is enabled. This function is disabled by default. Even if this function is disabled, the Content-Type metadata will still be migrated to ensure a successful migration. |
|
enable_restore |
Boolean |
Whether automatic restoration of archived data is enabled. This function is disabled by default. If this function is enabled, archived data is automatically restored and migrated. |
|
app_id |
String |
This parameter is mandatory when cloud_type is Tencent. Minimum length: 0 characters Maximum length: 255 characters |
|
source_cdn |
SourceCdnResp object |
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 parameter is included, migration from CDN is supported. Otherwise, it is not supported. |
|
object_overwrite_mode |
String |
How a source object handles its paired destination object, either overwriting the object or skipping the migration. The default value is SIZE_LAST_MODIFIED_COMPARISON_OVERWRITE. NO_OVERWRITE: The system always skips source objects and keeps their paired destination objects. SIZE_LAST_MODIFIED_COMPARISON_OVERWRITE: The system allows overwriting based on the results of size or modification time checks. This is the default value. If a source object has the same name as the paired destination object, the system compares the sizes and last modification time of the source and destination objects to determine whether to overwrite the destination object. The encryption status of the source and destination objects must be the same. If the source object has a different size or was last modified more recently than its paired destination object, the destination object will be overwritten. CRC64_COMPARISON_OVERWRITE: The system allows overwriting if the source and destination objects have different CRC64 checksums. This option is only available for migration within Huawei Cloud or from Alibaba Cloud or Tencent Cloud. If a source object has a CRC64 checksum different from its paired destination object, the destination object will be overwritten. The encryption status of the source and destination objects must be the same. If there are no CRC64 checksums in the metadata, the SIZE_LAST_MODIFIED_COMPARISON_OVERWRITE value is used. FULL_OVERWRITE: The system always allows source objects to overwrite their paired destination objects. Enumerated values: |
|
dst_storage_policy |
String |
The destination storage class. This parameter is required only when the destination is Huawei Cloud OBS. The default value is STANDARD. STANDARD: Huawei Cloud OBS Standard storage IA: Huawei Cloud OBS Infrequent Access storage ARCHIVE: Huawei Cloud OBS Archive storage DEEP_ARCHIVE: Huawei Cloud OBS Deep Archive storage SRC_STORAGE_MAPPING: The source storage class is retained and mapped to Huawei Cloud OBS storage class. Default value: STANDARD Minimum length: 0 characters Maximum length: 128 characters Enumerated values: |
|
consistency_check |
String |
The method for checking whether objects are consistent after migration. The encryption status of the source and destination objects must be the same. The check method and results will be recorded in the object list. The default value is size_last_modified. size_last_modified (default): The system checks object consistency with object size and last modification time. If the source and destination objects have the same size and the destination's last modification time is not earlier than the source's, the system considers the source object has been already migrated successfully. crc64: This value is only available for migration within Huawei Cloud or from Alibaba Cloud or Tencent Cloud. After migration, if a source object and its paired destination object have CRC64 checksums in the metadata, the checksums are checked. Otherwise, their sizes and last modification times are checked. no_check: This value is only available for migration of HTTP/HTTPS data. This option takes effect for source objects whose sizes cannot be obtained from the Content-Length field in the standard HTTP protocol. In this case, the migration is considered successful once the data is downloaded successfully, without requiring additional data check. If the size of a source object can be obtained from the Content-Length field in the standard HTTP protocol, its size and last modification time will be checked. Enumerated values: |
|
Parameter |
Type |
Description |
|---|---|---|
|
domain |
String |
The domain name used to obtain objects to be migrated. Minimum length: 0 characters Maximum length: 1,024 characters |
|
protocol |
String |
The protocol type. HTTP and HTTPS are supported. Enumerated values: |
|
authentication_type |
String |
The authentication type. NONE: public access without authentication type QINIU_PRIVATE_AUTHENTICATION: Qiniu private URL signature ALIYUN_OSS_A: Alibaba Cloud URL signature, simple and universal ALIYUN_OSS_B: Alibaba Cloud header signature, used for API calling ALIYUN_OSS_C: Alibaba Cloud STS temporary security token, the most secure KSYUN_PRIVATE_AUTHENTICATION: Kingsoft Cloud private URL signature AZURE_SAS_TOKEN: Microsoft Azure shared access signature, flexible and secure TENCENT_COS_A: Tencent Cloud multi-signature scenarios (not recommended) TENCENT_COS_B: Tencent Cloud single-signature scenarios, the most secure TENCENT_COS_C: Tencent Cloud header signature, used for API calling TENCENT_COS_D: Tencent Cloud header signature, used for API calling Enumerated values: |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_msg |
String |
The error message. |
|
error_code |
String |
The error code. |
Example Request
This example queries five synchronization tasks in the 2c0689c860ad4728a497c91ec0844383 project.
GET https://{endpoint}/v2/2c0689c860ad4728a497c91ec0844383/sync-tasks?offset=0&limit=5&status=SYNCHRONIZING
Example Response
Status code: 200
OK
{
"tasks" : [ {
"sync_task_id" : "d18befdd-eb82-41f3-8019-bbb593d74a3e",
"src_cloud_type" : "HuaweiCloud",
"src_region" : "cn-north-7",
"src_bucket" : "oms-sdk-test-src",
"create_time" : 1700639560751,
"last_start_time" : 1700639560751,
"dst_bucket" : "oms-sdk-test-dst",
"dst_region" : "cn-north-7",
"description" : "sync task test",
"status" : "SYNCHRONIZING",
"enable_kms" : false,
"enable_metadata_migration" : false,
"enable_restore" : false,
"app_id" : null,
"source_cdn" : null,
"object_overwrite_mode" : "SIZE_LAST_MODIFIED_COMPARISON_OVERWRITE",
"dst_storage_policy" : null,
"consistency_check" : "size_last_modified"
} ],
"count" : 1
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
OK |
|
400 |
Bad request |
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.