admin: expose listener name/address through /listener admin endpoint (#7131)
The current /listeners admin endpoint only returns a JSON-encoded list of addresses/ports. If a listener config binds to port 0, the endpoint will return the port that was assigned, but if there are multiple listeners binding to port 0, there's no way to tell which listener received which port. This PR adds a proto that contains the listener's name and address. The /listeners endpoint returns this data in both text and JSON format, similar to the /clusters admin endpoint. Risk Level: Low (according to #6959 the /listeners admin endpoint is only used for testing) Testing: I updated integration_admin_test.cc to test the new output formats for the /listeners endpoint. I also updated the tools/socket_passing.py script that's used for integration/hotrestart_test. Docs Changes: new inline docs in listeners.proto updated the admin menu description of /listeners Release Notes: admin: /listener endpoint now returns :ref:listener.proto<api/envoy/admin/v2alpha/listeners.proto> Fixes #6959 Signed-off-by: Kaisen Chen <kaisen@yelp.com> Mirrored from https://github.com/envoyproxy/envoy @ 4461f431112876932e0328f6af31de7cf34fadfcpull/620/head
parent
f2b62fb83e
commit
a83394157a
3 changed files with 38 additions and 0 deletions
@ -0,0 +1,28 @@ |
||||
syntax = "proto3"; |
||||
|
||||
package envoy.admin.v2alpha; |
||||
|
||||
option java_outer_classname = "ListenersProto"; |
||||
option java_multiple_files = true; |
||||
option java_package = "io.envoyproxy.envoy.admin.v2alpha"; |
||||
|
||||
import "envoy/api/v2/core/address.proto"; |
||||
|
||||
// [#protodoc-title: Listeners] |
||||
|
||||
// Admin endpoint uses this wrapper for `/listeners` to display listener status information. |
||||
// See :ref:`/listeners <operations_admin_interface_listeners>` for more information. |
||||
message Listeners { |
||||
// List of listener statuses. |
||||
repeated ListenerStatus listener_statuses = 1; |
||||
} |
||||
|
||||
// Details an individual listener's current status. |
||||
message ListenerStatus { |
||||
// Name of the listener |
||||
string name = 1; |
||||
|
||||
// The actual local address that the listener is listening on. If a listener was configured |
||||
// to listen on port 0, then this address has the port that was allocated by the OS. |
||||
envoy.api.v2.core.Address local_address = 2; |
||||
} |
Loading…
Reference in new issue