ModifyPolicy
1. API Description
This API is used to modify a protection strategy.
2. Input Parameters
The following request parameter list only provides API request parameters.
policyId
Yes
String
Protection strategy ID.
policyName
No
String
The name of the protection strategy.
The length is 2 to 63 characters.
Only letters, numbers, - and periods (.) are supported.
The name must start and end with a number or a letter.
blackIpList
No
Array of String
IP deny list.
whiteIpList
No
Array of String
IP allow list.
ipBlackTimeout
No
Integer
IP deny timeout. Unit: minutes.
Available range: [1, 10080].
blockProtocol
No
Array of Protocol
Enabled protocol blocking.
UDP and TCP cannot be enabled at the same time.
blockRegions
No
Array of String
Regions blocked.
3. Output Parameters
requestId
String
The unique request ID, which is returned for each request. RequestId is required for locating a problem.
4. Code Example
Modify a protection strategy.
POST /api/v2/zec HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: ModifyPolicy
<Common Request Params>
Request:
{
"policyId": "<policyId>",
"configType": "UdpReflect",
"policyName": "policyName",
"reflectUdpPort": [
{"port": 22},
{"port": 34},
]
}
Response:
{
"requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
"response": {
"requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3"
}
}5. Developer Resources
Zenlayer Cloud API 2.0 SDKs to make it easier for you to call APIs. More programming languages will be supported.
6. Error Codes
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
404
INVALID_DDOS_POLICY_NOT_FOUND
The protection strategy does not exist.
404
INVALID_DDOS_POLICY_REGION_NOT_FOUND
The Geo-Blocking region does not exist.
400
INVALID_IP_FORMAT
Invalid IP format.
400
INVALID_POLICY_PACKET_LENGTH_RANGE_OF_FINGERPRINT
Invalid port range for fingerprint filtering.
400
INVALID_POLICY_PORT_OVERLAP
The port range overlaps.
400
INVALID_POLICY_PORT_RANGE_OF_BLOCKING
The port range of the port blocking is incorrect.
400
INVALID_POLICY_PORT_RANGE_OF_FINGERPRINT
Invalid port range for fingerprint filtering.
400
INVALID_POLICY_PROTOCOL_CONFLICT
Protocol blocking conflict. UDP and TCP cannot be enabled at the same time.
409
INVALID_POLICY_TRAFFIC_CONTROL_VALUE
The source IP rate limiting value is not set.
409
INVALID_REFLECT_UDP_PORT_CONFLICT_DEFAULT
The custom UDP reflection source port already exists in the default and cannot be set.
400
OPERATION_DENIED_POLICY_ACTION_AFTER_MATCHING
Traffic can only be dropped based on packet fingerprint rules.
400
OPERATION_DENIED_POLICY_FINGERPRINT_FILTER_LIMITED
The number of fingerprint rules exceeds the limit.
400
OPERATION_DENIED_POLICY_PORT_BLOCKING_LIMITED
The number of port blocked exceeds the limit.
400
OPERATION_DENIED_POLICY_REFLECTION_ATTACK_FILTERING_LIMITED
The number of UDP reflection source ports exceeds the limit.
400
OPERATION_DENIED_POLICY_WHITE_BLACK_IP_LIMITED
The number of IP allow and deny lists exceeds the limit.
Last updated