Updated on 2025-11-18 GMT+08:00

Querying a Migration Task Group

Function

This API is used to query the details about a migration task group with a specified ID.

Calling Method

For details, see Calling APIs.

Authorization

Each account has all of the permissions required to call all APIs, but IAM users must have the required permissions specifically assigned.

  • If you are using role/policy-based authorization, see the required permissions in Permissions and Supported Actions.
  • If you are using identity policy-based authorization, the permission listed below is required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    oms:taskgroup:get

    Read

    taskgroup *

    -

    -

    -

URI

GET /v2/{project_id}/taskgroups/{group_id}

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

The project ID.

Minimum length: 1 character

Maximum length: 1,024 characters

group_id

Yes

String

The task group ID.

Minimum length: 1 character

Maximum length: 1,024 characters

Request

Table 2 Request header parameters

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

Table 3 Response body parameters

Parameter

Type

Description

group_id

String

The task group ID.

Minimum length: 1 character

Maximum length: 100 characters

status

Integer

The migration task group status.

0: waiting

1: executing/creating

2: running monitor task

3: paused

4: creation failed

5: migration failed

6: migration completed

7: pausing

8: waiting for deletion

9: deleting

Minimum value: 0

Maximum value: 9

error_reason

ErrorReasonResp object

The task group failure cause. The value is an empty string if the task is not in the Migration failed state.

src_node

TaskGroupSrcNodeResp object

The source information.

description

String

The task group description, which cannot exceed 255 characters. The following special characters are not allowed: ^<>&"'

Minimum length: 0 characters

Maximum length: 255 characters

dst_node

TaskGroupDstNodeResp object

The destination information.

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.

Default value: false

enable_failed_object_recording

Boolean

Whether the function of recording failed objects is enabled.

enable_restore

Boolean

Whether automatic restoration of archived data is enabled. It takes a long time to restore archived data in the source bucket, which will greatly slow down the migration speed. You are advised to restore the archived data before the migration. If this function is enabled, archived objects will be automatically restored and then migrated. If this function is disabled, archived objects will be ignored during the migration, and their information will be recorded in the list of failed objects.

enable_kms

Boolean

Whether KMS is used to encrypt the data to be stored in the destination OBS bucket.

task_type

String

The task type. The default value is PREFIX.

LIST: migrates only the objects recorded in a predefined object list.

URL_LIST: migrates only the objects recorded in a predefined URL list.

PREFIX: migrates only the objects that match the specified prefixes.

Enumerated values:

  • LIST

  • URL_LIST

  • PREFIX

bandwidth_policy

Array of BandwidthPolicyDto objects

The traffic limiting rules. Each element in the array corresponds to the maximum bandwidth in a time period. A maximum of five periods are allowed, and the periods cannot overlap.

Array length: 0 to 5

smn_config

SmnInfo object

The configuration of SMN message sending.

source_cdn

SourceCdnResp object

Whether migration from CDN is enabled. If this field is included, migration from CDN is supported. Otherwise, it is not supported. If migration from CDN is enabled, the source objects to be migrated are obtained from the specified CDN domain name during migration.

migrate_since

Long

A timestamp in milliseconds. Only source objects that are modified after the specified timestamp will be migrated. The default value 0 indicates that no time is specified.

Minimum value: 0

Maximum value: 9223372036854775807

Default value: 0

migrate_speed

Long

The migration speed (byte/s).

Minimum value: 0

Maximum value: 9223372036854775807

total_time

Long

The total time used by the migration task group, in milliseconds.

Minimum value: 0

Maximum value: 9223372036854775807

start_time

Long

The start time (Unix timestamp, in milliseconds) of the migration task group.

Minimum value: 0

Maximum value: 9223372036854775807

total_task_num

Long

The total number of migration tasks in the task group.

Minimum value: 0

Maximum value: 9223372036854775807

create_task_num

Long

The number of created migration tasks in the task group.

Minimum value: 0

Maximum value: 9223372036854775807

failed_task_num

Long

The number of failed migration tasks in the task group.

Minimum value: 0

Maximum value: 9223372036854775807

complete_task_num

Long

The number of completed migration tasks in the task group.

Minimum value: 0

Maximum value: 9223372036854775807

paused_task_num

Long

The number of paused migration tasks in the task group.

Minimum value: 0

Maximum value: 9223372036854775807

executing_task_num

Long

The number of migration tasks being executed in the task group.

Minimum value: 0

Maximum value: 9223372036854775807

waiting_task_num

Long

The number of waiting migration tasks in the task group.

Minimum value: 0

Maximum value: 9223372036854775807

total_num

Long

The total number of objects to be migrated in the migration task group.

Minimum value: 0

Maximum value: 9223372036854775807

create_complete_num

Long

The total number of objects included in the created migration tasks.

Minimum value: 0

Maximum value: 9223372036854775807

success_num

Long

The number of migrated objects.

Minimum value: 0

Maximum value: 9223372036854775807

fail_num

Long

The number of failed objects.

Minimum value: 0

Maximum value: 9223372036854775807

skip_num

Long

The number of skipped objects.

Minimum value: 0

Maximum value: 9223372036854775807

total_size

Long

The size (in bytes) of the objects that have been migrated.

Minimum value: 0

Maximum value: 9223372036854775807

create_complete_size

Long

The total size (in bytes) of objects migrated in the created migration tasks.

Minimum value: 0

Maximum value: 9223372036854775807

complete_size

Long

The total size of migrated objects, in bytes.

Minimum value: 0

Maximum value: 9223372036854775807

failed_object_record

FailedObjectRecordDto object

The record of failed objects.

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:

  • NO_OVERWRITE

  • SIZE_LAST_MODIFIED_COMPARISON_OVERWRITE

  • CRC64_COMPARISON_OVERWRITE

  • FULL_OVERWRITE

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:

  • STANDARD

  • IA

  • ARCHIVE

  • DEEP_ARCHIVE

  • SRC_STORAGE_MAPPING

consistency_check

String

The method for checking whether objects are consistent before and 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 does not need to be migrated or has been already migrated successfully. crc64: This value is only available for migration within Huawei Cloud or from Alibaba Cloud or Tencent Cloud. 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. These source objects will overwrite their paired destination objects directly. 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:

  • size_last_modified

  • crc64

  • no_check

enable_requester_pays

Boolean

Whether Requester Pays is enabled. If this function is enabled, the requester pays for the request and data transmission.

Table 4 ErrorReasonResp

Parameter

Type

Description

error_code

String

The error code returned when a migration fails.

Minimum length: 0 characters

Maximum length: 10 characters

error_msg

String

The migration failure cause.

Minimum length: 0 characters

Maximum length: 1,024 characters

Table 5 TaskGroupSrcNodeResp

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, QINIU, GOOGLE, URLSOURCE, or UCLOUD. The default value is ALIYUN.

Enumerated values:

  • AWS

  • AZURE

  • ALIYUN

  • TENCENT

  • HUAWEICLOUD

  • QINGCLOUD

  • KINGSOFTCLOUD

  • BAIDU

  • QINIU

  • URLSOURCE

  • UCLOUD

  • GOOGLE

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 task_type is set to prefix, this parameter indicates the name prefixes of objects to be migrated.

Minimum length: 0 characters

Maximum length: 1,024 characters

Array length: 0 to 500

list_file

ListFile object

The configurations of the list file. This parameter is mandatory when task_type is set to list or url_list.

Table 6 ListFile

Parameter

Type

Description

list_file_key

String

The object names in the object or URL list file.

Minimum length: 1 character

Maximum length: 1,024 characters

obs_bucket

String

The name of the OBS bucket for storing object list files.

Ensure that this bucket is in the same region as the destination bucket, or the task creation will fail.

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

Table 7 TaskGroupDstNodeResp

Parameter

Type

Description

bucket

String

The name of the destination bucket.

Minimum length: 0 characters

Maximum length: 1,024 characters

region

String

The region where the destination bucket is located.

Minimum length: 0 characters

Maximum length: 100 characters

save_prefix

String

The path prefix used to organize object locations 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

Table 8 BandwidthPolicyDto

Parameter

Type

Description

end

String

The time when traffic limiting is ended. The format is hh:mm, for example, 12:03.

max_bandwidth

Long

The maximum traffic bandwidth allowed in the specified 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 time when traffic limiting is started. The format is hh:mm, for example, 12:03.

Table 9 SmnInfo

Parameter

Type

Description

notify_result

Boolean

Whether SMN messages are sent successfully after a migration task is complete.

notify_error_message

String

The error codes presenting why SMN messages failed to be sent. The value is empty if the migration task is 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

Table 10 SourceCdnResp

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:

  • http

  • https

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:

  • NONE

  • QINIU_PRIVATE_AUTHENTICATION

  • ALIYUN_OSS_A

  • ALIYUN_OSS_B

  • ALIYUN_OSS_C

  • KSYUN_PRIVATE_AUTHENTICATION

  • AZURE_SAS_TOKEN

  • TENCENT_COS_A

  • TENCENT_COS_B

  • TENCENT_COS_C

  • TENCENT_COS_D

Table 11 FailedObjectRecordDto

Parameter

Type

Description

result

Boolean

Whether retransmission of failed objects is supported.

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

Status code: 404

Table 12 Response body parameters

Parameter

Type

Description

error_msg

String

The error message.

error_code

String

The error code.

Example Request

This example queries the information about the migration task group 157ece42-3270-4824-a3d2-f0187a03ca01 in the project f4e146cac1de45669c3fed73dc3b9c6f.

Get https://{endpoint}/v2/f4e146cac1de45669c3fed73dc3b9c6f/taskgroups/157ece42-3270-4824-a3d2-f0187a03ca01

Example Response

Status code: 200

OK

{
  "group_id" : "9522a7e5-b4fc-44b9-93e1-4dbadbd86e67",
  "status" : 3,
  "error_reason" : null,
  "src_node" : {
    "bucket" : "dst-test-001",
    "cloud_type" : "HUAWEICLOUD",
    "region" : "cn-north-7",
    "app_id" : "",
    "object_key" : [ "" ],
    "list_file" : null
  },
  "description" : "",
  "dst_node" : {
    "bucket" : "assess-bucket-1",
    "region" : "cn-north-7",
    "save_prefix" : ""
  },
  "enable_metadata_migration" : false,
  "enable_failed_object_recording" : true,
  "enable_restore" : false,
  "enable_kms" : false,
  "task_type" : "PREFIX",
  "bandwidth_policy" : [ ],
  "smn_config" : null,
  "source_cdn" : null,
  "migrate_since" : 0,
  "migrate_speed" : 0,
  "total_time" : 7907369,
  "start_time" : 1659937788779,
  "total_task_num" : null,
  "create_task_num" : null,
  "failed_task_num" : null,
  "complete_task_num" : null,
  "paused_task_num" : null,
  "executing_task_num" : null,
  "waiting_task_num" : null,
  "total_num" : 4128588,
  "create_complete_num" : null,
  "success_num" : 0,
  "fail_num" : 0,
  "skip_num" : 0,
  "total_size" : 27814708666,
  "create_complete_size" : null,
  "complete_size" : 0,
  "failed_object_record" : {
    "result" : null,
    "list_file_key" : null,
    "error_code" : null
  },
  "object_overwrite_mode" : "SIZE_LAST_MODIFIED_COMPARISON_OVERWRITE",
  "consistency_check" : "size_last_modified",
  "enable_requester_pays" : false
}

SDK Sample Code

The following shows the sample SDK code.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.huaweicloud.sdk.test;

import com.huaweicloud.sdk.core.auth.ICredential;
import com.huaweicloud.sdk.core.auth.BasicCredentials;
import com.huaweicloud.sdk.core.exception.ConnectionException;
import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
import com.huaweicloud.sdk.core.exception.ServiceResponseException;
import com.huaweicloud.sdk.oms.v2.region.OmsRegion;
import com.huaweicloud.sdk.oms.v2.*;
import com.huaweicloud.sdk.oms.v2.model.*;


public class ShowTaskGroupSolution {

    public static void main(String[] args) {
        // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
        // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
        String ak = System.getenv("CLOUD_SDK_AK");
        String sk = System.getenv("CLOUD_SDK_SK");
        String projectId = "{project_id}";

        ICredential auth = new BasicCredentials()
                .withProjectId(projectId)
                .withAk(ak)
                .withSk(sk);

        OmsClient client = OmsClient.newBuilder()
                .withCredential(auth)
                .withRegion(OmsRegion.valueOf("<YOUR REGION>"))
                .build();
        ShowTaskGroupRequest request = new ShowTaskGroupRequest();
        request.withGroupId("{group_id}");
        try {
            ShowTaskGroupResponse response = client.showTaskGroup(request);
            System.out.println(response.toString());
        } catch (ConnectionException e) {
            e.printStackTrace();
        } catch (RequestTimeoutException e) {
            e.printStackTrace();
        } catch (ServiceResponseException e) {
            e.printStackTrace();
            System.out.println(e.getHttpStatusCode());
            System.out.println(e.getRequestId());
            System.out.println(e.getErrorCode());
            System.out.println(e.getErrorMsg());
        }
    }
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# coding: utf-8

import os
from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkoms.v2.region.oms_region import OmsRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkoms.v2 import *

if __name__ == "__main__":
    # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak = os.environ["CLOUD_SDK_AK"]
    sk = os.environ["CLOUD_SDK_SK"]
    projectId = "{project_id}"

    credentials = BasicCredentials(ak, sk, projectId)

    client = OmsClient.new_builder() \
        .with_credentials(credentials) \
        .with_region(OmsRegion.value_of("<YOUR REGION>")) \
        .build()

    try:
        request = ShowTaskGroupRequest()
        request.group_id = "{group_id}"
        response = client.show_task_group(request)
        print(response)
    except exceptions.ClientRequestException as e:
        print(e.status_code)
        print(e.request_id)
        print(e.error_code)
        print(e.error_msg)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main

import (
	"fmt"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
    oms "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/oms/v2"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/oms/v2/model"
    region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/oms/v2/region"
)

func main() {
    // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak := os.Getenv("CLOUD_SDK_AK")
    sk := os.Getenv("CLOUD_SDK_SK")
    projectId := "{project_id}"

    auth := basic.NewCredentialsBuilder().
        WithAk(ak).
        WithSk(sk).
        WithProjectId(projectId).
        Build()

    client := oms.NewOmsClient(
        oms.OmsClientBuilder().
            WithRegion(region.ValueOf("<YOUR REGION>")).
            WithCredential(auth).
            Build())

    request := &model.ShowTaskGroupRequest{}
	request.GroupId = "{group_id}"
	response, err := client.ShowTaskGroup(request)
	if err == nil {
        fmt.Printf("%+v\n", response)
    } else {
        fmt.Println(err)
    }
}

For SDK code examples in more programming languages, visit API Explorer and click the Sample Code tab. Example code can be automatically generated.

Status Codes

Status Code

Description

200

OK

404

Not Found

Error Codes

For details, see Error Codes.