Updated on 2024-09-12 GMT+08:00

Starting a Migration Task

Function

This API is used to start a migration task when the migration task is paused or failed.

Calling Method

For details, see Calling APIs.

URI

POST /v2/{project_id}/tasks/{task_id}/start

Table 1 Path parameters

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 migration task ID.

Minimum length: 1 character

Maximum length: 1,024 characters

Request

Table 2 Request header parameter

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

The token used for IAM authentication.

Minimum length: 1 character

Maximum length: 16,384 characters

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

src_ak

No

String

The AK for accessing the source node. Enter a maximum of 100 characters. This parameter is not required for URL list-based migration tasks.

Minimum length: 1 character

Maximum length: 100 characters

src_sk

No

String

The SK for accessing the source node. Enter a maximum of 100 characters. This parameter is not required for URL list-based migration tasks.

Minimum length: 1 character

Maximum length: 100 characters

json_auth_file

No

String

The file used for Google Cloud Storage authentication.

Minimum length: 0 characters

Maximum length: 65,535 characters

src_security_token

No

String

The temporary token for accessing the source node.

Minimum length: 0 characters

Maximum length: 16,384 characters

dst_ak

Yes

String

The AK for accessing the destination node.

Minimum length: 1 character

Maximum length: 100 characters

dst_sk

Yes

String

The SK for accessing the destination node.

Minimum length: 1 character

Maximum length: 100 characters

dst_security_token

No

String

The temporary token for accessing the destination node.

Minimum length: 0 characters

Maximum length: 16,384 characters

source_cdn_authentication_key

No

String

The CDN authentication key.

Minimum length: 0 characters

Maximum length: 255 characters

migrate_failed_object

No

Boolean

Indicates whether to migrate all objects in the migration task. The default value is false (full migration). If the value is true, only failed objects will be migrated again. If the value is blank or false, all objects in the migration task will be migrated again.

Default value: false

Response

Status code: 400

Table 4 Response body parameters

Parameter

Type

Description

error_msg

String

The error message.

error_code

String

The error code.

Example Request

  • This example starts a suspended non-URL list migration task using the AK/SK pairs of the source and destination accounts.

    POST https://{endpoint}/v2/{project_id}/tasks/{task_id}/start
    
    {
      "src_ak" : "src_ak",
      "src_sk" : "src_sk",
      "dst_ak" : "dst_ak",
      "dst_sk" : "dst_sk",
      "migrate_failed_object" : false
    }
  • This example starts a suspended URL list migration task using the AK/SK pairs of the source and destination accounts.

    POST https://{endpoint}/v2/{project_id}/tasks/{task_id}/start
    
    {
      "dst_ak" : "dst_ak",
      "dst_sk" : "dst_sk",
      "migrate_failed_object" : false
    }

Example Response

None

Status Codes

Status Code

Description

200

OK

400

Bad Request

Error Codes

For details, see Error Codes.