admin: convert /server_info to protobuf (#4886)

Converts the existing /server_info admin endpoint to be represented by a protobuf. This will make it easier to extend with new values in the future.

Risk Level: Low
Testing: Updated the existing unit test
Docs Changes: n/a
Release Notes: n/a

Part of #4405

Signed-off-by: Snow Pettersen <snowp@squareup.com>

Mirrored from https://github.com/envoyproxy/envoy @ 71bd095297ba64712bfad30d0aee1f019fbd32d8
pull/620/head
data-plane-api(CircleCI) 6 years ago
parent df0002f6a5
commit 69321da410
  1. 6
      envoy/admin/v2alpha/BUILD
  2. 31
      envoy/admin/v2alpha/server_info.proto

@ -43,3 +43,9 @@ api_proto_library_internal(
srcs = ["certs.proto"],
visibility = ["//visibility:public"],
)
api_proto_library_internal(
name = "server_info",
srcs = ["server_info.proto"],
visibility = ["//visibility:public"],
)

@ -0,0 +1,31 @@
syntax = "proto3";
package envoy.admin.v2alpha;
import "google/protobuf/duration.proto";
// [#protodoc-title: Server State]
// Proto representation of the value returned by /server_info, containing
// server version/server status information.
message ServerInfo {
// Server version.
string version = 1;
enum State {
// Server is live and serving traffic.
LIVE = 0;
// Server is draining listeners in response to external health checks failing.
DRAINING = 1;
}
// State of the server.
State state = 2;
// Uptime since current epoch was started.
google.protobuf.Duration uptime_current_epoch = 3;
// Uptime since the start of the first epoch.
google.protobuf.Duration uptime_all_epochs = 4;
// Which restart epoch the server is currently in.
uint32 epoch = 5;
}
Loading…
Cancel
Save