Setting Migration Rate Limiting Rules for a Migration Task
Function
This API is used to set migration rate limiting rules for a migration task.
Calling Method
For details, see Calling APIs.
URI
POST /v3/tasks/{task_id}/speed-limit
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
task_id |
Yes |
String |
The migration task ID. Minimum: 1 Maximum: 36 |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
User token. The token can be obtained by calling the IAM API for obtaining a user token. The value of X-Subject-Token in the response header is the user token. Minimum: 1 Maximum: 16384 |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
speed_limit |
Yes |
Array of SpeedLimitlJson objects |
The information about the time range-based migration rate limiting rules. Array Length: 0 - 5 |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
start |
Yes |
String |
The start time of a period. The format is XX:XX. Minimum: 0 Maximum: 255 |
|
end |
Yes |
String |
The end time of a period. The format is XX:XX. Minimum: 0 Maximum: 255 |
|
speed |
No |
Integer |
The migration rate limit for the specified period of time. The value is an integer ranging from 0 to 1,000. The unit is Mbit/s. Minimum: 0 Maximum: 1000 Default: 0 |
|
over_speed_threshold |
No |
Double |
The overspeed threshold for stopping migration. This is a protection measure. If the migration speed exceeds the threshold, the task is stopped. It is used to control the consumption of resources (especially network bandwidth) during the migration to ensure that the overall system performance is not affected by a single migration task. The unit is percentage. Minimum: 10 Maximum: 100 Default: 10 |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
- |
String |
Setting migration rate limiting rules for a migration task succeeded. |
Status code: 403
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
The error code. Minimum: 0 Maximum: 255 |
|
error_msg |
String |
The error message. Minimum: 0 Maximum: 255 |
|
encoded_authorization_message |
String |
The encrypted authorization information. Minimum: 0 Maximum: 65535 |
|
error_param |
Array of strings |
Error parameters. Minimum: 0 Maximum: 65535 Array Length: 1 - 20 |
|
details |
Array of details objects |
The error details. Array Length: 1 - 20 |
Example Requests
-
This example limits the 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. It also sets an overspeed threshold for the task.
POST https://{endpoint}/v3/tasks/7a9a9540-ff28-4869-b9e4-855fbe12xxxx/speed-limit { "speed_limit" : [ { "start" : "00:00", "end" : "23:59", "speed" : 1000, "over_speed_threshold" : 50.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 Responses
Status code: 200
Setting migration rate limiting rules for a migration task succeeded.
{ }
Status code: 403
Authentication failed.
{
"error_code" : "SMS.9004",
"error_msg" : "The current account does not have the permission to execute policy. You do not have permission to perform action XXX on resource XXX.",
"encoded_authorization_message" : "XXXXXX",
"error_param" : [ "You do not have permission to perform action XXX on resource XXX." ],
"details" : [ {
"error_code" : "SMS.9004",
"error_msg" : "You do not have permission to perform action XXX on resource XXX."
} ]
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Setting migration rate limiting rules for a migration task succeeded. |
|
403 |
Authentication failed. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.