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.Name 和Filter.Values 皆为必填项。详细的过滤条件如下: |
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。
- Tencent Cloud SDK 3.0 for Python: GitHub Gitee
- Tencent Cloud SDK 3.0 for Java: GitHub Gitee
- Tencent Cloud SDK 3.0 for PHP: GitHub Gitee
- Tencent Cloud SDK 3.0 for Go: GitHub Gitee
- Tencent Cloud SDK 3.0 for Node.js: GitHub Gitee
- Tencent Cloud SDK 3.0 for .NET: GitHub Gitee
- Tencent Cloud SDK 3.0 for C++: GitHub Gitee
- Tencent Cloud SDK 3.0 for Ruby: GitHub Gitee
命令行工具
6. 错误码
以下仅列出了接口业务逻辑相关的错误码,其他错误码详见 公共错误码。
错误码 | 描述 |
---|---|
FailedOperation | 操作失败。 |
InternalError | 内部错误。 |
InvalidParameter | 参数错误。 |
InvalidParameter.FormatError | 参数格式错误。 |
InvalidParameter.RegionNotFound | 地域无效。 |
InvalidParameterValue | 参数取值错误。 |
InvalidParameterValue.InvalidFilter | Filter参数输入错误。 |
InvalidParameterValue.Length | 参数长度错误。 |
InvalidParameterValue.Range | 参数取值范围错误。 |
UnauthorizedOperation | 未授权操作。 |
UnsupportedOperation | 操作不支持。 |