tencent cloud

APIs

SetLoadBalancerSecurityGroups

ダウンロード
フォーカスモード
フォントサイズ
最終更新日: 2026-09-28 14:17:34

1. API Description

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.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

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.

3. Output Parameters

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.

4. Example

Example1 Unbinding a Security Group from a CLB Instance

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.

Input Example

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"
    ]
}

Output Example

{
    "Response": {
        "RequestId": "00ca7fca-90f1-47fe-a724-5d7e96d04644"
    }
}

Example2 Binding Multiple Security Groups to a CLB Instance

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.

Input Example

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"
    ]
}

Output Example

{
    "Response": {
        "RequestId": "00ca7fca-90f1-47fe-a724-5d7e96d04633"
    }
}

Example3 Unbinding All Security Groups

This example shows you how to unbind all security groups from a CLB instance which has been bound to multiple security groups.

Input Example

POST / HTTP/1.1
Host: alb.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: SetLoadBalancerSecurityGroups
<Common request parameters>

{
    "LoadBalancerId": "alb-f8q2xk9m",
    "SecurityGroups": []
}

Output Example

{
    "Response": {
        "RequestId": "00ca7fca-90f1-47fe-a724-5d7e96d04655"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

There is no error code related to the API business logic. For other error codes, please see Common Error Codes.

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック