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
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
task_id |
Yes |
String |
The migration task ID. Minimum length: 0 characters Maximum length: 255 characters |
Request
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
X-Auth-Token The user token. The token can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. Minimum length: 1 character Maximum length: 16,384 characters |
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 |
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 |
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 value: 0 Maximum value: 100 |
Response
Status code: 200
Parameter |
Type |
Description |
---|---|---|
- |
String |
Setting migration rate limit rules for a migration task succeeded. |
Status code: 403
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
The error code. Minimum length: 0 characters Maximum length: 255 characters |
error_msg |
String |
The error message. Minimum length: 0 characters Maximum length: 255 characters |
encoded_authorization_message |
String |
Encrypted authorization information. Minimum length: 0 characters Maximum length: 65,535 characters |
error_param |
Array of strings |
Invalid parameter. Minimum length: 0 characters Maximum length: 65,535 characters Array length: 1 to 20 |
details |
Array of details objects |
The error message. Array length: 1 to 20 |
Example Request
-
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 Response
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 limit rules for a migration task succeeded. |
403 |
Authentication failed. |
Error Codes
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot