Setting Flow Control for Tasks

Function

This API is used to enable or disable flow control for tasks. By default, the migration speed is not limited after a task is created.

Constraints

URI

PUT /v3/{project_id}/jobs/batch-limit-speed

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

The content type.

The default value is application/json.

X-Auth-Token

Yes

String

User token obtained from IAM.

X-Language

No

String

Request language type

Default value: en-us

Values:

  • en-us
  • zh-cn
Table 3 Request body parameters

Parameter

Mandatory

Type

Description

speed_limits

Yes

Array of LimitSpeedReq objects

Speed limit in DR.

Table 4 LimitSpeedReq

Parameter

Mandatory

Type

Description

job_id

Yes

String

Task ID.

speed_limit

Yes

Array of SpeedLimitInfo objects

Request body of flow control information.

Table 5 SpeedLimitInfo

Parameter

Mandatory

Type

Description

begin

Yes

String

Start time (UTC) of flow control. The start time is an integer in hh:mm format and the minutes part is ignored. hh indicates the hour, for example, 01:00.

end

Yes

String

End time (UTC) in the format of hh:mm, for example, 15:59. The value must end with 59.

speed

Yes

String

Speed. The value ranges from 1 to 9,999, in MB/s.

is_utc

No

Boolean

Whether the UTC time is used.

Response Parameters

Status code: 200

Table 6 Response body parameters

Parameter

Type

Description

count

Integer

Total number.

results

Array of ModifyJobResp objects

List of tasks that are modified in batches.

Table 7 ModifyJobResp

Parameter

Type

Description

id

String

Task ID.

status

String

Status Values:

  • success: The task is successful.
  • failed: The task fails.

error_code

String

Error code, which is optional and indicates the returned information about the failure status.

error_msg

String

Error message, which is optional and indicates the returned information about the failure status.

Example Request

Example of setting flow control for DR tasks in batches:

https://{Endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/batch-limit-speed
{
  "speed_limits" : [ {
    "job_id" : "7d0504f1-aba3-435f-914f-936b861jb502",
    "speed_limit" : [ {
      "begin" : "16:00",
      "end" : "15:59",
      "speed" : "15"
    } ]
  } ]
}

Example Response

Status code: 200

OK

{
  "results" : [ {
    "id" : "efa2bd29-8780-494f-a2ee-188b003ejb11",
    "status" : "success"
  } ],
  "count" : 1
}

Status Code

Status Code

Description

200

OK

400

Bad Request

Error Code

For details, see Error Code.