Help Center/ Anti-DDoS/ API Reference/ API/ DDoS Protection Management/ Updating the Anti-DDoS Protection
Updated on 2025-10-09 GMT+08:00

Updating the Anti-DDoS Protection

Function

This API enables you to update the Anti-DDoS defense policy of a specified EIP. If this API is successfully called, it indicates that the service node receives the request for updating the Anti-DDoS policy of the EIP. To check whether the operation is successful, call the task query API to query the task execution status. For details, see "Querying Anti-DDoS Tasks".

Calling Method

For details, see Calling APIs.

URI

PUT /v1/{project_id}/antiddos/{floating_ip_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

floating_ip_id

Yes

String

ID corresponding to the EIP of a user.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

ip

No

String

ip

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

It 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.

Content-Type

Yes

String

Content-Type request header.

Table 4 Request body parameters

Parameter

Mandatory

Type

Description

app_type_id

Yes

Integer

Application type ID. The value is fixed to 0.

cleaning_access_pos_id

Yes

Integer

Position ID of access limit during cleaning. The options are as follows: 1: 10 Mbit/s; 2: 30 Mbit/s; 3: 50 Mbit/s; 4: 70 Mbit/s; 5: 100 Mbit/s; 6: 150 Mbit/s; 7: 200 Mbit/s; 8: 250 Mbit/s; 9: 300 Mbit/s; 10: 500 Mbit/s; 11: 800 Mbit/s;88: 1,000 Mbit/s; 99: default protection

enable_L7

Yes

Boolean

Whether to enable layer-7 protection. The value is fixed to false.

http_request_pos_id

Yes

Integer

Segment ID of the HTTP request counts. The value is fixed to 1.

traffic_pos_id

Yes

Integer

Position ID of traffic. The options are as follows: 1: 10 Mbit/s; 2: 30 Mbit/s; 3: 50 Mbit/s; 4: 70 Mbit/s; 5: 100 Mbit/s; 6: 150 Mbit/s; 7: 200 Mbit/s; 8: 250 Mbit/s; 9: 300 Mbit/s; 10: 500 Mbit/s; 11: 800 Mbit/s;88: 1,000 Mbit/s; 99: default protection

antiddos_config_id

No

String

Protection level ID.

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Internal error code.

error_msg

String

Internal error description.

task_id

String

ID of a task. This ID can be used to query the status of the task.

This field is reserved for future task audit extension and is not required currently.

Example Requests

Update the Anti-DDoS policy for a specified EIP. Set the position ID of access limit during cleaning to 8, and set the position ID of traffic to 1.

PUT https://{endpoint}/v1/{project_id}/antiddos/{floating_ip_id}

{
  "app_type_id" : 0,
  "cleaning_access_pos_id" : 8,
  "enable_L7" : false,
  "http_request_pos_id" : 1,
  "traffic_pos_id" : 1,
  "antiddos_config_name" : "test",
  "antiddos_config_id" : "1234567890"
}

Example Responses

Status code: 200

Request succeeded.

{
  "error_code" : "10000000",
  "error_msg" : "The task has been received and is being handled",
  "task_id" : "59385d2a-6266-4d3a-9122-a228c530f557"
}

Status Codes

Status Code

Description

200

Request succeeded.

Error Codes

See Error Codes.