Updated on 2023-12-27 GMT+08:00

Modifying a Traffic Limiting Rule

Function

This API is used to modify a traffic limiting rule of a migration task before it is completed.

URI

PUT /v1/{project_id}/objectstorage/task/{task_id}

Table 1 describes the parameters in the URI.

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

task_id

Yes

Specifies the task ID.

Request

Request Parameters

Table 2 describes the request parameters.

Table 2 Request parameters

Parameter

Mandatory

Type

Description

operation

Yes

String

Specifies the operation type, which is change_bandwidthpolicy for this API.

bandwidth_policy

No

JSONArray

Specifies the traffic limiting 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. For details, see Table 3.

Table 3 bandwidth_policy data structure

Parameter

Mandatory

Type

Description

start

Yes

String

Specifies the start time of a traffic limiting rule. The format is hh:mm. For example, 10:03

end

Yes

String

Specifies the end time of a traffic limiting rule. The format is the same as that of the start time.

max_bandwidth

Yes

int

Specifies the maximum bandwidth (byte/s) allowed in a time segment. The value range is from 5 Mbyte/s to 10 Gbyte/s.

Response

Response Parameters

None.

Examples

Request example

PUT /v1/{project_id}/objectstorage/task/{task_id}

{
  "operation": "change_bandwidthpolicy",
  "bandwidth_policy": [
    {
      "start": "00:00",
      "end": "23:59",
      "max_bandwidth": 50000000
    }
  ]
}

Response example

None

Status Code

For details about the status code, see Status Code.