查询负载均衡实例列表

最近更新时间:2024-04-03 11:13:54

我的收藏

1. 接口描述

接口请求域名: clb.tencentcloudapi.com 。

查询一个地域的负载均衡实例列表。

默认接口请求频率限制:20次/秒。

推荐使用 API Explorer
点击调试
API Explorer 提供了在线调用、签名验证、SDK 代码生成和快速检索接口等能力。您可查看每次调用的请求内容和返回结果以及自动生成 SDK 调用示例。

2. 输入参数

以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见 公共请求参数

参数名称 必选 类型 描述
Action String 公共参数,本接口取值:DescribeLoadBalancers。
Version String 公共参数,本接口取值:2018-03-17。
Region String 公共参数,详见产品支持的 地域列表
LoadBalancerIds.N Array of String 负载均衡实例ID。实例ID数量上限为20个。
示例值:["lb-rbw5****"]
LoadBalancerType String 负载均衡实例的网络类型:
OPEN:公网属性, INTERNAL:内网属性。
示例值:OPEN
Forward Integer 负载均衡实例的类型。1:通用的负载均衡实例,0:传统型负载均衡实例。如果不传此参数,则查询所有类型的负载均衡实例。
示例值:1
LoadBalancerName String 负载均衡实例的名称。
示例值:test_internal
Domain String 腾讯云为负载均衡实例分配的域名。
示例值:lb-6m46rm32-se**o0q2g.clb.ap-guangzhou.testclb.com
LoadBalancerVips.N Array of String 负载均衡实例的 VIP 地址,支持多个。
示例值:["44.23.xxx.xxx"]
BackendPublicIps.N Array of String 负载均衡绑定的后端服务的外网 IP,只支持查询云服务器的公网 IP。
示例值:["102.23.xxx.xxx"]
BackendPrivateIps.N Array of String 负载均衡绑定的后端服务的内网 IP,只支持查询云服务器的内网 IP。
示例值:["172.16.xxx.xxx"]
Offset Integer 数据偏移量,默认为0。
示例值:0
Limit Integer 返回负载均衡实例的数量,默认为20,最大值为100。
示例值:20
OrderBy String 排序参数,支持以下字段:LoadBalancerName,CreateTime,Domain,LoadBalancerType。
示例值:LoadBalancerName
OrderType Integer 1:倒序,0:顺序,默认按照创建时间倒序。
示例值:0
SearchKey String 搜索字段,模糊匹配名称、域名、VIP。
示例值:test-name
ProjectId Integer 负载均衡实例所属的项目 ID,可以通过 DescribeProject 接口获取。
示例值:1
WithRs Integer 负载均衡是否绑定后端服务,0:没有绑定后端服务,1:绑定后端服务,-1:查询全部。
示例值:-1
VpcId String 负载均衡实例所属私有网络唯一ID,如 vpc-bhqkbhdx,
基础网络可传入'0'。
示例值:vpc-bhqk****
SecurityGroup String 安全组ID,如 sg-m1cc
示例值:sg-m1cc
MasterZone String 主可用区ID,如 :"100001" (对应的是广州一区)。可通过DescribeZones获取可用区列表。
示例值:100001
Filters.N Array of Filter 每次请求的Filters的上限为10,Filter.Values的上限为100。
Filter.NameFilter.Values皆为必填项。详细的过滤条件如下:
  • charge-type - String - 是否必填:否 - (过滤条件)按照 CLB 的实例计费模式过滤,包括"PREPAID","POSTPAID_BY_HOUR"。
  • internet-charge-type - String - 是否必填:否 - (过滤条件)按照 CLB 的网络计费模式过滤,包括"BANDWIDTH_PREPAID","TRAFFIC_POSTPAID_BY_HOUR","BANDWIDTH_POSTPAID_BY_HOUR","BANDWIDTH_PACKAGE"。
  • master-zone-id - String - 是否必填:否 - (过滤条件)按照 CLB 的主可用区ID过滤,如 :"100001" (对应的是广州一区)。
  • tag-key - String - 是否必填:否 - (过滤条件)按照 CLB 标签的键过滤。
  • tag:tag-key - String - 是否必填:否 - (过滤条件)按照CLB标签键值对进行过滤,tag-key使用具体的标签键进行替换。
  • function-name - String - 是否必填:否 - (过滤条件)按照 CLB 后端绑定的SCF云函数的函数名称过滤。
  • vip-isp - String - 是否必填:否 - (过滤条件)按照 CLB VIP的运营商类型过滤,如:"BGP","INTERNAL","CMCC","CTCC","CUCC"等。
  • sla-type - String - 是否必填:否 - (过滤条件)按照 CLB 的性能容量型规格过滤,包括"clb.c2.medium","clb.c3.small","clb.c3.medium","clb.c4.small","clb.c4.medium","clb.c4.large","clb.c4.xlarge"。
  • 3. 输出参数

    参数名称 类型 描述
    TotalCount Integer 满足过滤条件的负载均衡实例总数。此数值与入参中的Limit无关。
    示例值:0
    LoadBalancerSet Array of LoadBalancer 返回的负载均衡实例数组。
    RequestId String 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。

    4. 示例

    示例1 根据负载均衡实例ID来查询

    输入示例

    POST / HTTP/1.1
    Host: clb.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeLoadBalancers
    <公共请求参数>
    
    {
        "LoadBalancerIds": [
            "lb-rbw5****"
        ]
    }

    输出示例

    {
        "Response": {
            "TotalCount": 1,
            "LoadBalancerSet": [
                {
                    "LoadBalancerId": "lb-rbw5****",
                    "LoadBalancerName": "test_LB_****",
                    "Forward": 1,
                    "Domain": "",
                    "LoadBalancerDomain": "",
                    "LoadBalancerVips": [
                        "119.***.***.51"
                    ],
                    "AddressIPv6": null,
                    "AddressIPVersion": "ipv4",
                    "IPv6Mode": null,
                    "LoadBalancerType": "OPEN",
                    "Status": 1,
                    "CreateTime": "2023-12-27 15:53:46",
                    "StatusTime": "2024-01-22 19:58:03",
                    "ProjectId": 0,
                    "OpenBgp": 0,
                    "Snat": false,
                    "Isolation": 0,
                    "Log": "",
                    "AnycastZone": "",
                    "VpcId": "vpc-1y****83",
                    "NumericalVpcId": 1111113,
                    "TargetRegionInfo": {
                        "Region": "ap-guangzhou",
                        "VpcId": "vpc-1y****83"
                    },
                    "SubnetId": "",
                    "SecureGroups": [],
                    "Tags": [
                        {
                            "TagKey": "key-****",
                            "TagValue": "value-****"
                        }
                    ],
                    "MasterZone": {
                        "ZoneId": 100003,
                        "Zone": "ap-guangzhou-3",
                        "ZoneName": "广州三区",
                        "ZoneRegion": "ap-guangzhou",
                        "LocalZone": false,
                        "EdgeZone": false
                    },
                    "BackupZoneSet": null,
                    "IsolatedTime": null,
                    "ExpireTime": "2024-01-27 15:53:46",
                    "ChargeType": "POSTPAID_BY_HOUR",
                    "NetworkAttributes": {
                        "InternetChargeType": "TRAFFIC_POSTPAID_BY_HOUR",
                        "InternetMaxBandwidthOut": 5,
                        "BandwidthpkgSubType": "BGP"
                    },
                    "PrepaidAttributes": null,
                    "ExtraInfo": null,
                    "LogSetId": "",
                    "LogTopicId": "",
                    "LoadBalancerPassToTarget": false,
                    "IsDDos": false,
                    "ConfigId": "",
                    "ExclusiveCluster": {
                        "L4Clusters": null,
                        "L7Clusters": null,
                        "ClassicalCluster": null
                    },
                    "SnatPro": false,
                    "SnatIps": [],
                    "IsBlock": false,
                    "IsBlockTime": "",
                    "SlaType": "",
                    "ClusterTag": null,
                    "LocalBgp": false,
                    "MixIpTarget": false,
                    "Zones": null,
                    "NfvInfo": "",
                    "HealthLogSetId": "",
                    "HealthLogTopicId": "",
                    "ClusterIds": null,
                    "AttributeFlags": [
                        "SharedLimitFlag"
                    ],
                    "VipIsp": "BGP",
                    "Egress": ""
                }
            ],
            "RequestId": "b0e9e810-01cc-4c12-8bd2-ca0a2ab1b976"
        }
    }

    示例2 根据负载均衡的标签键值对过滤查询

    输入示例

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

    输出示例

    {
        "Response": {
            "TotalCount": 1,
            "LoadBalancerSet": [
                {
                    "LoadBalancerId": "lb-rbw5****",
                    "LoadBalancerName": "test_LB_****",
                    "Forward": 1,
                    "Domain": "",
                    "LoadBalancerDomain": "",
                    "LoadBalancerVips": [
                        "119.***.***.51"
                    ],
                    "AddressIPv6": null,
                    "AddressIPVersion": "ipv4",
                    "IPv6Mode": null,
                    "LoadBalancerType": "OPEN",
                    "Status": 1,
                    "CreateTime": "2023-12-27 15:53:46",
                    "StatusTime": "2024-01-22 19:58:03",
                    "ProjectId": 0,
                    "OpenBgp": 0,
                    "Snat": false,
                    "Isolation": 0,
                    "Log": "",
                    "AnycastZone": "",
                    "VpcId": "vpc-1y****83",
                    "NumericalVpcId": 1111113,
                    "TargetRegionInfo": {
                        "Region": "ap-guangzhou",
                        "VpcId": "vpc-1y****83"
                    },
                    "SubnetId": "",
                    "SecureGroups": [],
                    "Tags": [
                        {
                            "TagKey": "key-****",
                            "TagValue": "value-****"
                        }
                    ],
                    "MasterZone": {
                        "ZoneId": 100003,
                        "Zone": "ap-guangzhou-3",
                        "ZoneName": "广州三区",
                        "ZoneRegion": "ap-guangzhou",
                        "LocalZone": false,
                        "EdgeZone": false
                    },
                    "BackupZoneSet": null,
                    "IsolatedTime": null,
                    "ExpireTime": "2024-01-27 15:53:46",
                    "ChargeType": "POSTPAID_BY_HOUR",
                    "NetworkAttributes": {
                        "InternetChargeType": "TRAFFIC_POSTPAID_BY_HOUR",
                        "InternetMaxBandwidthOut": 5,
                        "BandwidthpkgSubType": "BGP"
                    },
                    "PrepaidAttributes": null,
                    "ExtraInfo": null,
                    "LogSetId": "",
                    "LogTopicId": "",
                    "LoadBalancerPassToTarget": false,
                    "IsDDos": false,
                    "ConfigId": "",
                    "ExclusiveCluster": {
                        "L4Clusters": null,
                        "L7Clusters": null,
                        "ClassicalCluster": null
                    },
                    "SnatPro": false,
                    "SnatIps": [],
                    "IsBlock": false,
                    "IsBlockTime": "",
                    "SlaType": "",
                    "ClusterTag": null,
                    "LocalBgp": false,
                    "MixIpTarget": false,
                    "Zones": null,
                    "NfvInfo": "",
                    "HealthLogSetId": "",
                    "HealthLogTopicId": "",
                    "ClusterIds": null,
                    "AttributeFlags": [
                        "SharedLimitFlag"
                    ],
                    "VipIsp": "BGP",
                    "Egress": ""
                }
            ],
            "RequestId": "b0e9e810-01cc-4c12-8bd2-ca0a2ab1b976"
        }
    }

    示例3 查询后端绑定了指定内网IP的机器的负载均衡

    查询绑定了内网IP为172.26.0.11的后端服务的负载均衡实例。

    输入示例

    POST / HTTP/1.1
    Host: clb.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeLoadBalancers
    <公共请求参数>
    
    {
        "BackendPrivateIps": [
            "172.26.0.11"
        ],
        "WithRs": "1"
    }

    输出示例

    {
        "Response": {
            "TotalCount": 1,
            "LoadBalancerSet": [
                {
                    "LoadBalancerId": "lb-9vpm****",
                    "LoadBalancerName": "lb-test-****-1227",
                    "Forward": 1,
                    "Domain": "",
                    "LoadBalancerDomain": "",
                    "LoadBalancerVips": [
                        "119.***.***.51"
                    ],
                    "AddressIPv6": null,
                    "AddressIPVersion": "ipv4",
                    "IPv6Mode": null,
                    "LoadBalancerType": "OPEN",
                    "Status": 1,
                    "CreateTime": "2023-12-27 15:53:46",
                    "StatusTime": "2024-01-22 19:58:03",
                    "ProjectId": 0,
                    "OpenBgp": 0,
                    "Snat": false,
                    "Isolation": 0,
                    "Log": "",
                    "AnycastZone": "",
                    "VpcId": "vpc-1y****83",
                    "NumericalVpcId": 1111113,
                    "TargetRegionInfo": {
                        "Region": "ap-guangzhou",
                        "VpcId": "vpc-1y****83"
                    },
                    "SubnetId": "",
                    "SecureGroups": [],
                    "Tags": [
                        {
                            "TagKey": "key-****",
                            "TagValue": "value-****"
                        }
                    ],
                    "MasterZone": {
                        "ZoneId": 100003,
                        "Zone": "ap-guangzhou-3",
                        "ZoneName": "广州三区",
                        "ZoneRegion": "ap-guangzhou",
                        "LocalZone": false,
                        "EdgeZone": false
                    },
                    "BackupZoneSet": null,
                    "IsolatedTime": null,
                    "ExpireTime": "2024-01-27 15:53:46",
                    "ChargeType": "POSTPAID_BY_HOUR",
                    "NetworkAttributes": {
                        "InternetChargeType": "TRAFFIC_POSTPAID_BY_HOUR",
                        "InternetMaxBandwidthOut": 5,
                        "BandwidthpkgSubType": "BGP"
                    },
                    "PrepaidAttributes": null,
                    "ExtraInfo": null,
                    "LogSetId": "",
                    "LogTopicId": "",
                    "LoadBalancerPassToTarget": false,
                    "IsDDos": false,
                    "ConfigId": "",
                    "ExclusiveCluster": {
                        "L4Clusters": null,
                        "L7Clusters": null,
                        "ClassicalCluster": null
                    },
                    "SnatPro": false,
                    "SnatIps": [],
                    "IsBlock": false,
                    "IsBlockTime": "",
                    "SlaType": "",
                    "ClusterTag": null,
                    "LocalBgp": false,
                    "MixIpTarget": false,
                    "Zones": null,
                    "NfvInfo": "",
                    "HealthLogSetId": "",
                    "HealthLogTopicId": "",
                    "ClusterIds": null,
                    "AttributeFlags": [
                        "SharedLimitFlag"
                    ],
                    "VipIsp": "BGP",
                    "Egress": ""
                }
            ],
            "RequestId": "b0e9e810-01cc-4c12-8bd2-ca0a2ab1b976"
        }
    }

    示例4 根据名称、域名、VIP多个字段模糊查询负载均衡实例

    输入示例

    POST / HTTP/1.1
    Host: clb.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeLoadBalancers
    <公共请求参数>
    
    {
        "SearchKey": "test_LB"
    }

    输出示例

    {
        "Response": {
            "TotalCount": 1,
            "LoadBalancerSet": [
                {
                    "LoadBalancerId": "lb-9vpm****",
                    "LoadBalancerName": "test_LB_****",
                    "Forward": 1,
                    "Domain": "",
                    "LoadBalancerDomain": "",
                    "LoadBalancerVips": [
                        "119.***.***.51"
                    ],
                    "AddressIPv6": null,
                    "AddressIPVersion": "ipv4",
                    "IPv6Mode": null,
                    "LoadBalancerType": "OPEN",
                    "Status": 1,
                    "CreateTime": "2023-12-27 15:53:46",
                    "StatusTime": "2024-01-22 19:58:03",
                    "ProjectId": 0,
                    "OpenBgp": 0,
                    "Snat": false,
                    "Isolation": 0,
                    "Log": "",
                    "AnycastZone": "",
                    "VpcId": "vpc-1y****83",
                    "NumericalVpcId": 1111113,
                    "TargetRegionInfo": {
                        "Region": "ap-guangzhou",
                        "VpcId": "vpc-1y****83"
                    },
                    "SubnetId": "",
                    "SecureGroups": [],
                    "Tags": [
                        {
                            "TagKey": "key-****",
                            "TagValue": "value-****"
                        }
                    ],
                    "MasterZone": {
                        "ZoneId": 100003,
                        "Zone": "ap-guangzhou-3",
                        "ZoneName": "广州三区",
                        "ZoneRegion": "ap-guangzhou",
                        "LocalZone": false,
                        "EdgeZone": false
                    },
                    "BackupZoneSet": null,
                    "IsolatedTime": null,
                    "ExpireTime": "2024-01-27 15:53:46",
                    "ChargeType": "POSTPAID_BY_HOUR",
                    "NetworkAttributes": {
                        "InternetChargeType": "TRAFFIC_POSTPAID_BY_HOUR",
                        "InternetMaxBandwidthOut": 5,
                        "BandwidthpkgSubType": "BGP"
                    },
                    "PrepaidAttributes": null,
                    "ExtraInfo": null,
                    "LogSetId": "",
                    "LogTopicId": "",
                    "LoadBalancerPassToTarget": false,
                    "IsDDos": false,
                    "ConfigId": "",
                    "ExclusiveCluster": {
                        "L4Clusters": null,
                        "L7Clusters": null,
                        "ClassicalCluster": null
                    },
                    "SnatPro": false,
                    "SnatIps": [],
                    "IsBlock": false,
                    "IsBlockTime": "",
                    "SlaType": "",
                    "ClusterTag": null,
                    "LocalBgp": false,
                    "MixIpTarget": false,
                    "Zones": null,
                    "NfvInfo": "",
                    "HealthLogSetId": "",
                    "HealthLogTopicId": "",
                    "ClusterIds": null,
                    "AttributeFlags": [
                        "SharedLimitFlag"
                    ],
                    "VipIsp": "BGP",
                    "Egress": ""
                }
            ],
            "RequestId": "b0e9e810-01cc-4c12-8bd2-ca0a2ab1b976"
        }
    }

    示例5 根据负载均衡类型、所属项目、负载均衡名称、负载均衡实例的vip来查询

    输入示例

    POST / HTTP/1.1
    Host: clb.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeLoadBalancers
    <公共请求参数>
    
    {
        "ProjectId": "0",
        "LoadBalancerType": "OPEN",
        "LoadBalancerVips": [
            "119.***.***.51"
        ],
        "LoadBalancerName": "test_LB"
    }

    输出示例

    {
        "Response": {
            "TotalCount": 1,
            "LoadBalancerSet": [
                {
                    "LoadBalancerId": "lb-rbw5****",
                    "LoadBalancerName": "test_LB_****",
                    "Forward": 1,
                    "Domain": "",
                    "LoadBalancerDomain": "",
                    "LoadBalancerVips": [
                        "119.***.***.51"
                    ],
                    "AddressIPv6": null,
                    "AddressIPVersion": "ipv4",
                    "IPv6Mode": null,
                    "LoadBalancerType": "OPEN",
                    "Status": 1,
                    "CreateTime": "2023-12-27 15:53:46",
                    "StatusTime": "2024-01-22 19:58:03",
                    "ProjectId": 0,
                    "OpenBgp": 0,
                    "Snat": false,
                    "Isolation": 0,
                    "Log": "",
                    "AnycastZone": "",
                    "VpcId": "vpc-1y****83",
                    "NumericalVpcId": 1111113,
                    "TargetRegionInfo": {
                        "Region": "ap-guangzhou",
                        "VpcId": "vpc-1y****83"
                    },
                    "SubnetId": "",
                    "SecureGroups": [],
                    "Tags": [
                        {
                            "TagKey": "key-****",
                            "TagValue": "value-****"
                        }
                    ],
                    "MasterZone": {
                        "ZoneId": 100003,
                        "Zone": "ap-guangzhou-3",
                        "ZoneName": "广州三区",
                        "ZoneRegion": "ap-guangzhou",
                        "LocalZone": false,
                        "EdgeZone": false
                    },
                    "BackupZoneSet": null,
                    "IsolatedTime": null,
                    "ExpireTime": "2024-01-27 15:53:46",
                    "ChargeType": "POSTPAID_BY_HOUR",
                    "NetworkAttributes": {
                        "InternetChargeType": "TRAFFIC_POSTPAID_BY_HOUR",
                        "InternetMaxBandwidthOut": 5,
                        "BandwidthpkgSubType": "BGP"
                    },
                    "PrepaidAttributes": null,
                    "ExtraInfo": null,
                    "LogSetId": "",
                    "LogTopicId": "",
                    "LoadBalancerPassToTarget": false,
                    "IsDDos": false,
                    "ConfigId": "",
                    "ExclusiveCluster": {
                        "L4Clusters": null,
                        "L7Clusters": null,
                        "ClassicalCluster": null
                    },
                    "SnatPro": false,
                    "SnatIps": [],
                    "IsBlock": false,
                    "IsBlockTime": "",
                    "SlaType": "",
                    "ClusterTag": null,
                    "LocalBgp": false,
                    "MixIpTarget": false,
                    "Zones": null,
                    "NfvInfo": "",
                    "HealthLogSetId": "",
                    "HealthLogTopicId": "",
                    "ClusterIds": null,
                    "AttributeFlags": [
                        "SharedLimitFlag"
                    ],
                    "VipIsp": "BGP",
                    "Egress": ""
                }
            ],
            "RequestId": "b0e9e810-01cc-4c12-8bd2-ca0a2ab1b976"
        }
    }

    5. 开发者资源

    腾讯云 API 平台

    腾讯云 API 平台 是综合 API 文档、错误码、API Explorer 及 SDK 等资源的统一查询平台,方便您从同一入口查询及使用腾讯云提供的所有 API 服务。

    API Inspector

    用户可通过 API Inspector 查看控制台每一步操作关联的 API 调用情况,并自动生成各语言版本的 API 代码,也可前往 API Explorer 进行在线调试。

    SDK

    云 API 3.0 提供了配套的开发工具集(SDK),支持多种编程语言,能更方便的调用 API。

    命令行工具

    6. 错误码

    以下仅列出了接口业务逻辑相关的错误码,其他错误码详见 公共错误码

    错误码 描述
    FailedOperation 操作失败。
    InternalError 内部错误。
    InvalidParameter 参数错误。
    InvalidParameter.FormatError 参数格式错误。
    InvalidParameter.RegionNotFound 地域无效。
    InvalidParameterValue 参数取值错误。
    InvalidParameterValue.InvalidFilter Filter参数输入错误。
    InvalidParameterValue.Length 参数长度错误。
    InvalidParameterValue.Range 参数取值范围错误。
    UnauthorizedOperation 未授权操作。
    UnsupportedOperation 操作不支持。