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
| 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
| 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 |
| 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. |
| 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
| 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.
Last Article: Deleting a Migration Task
Next Article: SyncApi
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.