文档目录

查询负载均衡监听器(QueryLoadBalancerListener)

API请求

URLs
GET zstack/v1/load-balancers/listeners
GET zstack/v1/load-balancers/listeners/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 6d7ca1c2f39440d5a4110962854c3234" \
-X GET http://localhost:8080/zstack/v1/load-balancers/listeners
curl \
-H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 057112ec0d5e4bcd9193b1f9499169eb" \
-X GET http://localhost:8080/zstack/v1/load-balancers/listeners/cdf776df1cb04ae6a3cf1fb1330dab2d

可查询字段

运行CLI命令行工具,输入QueryLoadBalancerListener并按Tab键查看所有可查询字段以及可跨表查询的资源名。

API返回

返回示例
{
"inventories": [
    {
"uuid": "be2f6e299e364f5cb71e52f11eeee34e",
"name": "Test-Listener",
"loadBalancerUuid": "90a89f6ec62b4acf9ccb770b453fddc5",
"instancePort": 80.0,
"loadBalancerPort": 80.0,
"protocol": "http"
    }
  ]
}
名字 类型 描述 起始版本
error ErrorCode 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error 0.6
inventories List 详情参考inventories 0.6
#error
名字 类型 描述 起始版本
code String 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 0.6
description String 错误的概要描述 0.6
details String 错误的详细信息 0.6
elaboration String 保留字段,默认为null 0.6
opaque LinkedHashMap 保留字段,默认为null 0.6
cause ErrorCode 根错误,引发当前错误的源错误,若无原错误,该字段为null 0.6
#inventories
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 0.6
name String 资源名称 0.6
description String 资源的详细描述 0.6
loadBalancerUuid String 负载均衡器UUID 0.6
instancePort Integer 0.6
loadBalancerPort Integer 0.6
protocol String 0.6
createDate Timestamp 创建时间 0.6
lastOpDate Timestamp 最后一次修改时间 0.6
vmNicRefs List 详情参考vmNicRefs 0.6
certificateRefs List 详情参考certificateRefs 0.6
#vmNicRefs
名字 类型 描述 起始版本
id Long 0.6
listenerUuid String 0.6
vmNicUuid String 云主机网卡UUID 0.6
status String 0.6
createDate Timestamp 创建时间 0.6
lastOpDate Timestamp 最后一次修改时间 0.6
#certificateRefs
名字 类型 描述 起始版本
id Long 2.3
listenerUuid String 2.3
certificateUuid String 2.3
createDate Timestamp 创建时间 2.3
lastOpDate Timestamp 最后一次修改时间 2.3

SDK示例

Java SDK
QueryLoadBalancerListenerAction action = new QueryLoadBalancerListenerAction();
action.conditions = asList();
action.sessionId = "c616bc4ee56648b6a921b2da70fe7798";
QueryLoadBalancerListenerAction.Result res = action.call();
Python SDK
QueryLoadBalancerListenerAction action = QueryLoadBalancerListenerAction()
action.conditions = []
action.sessionId = "529b237f77cd4130b861ebe99a30c983"
QueryLoadBalancerListenerAction.Result res = action.call()
开发手册 | 5.4.12 | ZStack Cloud · ZCF | ZStack 资源中心