tencent cloud

文档反馈

DescribeLoadBalancers

最后更新时间:2023-10-24 11:16:15

    1. API Description

    Domain name for API request: clb.tencentcloudapi.com.

    This API is used to query the list of CLB instances in a region.

    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: DescribeLoadBalancers.
    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 No Array of String CLB instance IDs. There can be up to 20 IDs.
    LoadBalancerType No String CLB instance network type:
    OPEN: public network; INTERNAL: private network.
    Forward No Integer CLB instance type. 1: generic CLB instance; 0: classic CLB instance
    LoadBalancerName No String CLB instance name.
    Domain No String The domain name that Tencent Cloud assigned for the CLB instance.
    LoadBalancerVips.N No Array of String VIP address of a CLB instance (there can be multiple addresses)
    BackendPublicIps.N No Array of String Public IPs of the backend services bound with the load balancer. Only the public IPs of CVMs are supported now.
    BackendPrivateIps.N No Array of String Private IPs of the backend services bound with the load balancer. Only the private IPs of CVMs are supported now.
    Offset No Integer Data offset. Default value: 0.
    Limit No Integer Number of returned CLB instances. Default value: 20. Maximum value: 100.
    OrderBy No String Sort by parameter. Value range: LoadBalancerName, CreateTime, Domain, LoadBalancerType.
    OrderType No Integer 1: reverse; 0: sequential. Default value: reverse by creation time |
    SearchKey No String Search field which fuzzy matches name, domain name, or VIP.
    ProjectId No Integer ID of the project to which a CLB instance belongs, which can be obtained through the DescribeProject API.
    WithRs No Integer Whether a CLB instance is bound to a real server. 0: no; 1: yes; -1: query all.
    VpcId No String VPC where a CLB instance resides, such as vpc-bhqkbhdx.
    Basic network does not support queries by VpcId.
    SecurityGroup No String Security group ID, e.g., sg-m1cc****.
    MasterZone No String Primary AZ ID, e.g., 100001 (Guangzhou Zone 1).
    Filters.N No Array of Filter Each request can have up to 10 Filters and 100 Filter.Values. Detailed filter conditions:
  • internet-charge-type - Type: String - Required: No - Filter by CLB network billing mode, including TRAFFIC_POSTPAID_BY_HOUR
  • 3. Output Parameters

    Parameter Name Type Description
    TotalCount Integer Total number of CLB instances that meet the filter criteria. This value is independent of the Limit in the input parameter.
    LoadBalancerSet Array of LoadBalancer Array of returned CLB instances.
    RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Example

    Example1 Querying the CLB instances bound to a specific backend server

    This example shows you how to query the CLB instances bound to the backend server 172.26.0.11.

    Input Example

    POST / HTTP/1.1
    Host: clb.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeLoadBalancers
    <Common request parameters>
    
    {
        "BackendPrivateIps": [
            "172.26.0.11"
        ],
        "WithRs": "1"
    }
    

    Output Example

    {
        "Response": {
            "TotalCount": 1,
            "LoadBalancerSet": [
                {
                    "LoadBalancerId": "abc",
                    "LoadBalancerName": "abc",
                    "LoadBalancerType": "abc",
                    "Forward": 1,
                    "Domain": "abc",
                    "LoadBalancerVips": [
                        "abc"
                    ],
                    "Status": 1,
                    "CreateTime": "abc",
                    "StatusTime": "abc",
                    "ProjectId": 1,
                    "VpcId": "abc",
                    "OpenBgp": 1,
                    "Snat": true,
                    "Isolation": 1,
                    "Log": "abc",
                    "SubnetId": "abc",
                    "Tags": [
                        {
                            "TagKey": "abc",
                            "TagValue": "abc"
                        }
                    ],
                    "SecureGroups": [
                        "abc"
                    ],
                    "TargetRegionInfo": {
                        "Region": "abc",
                        "VpcId": "abc"
                    },
                    "AnycastZone": "abc",
                    "AddressIPVersion": "abc",
                    "NumericalVpcId": 1,
                    "VipIsp": "abc",
                    "MasterZone": {
                        "ZoneId": 1,
                        "Zone": "abc",
                        "ZoneName": "abc",
                        "ZoneRegion": "abc",
                        "LocalZone": true,
                        "EdgeZone": true
                    },
                    "BackupZoneSet": [
                        {
                            "ZoneId": 1,
                            "Zone": "abc",
                            "ZoneName": "abc",
                            "ZoneRegion": "abc",
                            "LocalZone": true,
                            "EdgeZone": true
                        }
                    ],
                    "IsolatedTime": "abc",
                    "ExpireTime": "abc",
                    "ChargeType": "abc",
                    "NetworkAttributes": {
                        "InternetChargeType": "abc",
                        "InternetMaxBandwidthOut": 0,
                        "BandwidthpkgSubType": "abc"
                    },
                    "PrepaidAttributes": {
                        "RenewFlag": "abc",
                        "Period": 0
                    },
                    "LogSetId": "abc",
                    "LogTopicId": "abc",
                    "AddressIPv6": "abc",
                    "ExtraInfo": {
                        "ZhiTong": true,
                        "TgwGroupName": "abc"
                    },
                    "IsDDos": true,
                    "ConfigId": "abc",
                    "LoadBalancerPassToTarget": true,
                    "ExclusiveCluster": {
                        "L4Clusters": [
                            {
                                "ClusterId": "abc",
                                "ClusterName": "abc",
                                "Zone": "abc"
                            }
                        ],
                        "L7Clusters": [
                            {
                                "ClusterId": "abc",
                                "ClusterName": "abc",
                                "Zone": "abc"
                            }
                        ],
                        "ClassicalCluster": {
                            "ClusterId": "abc",
                            "ClusterName": "abc",
                            "Zone": "abc"
                        }
                    },
                    "IPv6Mode": "abc",
                    "SnatPro": true,
                    "SnatIps": [
                        {
                            "SubnetId": "abc",
                            "Ip": "abc"
                        }
                    ],
                    "SlaType": "abc",
                    "IsBlock": true,
                    "IsBlockTime": "abc",
                    "LocalBgp": true,
                    "ClusterTag": "abc",
                    "MixIpTarget": true,
                    "Zones": [
                        "abc"
                    ],
                    "NfvInfo": "abc",
                    "HealthLogSetId": "abc",
                    "HealthLogTopicId": "abc",
                    "ClusterIds": [
                        "abc"
                    ],
                    "AttributeFlags": [
                        "abc"
                    ],
                    "LoadBalancerDomain": "abc",
                    "Egress": "abc"
                }
            ],
            "RequestId": "abc"
        }
    }
    

    Example2 Fuzzy querying CLB instances by the name, domain name, and VIP

    Input Example

    POST / HTTP/1.1
    Host: clb.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeLoadBalancers
    <Common request parameters>
    
    {
        "SearchKey": "test_LB"
    }
    

    Output Example

    {
        "Response": {
            "TotalCount": 1,
            "LoadBalancerSet": [
                {
                    "LoadBalancerId": "abc",
                    "LoadBalancerName": "abc",
                    "LoadBalancerType": "abc",
                    "Forward": 1,
                    "Domain": "abc",
                    "LoadBalancerVips": [
                        "abc"
                    ],
                    "Status": 1,
                    "CreateTime": "abc",
                    "StatusTime": "abc",
                    "ProjectId": 1,
                    "VpcId": "abc",
                    "OpenBgp": 1,
                    "Snat": true,
                    "Isolation": 1,
                    "Log": "abc",
                    "SubnetId": "abc",
                    "Tags": [
                        {
                            "TagKey": "abc",
                            "TagValue": "abc"
                        }
                    ],
                    "SecureGroups": [
                        "abc"
                    ],
                    "TargetRegionInfo": {
                        "Region": "abc",
                        "VpcId": "abc"
                    },
                    "AnycastZone": "abc",
                    "AddressIPVersion": "abc",
                    "NumericalVpcId": 1,
                    "VipIsp": "abc",
                    "MasterZone": {
                        "ZoneId": 1,
                        "Zone": "abc",
                        "ZoneName": "abc",
                        "ZoneRegion": "abc",
                        "LocalZone": true,
                        "EdgeZone": true
                    },
                    "BackupZoneSet": [
                        {
                            "ZoneId": 1,
                            "Zone": "abc",
                            "ZoneName": "abc",
                            "ZoneRegion": "abc",
                            "LocalZone": true,
                            "EdgeZone": true
                        }
                    ],
                    "IsolatedTime": "abc",
                    "ExpireTime": "abc",
                    "ChargeType": "abc",
                    "NetworkAttributes": {
                        "InternetChargeType": "abc",
                        "InternetMaxBandwidthOut": 0,
                        "BandwidthpkgSubType": "abc"
                    },
                    "PrepaidAttributes": {
                        "RenewFlag": "abc",
                        "Period": 0
                    },
                    "LogSetId": "abc",
                    "LogTopicId": "abc",
                    "AddressIPv6": "abc",
                    "ExtraInfo": {
                        "ZhiTong": true,
                        "TgwGroupName": "abc"
                    },
                    "IsDDos": true,
                    "ConfigId": "abc",
                    "LoadBalancerPassToTarget": true,
                    "ExclusiveCluster": {
                        "L4Clusters": [
                            {
                                "ClusterId": "abc",
                                "ClusterName": "abc",
                                "Zone": "abc"
                            }
                        ],
                        "L7Clusters": [
                            {
                                "ClusterId": "abc",
                                "ClusterName": "abc",
                                "Zone": "abc"
                            }
                        ],
                        "ClassicalCluster": {
                            "ClusterId": "abc",
                            "ClusterName": "abc",
                            "Zone": "abc"
                        }
                    },
                    "IPv6Mode": "abc",
                    "SnatPro": true,
                    "SnatIps": [
                        {
                            "SubnetId": "abc",
                            "Ip": "abc"
                        }
                    ],
                    "SlaType": "abc",
                    "IsBlock": true,
                    "IsBlockTime": "abc",
                    "LocalBgp": true,
                    "ClusterTag": "abc",
                    "MixIpTarget": true,
                    "Zones": [
                        "abc"
                    ],
                    "NfvInfo": "abc",
                    "HealthLogSetId": "abc",
                    "HealthLogTopicId": "abc",
                    "ClusterIds": [
                        "abc"
                    ],
                    "AttributeFlags": [
                        "abc"
                    ],
                    "LoadBalancerDomain": "abc",
                    "Egress": "abc"
                }
            ],
            "RequestId": "abc"
        }
    }
    

    Example3 Querying CLB instances by IDs

    Input Example

    POST / HTTP/1.1
    Host: clb.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeLoadBalancers
    <Common request parameters>
    
    {
        "LoadBalancerIds": [
            "lb-rbw5****"
        ]
    }
    

    Output Example

    {
        "Response": {
            "TotalCount": 1,
            "LoadBalancerSet": [
                {
                    "LoadBalancerId": "abc",
                    "LoadBalancerName": "abc",
                    "LoadBalancerType": "abc",
                    "Forward": 1,
                    "Domain": "abc",
                    "LoadBalancerVips": [
                        "abc"
                    ],
                    "Status": 1,
                    "CreateTime": "abc",
                    "StatusTime": "abc",
                    "ProjectId": 1,
                    "VpcId": "abc",
                    "OpenBgp": 1,
                    "Snat": true,
                    "Isolation": 1,
                    "Log": "abc",
                    "SubnetId": "abc",
                    "Tags": [
                        {
                            "TagKey": "abc",
                            "TagValue": "abc"
                        }
                    ],
                    "SecureGroups": [
                        "abc"
                    ],
                    "TargetRegionInfo": {
                        "Region": "abc",
                        "VpcId": "abc"
                    },
                    "AnycastZone": "abc",
                    "AddressIPVersion": "abc",
                    "NumericalVpcId": 1,
                    "VipIsp": "abc",
                    "MasterZone": {
                        "ZoneId": 1,
                        "Zone": "abc",
                        "ZoneName": "abc",
                        "ZoneRegion": "abc",
                        "LocalZone": true,
                        "EdgeZone": true
                    },
                    "BackupZoneSet": [
                        {
                            "ZoneId": 1,
                            "Zone": "abc",
                            "ZoneName": "abc",
                            "ZoneRegion": "abc",
                            "LocalZone": true,
                            "EdgeZone": true
                        }
                    ],
                    "IsolatedTime": "abc",
                    "ExpireTime": "abc",
                    "ChargeType": "abc",
                    "NetworkAttributes": {
                        "InternetChargeType": "abc",
                        "InternetMaxBandwidthOut": 0,
                        "BandwidthpkgSubType": "abc"
                    },
                    "PrepaidAttributes": {
                        "RenewFlag": "abc",
                        "Period": 0
                    },
                    "LogSetId": "abc",
                    "LogTopicId": "abc",
                    "AddressIPv6": "abc",
                    "ExtraInfo": {
                        "ZhiTong": true,
                        "TgwGroupName": "abc"
                    },
                    "IsDDos": true,
                    "ConfigId": "abc",
                    "LoadBalancerPassToTarget": true,
                    "ExclusiveCluster": {
                        "L4Clusters": [
                            {
                                "ClusterId": "abc",
                                "ClusterName": "abc",
                                "Zone": "abc"
                            }
                        ],
                        "L7Clusters": [
                            {
                                "ClusterId": "abc",
                                "ClusterName": "abc",
                                "Zone": "abc"
                            }
                        ],
                        "ClassicalCluster": {
                            "ClusterId": "abc",
                            "ClusterName": "abc",
                            "Zone": "abc"
                        }
                    },
                    "IPv6Mode": "abc",
                    "SnatPro": true,
                    "SnatIps": [
                        {
                            "SubnetId": "abc",
                            "Ip": "abc"
                        }
                    ],
                    "SlaType": "abc",
                    "IsBlock": true,
                    "IsBlockTime": "abc",
                    "LocalBgp": true,
                    "ClusterTag": "abc",
                    "MixIpTarget": true,
                    "Zones": [
                        "abc"
                    ],
                    "NfvInfo": "abc",
                    "HealthLogSetId": "abc",
                    "HealthLogTopicId": "abc",
                    "ClusterIds": [
                        "abc"
                    ],
                    "AttributeFlags": [
                        "abc"
                    ],
                    "LoadBalancerDomain": "abc",
                    "Egress": "abc"
                }
            ],
            "RequestId": "abc"
        }
    }
    

    Example4 Querying CLB instances by the instance type, project, name, and VIP

    Input Example

    POST / HTTP/1.1
    Host: clb.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeLoadBalancers
    <Common request parameters>
    
    {
        "ProjectId": "0",
        "LoadBalancerType": "OPEN",
        "LoadBalancerVips": [
            "XX.XX.XX.XX"
        ],
        "LoadBalancerName": "test_LB"
    }
    

    Output Example

    {
        "Response": {
            "TotalCount": 1,
            "LoadBalancerSet": [
                {
                    "LoadBalancerId": "abc",
                    "LoadBalancerName": "abc",
                    "LoadBalancerType": "abc",
                    "Forward": 1,
                    "Domain": "abc",
                    "LoadBalancerVips": [
                        "abc"
                    ],
                    "Status": 1,
                    "CreateTime": "abc",
                    "StatusTime": "abc",
                    "ProjectId": 1,
                    "VpcId": "abc",
                    "OpenBgp": 1,
                    "Snat": true,
                    "Isolation": 1,
                    "Log": "abc",
                    "SubnetId": "abc",
                    "Tags": [
                        {
                            "TagKey": "abc",
                            "TagValue": "abc"
                        }
                    ],
                    "SecureGroups": [
                        "abc"
                    ],
                    "TargetRegionInfo": {
                        "Region": "abc",
                        "VpcId": "abc"
                    },
                    "AnycastZone": "abc",
                    "AddressIPVersion": "abc",
                    "NumericalVpcId": 1,
                    "VipIsp": "abc",
                    "MasterZone": {
                        "ZoneId": 1,
                        "Zone": "abc",
                        "ZoneName": "abc",
                        "ZoneRegion": "abc",
                        "LocalZone": true,
                        "EdgeZone": true
                    },
                    "BackupZoneSet": [
                        {
                            "ZoneId": 1,
                            "Zone": "abc",
                            "ZoneName": "abc",
                            "ZoneRegion": "abc",
                            "LocalZone": true,
                            "EdgeZone": true
                        }
                    ],
                    "IsolatedTime": "abc",
                    "ExpireTime": "abc",
                    "ChargeType": "abc",
                    "NetworkAttributes": {
                        "InternetChargeType": "abc",
                        "InternetMaxBandwidthOut": 0,
                        "BandwidthpkgSubType": "abc"
                    },
                    "PrepaidAttributes": {
                        "RenewFlag": "abc",
                        "Period": 0
                    },
                    "LogSetId": "abc",
                    "LogTopicId": "abc",
                    "AddressIPv6": "abc",
                    "ExtraInfo": {
                        "ZhiTong": true,
                        "TgwGroupName": "abc"
                    },
                    "IsDDos": true,
                    "ConfigId": "abc",
                    "LoadBalancerPassToTarget": true,
                    "ExclusiveCluster": {
                        "L4Clusters": [
                            {
                                "ClusterId": "abc",
                                "ClusterName": "abc",
                                "Zone": "abc"
                            }
                        ],
                        "L7Clusters": [
                            {
                                "ClusterId": "abc",
                                "ClusterName": "abc",
                                "Zone": "abc"
                            }
                        ],
                        "ClassicalCluster": {
                            "ClusterId": "abc",
                            "ClusterName": "abc",
                            "Zone": "abc"
                        }
                    },
                    "IPv6Mode": "abc",
                    "SnatPro": true,
                    "SnatIps": [
                        {
                            "SubnetId": "abc",
                            "Ip": "abc"
                        }
                    ],
                    "SlaType": "abc",
                    "IsBlock": true,
                    "IsBlockTime": "abc",
                    "LocalBgp": true,
                    "ClusterTag": "abc",
                    "MixIpTarget": true,
                    "Zones": [
                        "abc"
                    ],
                    "NfvInfo": "abc",
                    "HealthLogSetId": "abc",
                    "HealthLogTopicId": "abc",
                    "ClusterIds": [
                        "abc"
                    ],
                    "AttributeFlags": [
                        "abc"
                    ],
                    "LoadBalancerDomain": "abc",
                    "Egress": "abc"
                }
            ],
            "RequestId": "abc"
        }
    }
    

    Example5 Querying CLB instances by the specific tag key-value pair

    Input Example

    POST / HTTP/1.1
    Host: clb.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeLoadBalancers
    <Common request parameters>
    
    {
        "ProjectId": "0",
        "LoadBalancerType": "OPEN",
        "Filters": [
            {
                "Values": [
                    "test_tag_value2",
                    "test_tag_value1"
                ],
                "Name": "tag:test_tag_key"
            }
        ],
        "LoadBalancerName": "test_LB"
    }
    

    Output Example

    {
        "Response": {
            "TotalCount": 1,
            "LoadBalancerSet": [
                {
                    "LoadBalancerId": "abc",
                    "LoadBalancerName": "abc",
                    "LoadBalancerType": "abc",
                    "Forward": 1,
                    "Domain": "abc",
                    "LoadBalancerVips": [
                        "abc"
                    ],
                    "Status": 1,
                    "CreateTime": "abc",
                    "StatusTime": "abc",
                    "ProjectId": 1,
                    "VpcId": "abc",
                    "OpenBgp": 1,
                    "Snat": true,
                    "Isolation": 1,
                    "Log": "abc",
                    "SubnetId": "abc",
                    "Tags": [
                        {
                            "TagKey": "abc",
                            "TagValue": "abc"
                        }
                    ],
                    "SecureGroups": [
                        "abc"
                    ],
                    "TargetRegionInfo": {
                        "Region": "abc",
                        "VpcId": "abc"
                    },
                    "AnycastZone": "abc",
                    "AddressIPVersion": "abc",
                    "NumericalVpcId": 1,
                    "VipIsp": "abc",
                    "MasterZone": {
                        "ZoneId": 1,
                        "Zone": "abc",
                        "ZoneName": "abc",
                        "ZoneRegion": "abc",
                        "LocalZone": true,
                        "EdgeZone": true
                    },
                    "BackupZoneSet": [
                        {
                            "ZoneId": 1,
                            "Zone": "abc",
                            "ZoneName": "abc",
                            "ZoneRegion": "abc",
                            "LocalZone": true,
                            "EdgeZone": true
                        }
                    ],
                    "IsolatedTime": "abc",
                    "ExpireTime": "abc",
                    "ChargeType": "abc",
                    "NetworkAttributes": {
                        "InternetChargeType": "abc",
                        "InternetMaxBandwidthOut": 0,
                        "BandwidthpkgSubType": "abc"
                    },
                    "PrepaidAttributes": {
                        "RenewFlag": "abc",
                        "Period": 0
                    },
                    "LogSetId": "abc",
                    "LogTopicId": "abc",
                    "AddressIPv6": "abc",
                    "ExtraInfo": {
                        "ZhiTong": true,
                        "TgwGroupName": "abc"
                    },
                    "IsDDos": true,
                    "ConfigId": "abc",
                    "LoadBalancerPassToTarget": true,
                    "ExclusiveCluster": {
                        "L4Clusters": [
                            {
                                "ClusterId": "abc",
                                "ClusterName": "abc",
                                "Zone": "abc"
                            }
                        ],
                        "L7Clusters": [
                            {
                                "ClusterId": "abc",
                                "ClusterName": "abc",
                                "Zone": "abc"
                            }
                        ],
                        "ClassicalCluster": {
                            "ClusterId": "abc",
                            "ClusterName": "abc",
                            "Zone": "abc"
                        }
                    },
                    "IPv6Mode": "abc",
                    "SnatPro": true,
                    "SnatIps": [
                        {
                            "SubnetId": "abc",
                            "Ip": "abc"
                        }
                    ],
                    "SlaType": "abc",
                    "IsBlock": true,
                    "IsBlockTime": "abc",
                    "LocalBgp": true,
                    "ClusterTag": "abc",
                    "MixIpTarget": true,
                    "Zones": [
                        "abc"
                    ],
                    "NfvInfo": "abc",
                    "HealthLogSetId": "abc",
                    "HealthLogTopicId": "abc",
                    "ClusterIds": [
                        "abc"
                    ],
                    "AttributeFlags": [
                        "abc"
                    ],
                    "LoadBalancerDomain": "abc",
                    "Egress": "abc"
                }
            ],
            "RequestId": "abc"
        }
    }
    

    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

    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.
    InvalidParameter.RegionNotFound Invalid region.
    InvalidParameterValue Incorrect parameter value.
    InvalidParameterValue.InvalidFilter Incorrect Filter parameter.
    InvalidParameterValue.Length Wrong parameter length.
    InvalidParameterValue.Range Wrong parameter value range.
    UnauthorizedOperation Unauthorized operation.
    UnsupportedOperation Unsupported operation.