调用GetListenerHealthStatus查询监听及其相应配置的转发规则的健康检查状态。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | GetListenerHealthStatus |
要执行的操作。 取值:GetListenerHealthStatus。 |
ListenerId | String | 是 | lsr-bp1bpn0kn908w4nbw**** |
实例的监听ID。 |
IncludeRule | Boolean | 否 | true |
是否包含转发规则的检查结果。取值:
|
NextToken | String | 否 | FFmyTO70tTpLG6I3FmYAXGKPd**** |
是否拥有下一次查询的令牌(Token)。取值:
|
MaxResults | Long | 否 | 20 |
分批次查询时每次显示的最大条目数。取值范围:1~30,默认值为20。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
ListenerHealthStatus | Array of ListenerHealthStatusModel |
监听的服务器组健康检查状态列表。 |
|
ListenerId | String | lsr-bp1bpn0kn908w4nbw**** |
实例的监听ID。 |
ListenerPort | Integer | 80 |
监听的端口号。 |
ListenerProtocol | String | http |
监听的协议。 |
ServerGroupInfos | Array of ServerGroupHealthStatusModel |
服务器组信息。 |
|
HealthCheckEnabled | String | false |
健康检查开启状态。取值范围:
|
NonNormalServers | Array of BackendServerHealthStatusModel |
非正常状态的后端服务器列表。 |
|
Port | Integer | 90 |
后端服务器端口。 |
Reason | Object |
非正常状态的原因。 |
|
ActualResponse | String | 302 |
后端服务器实际的返回码信息,例如,302。 说明
ReasonCode 为RESPONSE_MISMATCH才该返回值。
|
ExpectedResponse | String | HTTP_2xx |
用户预期的后端服务器返回码信息。 取值:HTTP_2xx、HTTP_3xx、HTTP_4xx和HTTP_5xx。多个返回码之间用半角逗号(,)分隔。 说明 ReasonCode为RESPONSE_MISMATCH才返回该值。
|
ReasonCode | String | RESPONSE_MISMATCH |
Status为异常状态时的详细原因,目前仅HTTP和HTTPS的监听与转发规则支持查看异常状态原因:
|
ServerId | String | rg-bp1bfa08ex***** |
后端服务器ID。 |
ServerIp | String | 192.XX.XX.10 |
后端服务器IP。 |
Status | String | Initial |
健康检查状态。取值:
|
ServerGroupId | String | vsp-bp1qjwo61pqz3ahltv**** |
关联的虚拟服务器组ID。 |
ActionType | String | TrafficMirror |
服务器组使用类型。 |
RequestId | String | CEF72CEB-54B6-4AE8-B225-F876FF7BA984 |
请求ID。 |
RuleHealthStatus | Array of RuleHealthStatusModel |
转发规则的健康状态列表。 |
|
RuleId | String | rule-hp34s2h0xx1ht4nwo**** |
转发规则ID。 |
ServerGroupInfos | Array of ServerGroupHealthStatusModel |
服务器组列表。 |
|
HealthCheckEnabled | String | false |
健康检查开启状态。取值范围: true:开启健康检查。 false:关闭健康检查。 |
NonNormalServers | Array of NonNormalServer |
非正常状态的后端服务器列表。 |
|
Port | Integer | 90 |
后端服务器端口。 |
Reason | Object |
非正常状态的原因。 |
|
ActualResponse | String | 302 |
后端服务器实际的返回码信息,例如,302。 说明 ReasonCode为RESPONSE_MISMATCH才有值。
|
ExpectedResponse | String | HTTP_2xx |
用户预期的后端服务器返回码信息。 取值:HTTP_2xx、HTTP_3xx、HTTP_4xx和HTTP_5xx。多个返回码之间用半角逗号(,)分隔。 说明 ReasonCode为RESPONSE_MISMATCH才有值。
|
ReasonCode | String | RESPONSE_MISMATCH |
Status为异常状态时的详细原因,目前仅HTTP和HTTPS的监听与转发规则支持查看异常状态原因:
|
ServerId | String | rg-bp1bfa08ex**** |
后端服务器ID。 |
ServerIp | String | 192.168.2.11 |
后端服务器组IP。 |
Status | String | Initial |
健康检查状态。取值:
|
ServerGroupId | String | vsp-bp1qjwo61pqz3ahlt**** |
关联的虚拟服务器组ID。 |
ActionType | String | TrafficMirror |
服务器组使用类型。 |
NextToken | String | FFmyTO70tTpLG6I3FmYAXGKPd**** |
是否拥有下一次查询的令牌(Token)。取值:
|
示例
请求示例
http(s)://[Endpoint]/?Action=GetListenerHealthStatus
&ListenerId=lsr-bp1bpn0kn908w4nbw****
&IncludeRule=true
&NextToken=FFmyTO70tTpLG6I3FmYAXGKPd****
&MaxResults=20
&公共请求参数
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<GetListenerHealthStatusResponse>
<ListenerHealthStatus>
<ListenerId>lsr-bp1bpn0kn908w4nbw****</ListenerId>
<ListenerPort>80</ListenerPort>
<ListenerProtocol>http</ListenerProtocol>
<ServerGroupInfos>
<HealthCheckEnabled>false</HealthCheckEnabled>
<NonNormalServers>
<Port>90</Port>
<Reason>
<ActualResponse>302</ActualResponse>
<ExpectedResponse>HTTP_2xx</ExpectedResponse>
<ReasonCode>RESPONSE_MISMATCH</ReasonCode>
</Reason>
<ServerId>rg-bp1bfa08ex*****</ServerId>
<ServerIp>192.XX.XX.10</ServerIp>
<Status>Initial</Status>
</NonNormalServers>
<ServerGroupId>vsp-bp1qjwo61pqz3ahltv****</ServerGroupId>
<ActionType>TrafficMirror</ActionType>
</ServerGroupInfos>
</ListenerHealthStatus>
<RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BA984</RequestId>
<RuleHealthStatus>
<RuleId>rule-hp34s2h0xx1ht4nwo****</RuleId>
<ServerGroupInfos>
<HealthCheckEnabled>false</HealthCheckEnabled>
<NonNormalServers>
<Port>90</Port>
<Reason>
<ActualResponse>302</ActualResponse>
<ExpectedResponse>HTTP_2xx</ExpectedResponse>
<ReasonCode>RESPONSE_MISMATCH</ReasonCode>
</Reason>
<ServerId>rg-bp1bfa08ex****</ServerId>
<ServerIp>192.168.2.11</ServerIp>
<Status>Initial</Status>
</NonNormalServers>
<ServerGroupId>vsp-bp1qjwo61pqz3ahlt****</ServerGroupId>
<ActionType>TrafficMirror</ActionType>
</ServerGroupInfos>
</RuleHealthStatus>
<NextToken>FFmyTO70tTpLG6I3FmYAXGKPd****</NextToken>
</GetListenerHealthStatusResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"ListenerHealthStatus" : [ {
"ListenerId" : "lsr-bp1bpn0kn908w4nbw****",
"ListenerPort" : 80,
"ListenerProtocol" : "http",
"ServerGroupInfos" : [ {
"HealthCheckEnabled" : "false",
"NonNormalServers" : [ {
"Port" : 90,
"Reason" : {
"ActualResponse" : "302",
"ExpectedResponse" : "HTTP_2xx",
"ReasonCode" : "RESPONSE_MISMATCH"
},
"ServerId" : "rg-bp1bfa08ex*****",
"ServerIp" : "192.XX.XX.10",
"Status" : "Initial"
} ],
"ServerGroupId" : "vsp-bp1qjwo61pqz3ahltv****",
"ActionType" : "TrafficMirror"
} ]
} ],
"RequestId" : "CEF72CEB-54B6-4AE8-B225-F876FF7BA984",
"RuleHealthStatus" : [ {
"RuleId" : "rule-hp34s2h0xx1ht4nwo****",
"ServerGroupInfos" : [ {
"HealthCheckEnabled" : "false",
"NonNormalServers" : [ {
"Port" : 90,
"Reason" : {
"ActualResponse" : "302",
"ExpectedResponse" : "HTTP_2xx",
"ReasonCode" : "RESPONSE_MISMATCH"
},
"ServerId" : "rg-bp1bfa08ex****",
"ServerIp" : "192.168.2.11",
"Status" : "Initial"
} ],
"ServerGroupId" : "vsp-bp1qjwo61pqz3ahlt****",
"ActionType" : "TrafficMirror"
} ]
} ],
"NextToken" : "FFmyTO70tTpLG6I3FmYAXGKPd****"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
404 | ResourceNotFound.LoadBalancer | The specified resource %s is not found. | 资源%s不存在。 |
404 | ResourceNotFound.Listener | The specified resource %s is not found. | 资源%s不存在。 |
访问错误中心查看更多错误码。