Updating the Traffic Limit Rule of a Migration Task

Function

This API is used to update the traffic limit rules of a migration task before it is complete.

Debugging

You can debug this API in API Explorer.

URI

PUT /v2/{project_id}/tasks/{task_id}/bandwidth-policy

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

Minimum length: 1 character

Maximum length: 1,024 characters

task_id

Yes

Long

Specifies the task ID.

Minimum value: 0

Maximum value: 999999999999999

Request

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the token used for IAM authentication.

Minimum length: 1 character

Maximum length: 16,384 characters

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

bandwidth_policy

Yes

Array of BandwidthPolicyDto objects

Specifies the traffic limit rules. Each element in the array corresponds to the maximum bandwidth of a time segment. A maximum of five time segments are allowed, and the time segments must not overlap.

Table 4 BandwidthPolicyDto field description

Parameter

Mandatory

Type

Description

end

Yes

String

Specifies the end time of the traffic limit rule. The format is hh:mm, for example, 12:03.

max_bandwidth

Yes

Long

Specifies the maximum traffic bandwidth allowed in the specified time segment. The unit is byte/s. The value ranges from 1048576 bytes/s (equivalent to 1 MB/s) to 209715200 bytes/s (equivalent to 200 MB/s).

Minimum value: 1048576

Maximum value: 209715200

start

Yes

String

Specifies the start time of the traffic limit rule. The format is hh:mm, for example: 12:03.

Response

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_msg

String

Specifies the error message.

error_code

String

Specifies the error code.

Example Request

For the task whose ID is xxxxxxxx, set start to 00:01, end to 23:59, and max_bandwidth to 50000000 byte/s.

/v2/{project_id}/tasks/xxxxxxxx/bandwidth-policy

{
  "bandwidth_policy" : [ {
    "start" : "00:01",
    "end" : "23:59",
    "max_bandwidth" : 50000000
  } ]
}

Example Response

None

Status Codes

Status Code

Description

200

OK

400

Bad Request

Error Codes

See Error Codes.