Help Center/ Server Migration Service/ API Reference/ APIs V3.0/ Task Management/ Setting Migration Rate Limit Rules for a Migration Task
Updated on 2024-09-04 GMT+08:00

Setting Migration Rate Limit Rules for a Migration Task

Function

This API is used to set migration rate limit rules for a migration task.

Calling Method

For details, see Calling APIs.

URI

POST /v3/tasks/{task_id}/speed-limit

Table 1 Path parameter

Parameter

Mandatory

Type

Description

task_id

Yes

String

The migration task ID.

Minimum length: 0 characters

Maximum length: 255 characters

Request

Table 2 Request header parameter

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

The user token. It can be obtained by calling the IAM API (value of X-Subject-Token in the response header).

Minimum length: 1 character

Maximum length: 16,384 characters

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

speed_limit

Yes

Array of SpeedLimitlJson objects

The information about the time segments when the migration rate is limited.

Array length: 0 to 65,535 characters

Table 4 SpeedLimitlJson field description

Parameter

Mandatory

Type

Description

start

Yes

String

The start time of a segment. The format is XX:XX.

Minimum length: 0 characters

Maximum length: 255 characters

end

Yes

String

The end time of a segment. The format is XX:XX.

Minimum length: 0 characters

Maximum length: 255 characters

speed

Yes

Integer

The migration rate limit for the specified period of time. The value is an integer ranging from 0 to 1000. The unit is Mbit/s.

Minimum value: 0

Maximum value: 10000

Response

None

Example Request

  • This example limits the migration speed of a migration task to 20 Mbit/s from 0:00 to 8:00, 50 Mbit/s from 8:00 to 15:00, and 25 Mbit/s from 15:00 to 23:59.

    POST https://{endpoint}/v3/tasks/7a9a9540-ff28-4869-b9e4-855fbe12xxxx/speed-limit
    
    {
      "speed_limit" : [ {
        "start" : "00:00",
        "end" : "23:59",
        "speed" : 0
      } ]
    }
  • This example updates the migration rate limit rules of the task whose ID is a45a300b-86b5-4b13-8802-52274fa43016.

    POST https://{endpoint}/v3/tasks/a45a300b-86b5-4b13-8802-52274fa43016/speed-limit
    
    {
      "speed_limit" : [ {
        "start" : "0:00",
        "end" : "8:00",
        "speed" : 20
      }, {
        "start" : "8:00",
        "end" : "15:00",
        "speed" : 50
      }, {
        "start" : "15:00",
        "end" : "23:59",
        "speed" : 25
      } ]
    }

Example Response

None

Status Codes

Status Code

Description

200

Response returned.

Error Codes

For details, see Error Codes.