Domain name for API request: alb.intl.tencentcloudapi.com.
The SetLoadBalancerSecurityGroups API supports setting (binding and unbinding) security groups for a public network load balancing instance. To query the security groups currently bound to a load balancing instance, use the DescribeLoadBalancerDetail API (https://www.tencentcloud.com/document/api/1822/133711?from_cn_redirect=1). This API uses SET semantics.
For the binding operation, input parameters need to be passed in for all security groups that should be bound to the load balancing instance (bound + new binding).
During unbinding, input parameters need to pass in all security groups bound to a CLB instance after unbinding. To unbind all security groups, omit this parameter or specify an empty array.
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: SetLoadBalancerSecurityGroups. |
| Version | Yes | String | Common Params. The value used for this API: 2025-10-30. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
| LoadBalancerId | Yes | String | CLB instance ID. The format is alb- followed by 8 alphanumeric characters. |
| SecurityGroups.N | Yes | Array of String | Security group ID list. |
| Parameter Name | Type | Description |
|---|---|---|
| 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 unbind the security group sg-m2k9q7pa from a CLB instance which has been bound to two security groups: sg-0936o7sd and sg-m2k9q7pa.
POST / HTTP/1.1
Host: alb.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: SetLoadBalancerSecurityGroups
<Common request parameters>
{
"LoadBalancerId": "alb-f8q2xk9m",
"SecurityGroups": [
"sg-0936o7sd"
]
}
{
"Response": {
"RequestId": "00ca7fca-90f1-47fe-a724-5d7e96d04644"
}
}
This example shows you how to bind the security groups sg-0936o7sd and sg-m2k9q7pa to a CLB instance which has not been bound to any security groups.
POST / HTTP/1.1
Host: alb.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: SetLoadBalancerSecurityGroups
<Common request parameters>
{
"LoadBalancerId": "alb-f8q2xk9m",
"SecurityGroups": [
"sg-0936o7sd",
"sg-m2k9q7pa"
]
}
{
"Response": {
"RequestId": "00ca7fca-90f1-47fe-a724-5d7e96d04633"
}
}
This example shows you how to unbind all security groups from a CLB instance which has been bound to multiple security groups.
POST / HTTP/1.1
Host: alb.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: SetLoadBalancerSecurityGroups
<Common request parameters>
{
"LoadBalancerId": "alb-f8q2xk9m",
"SecurityGroups": []
}
{
"Response": {
"RequestId": "00ca7fca-90f1-47fe-a724-5d7e96d04655"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
There is no error code related to the API business logic. For other error codes, please see Common Error Codes.
フィードバック