Domain name for API request: clb.tencentcloudapi.com.
This API is used to modify the client IP blocklist of a CLB instance. One forwarding rule supports blocking up to 2,000,000 IPs. One blocklist can contain up to 2,000,000 entries.
(This API is in beta test. To use it, please submit a ticket.)
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
Parameter Name | Required | Type | Description |
---|---|---|---|
Action | Yes | String | Common Params. The value used for this API: ModifyBlockIPList. |
Version | Yes | String | Common Params. The value used for this API: 2018-03-17. |
Region | No | String | Common Params. This parameter is not required for this API. |
LoadBalancerIds.N | Yes | Array of String | CLB instance ID |
Type | Yes | String | Operation type. Valid values: |
ClientIPField | Yes | String | Header field that stores real client IPs |
BlockIPList.N | No | Array of String | List of blocked IPs. The array can contain up to 200,000 entries in one operation. |
ExpireTime | No | Integer | Expiration time in seconds. Default value: 3600 |
AddStrategy | No | String | IP adding policy. Valid value: fifo (if a blocklist is full, new IPs added to the blocklist will adopt the first-in first-out policy) |
Parameter Name | Type | Description |
---|---|---|
JodId | String | Async task ID |
RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
This example shows you how to add a blocklist. You should specify the header field containing the real client IP address and enable the blocklist feature. Then you can add a blocklist. You can delete or clear the blocklist in a similar way.
https://clb.tencentcloudapi.com/?Action=ModifyBlockIPList
&LoadBalancerIds.0=lb-6efswuxa
&Type=add_blocked
&BlockIPList.0=1.2.3.4
&ExpireTime=3000
&AddStrategy=fifo
&ClientIPField=client_ip_test
&<Common request parameters>
{
"Response": {
"JodId": "localjob010916173469001234567890",
"RequestId": "83329908-a282-4f9f-82ab-033a3025baff"
}
}
This example shows you how to use the blocklist feature. You should configure the header first to specify the header field containing the real client IP address, and then enable the blocklist feature.
https://clb.tencentcloudapi.com/?Action=ModifyBlockIPList
&LoadBalancerIds.0=lb-6efswuxa
&Type=add_customized_field
&ClientIPField=client_ip_test
&<Common request parameters>
{
"Response": {
"JodId": "localjob010916173469001234512345",
"RequestId": "83329908-a282-4f9f-82ab-033a30212345"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Error Code | Description |
---|---|
FailedOperation | Operation failed. |
InternalError | Internal error. |
InvalidParameter | Parameter error. |
InvalidParameter.FormatError | Wrong parameter format. |
InvalidParameterValue | Incorrect parameter value. |
InvalidParameterValue.Length | Wrong parameter length. |
MissingParameter | Missing parameter. |
UnauthorizedOperation | Unauthorized operation. |
Was this page helpful?