Skip to content

Commit ed98917

Browse files
authored
Add result cardinality limit to requests. (#40)
Add a 'limit' field and clarify the contract on fields that this depends on.
1 parent 8814e60 commit ed98917

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

grpc/channelz/v1/channelz.proto

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ message SubchannelRef {
177177

178178
// SocketRef is a reference to a Socket.
179179
message SocketRef {
180+
// The globally unique id for this socket. Must be a positive number.
180181
int64 socket_id = 3;
181182
// An optional name associated with the socket.
182183
string name = 4;
@@ -437,12 +438,21 @@ service Channelz {
437438
message GetTopChannelsRequest {
438439
// start_channel_id indicates that only channels at or above this id should be
439440
// included in the results.
441+
// To request the first page, this should be set to 0. To request
442+
// subsequent pages, the client generates this value by adding 1 to
443+
// the highest seen result ID.
440444
int64 start_channel_id = 1;
445+
446+
// If non-zero, the server will return a page of results containing
447+
// at most this many items. If zero, the server will choose a
448+
// reasonable page size. Must never be negative.
449+
int64 max_results = 2;
441450
}
442451

443452
message GetTopChannelsResponse {
444453
// list of channels that the connection detail service knows about. Sorted in
445454
// ascending channel_id order.
455+
// Must contain at least 1 result, otherwise 'end' must be true.
446456
repeated Channel channel = 1;
447457
// If set, indicates that the list of channels is the final list. Requesting
448458
// more channels can only return more if they are created after this RPC
@@ -453,12 +463,21 @@ message GetTopChannelsResponse {
453463
message GetServersRequest {
454464
// start_server_id indicates that only servers at or above this id should be
455465
// included in the results.
466+
// To request the first page, this must be set to 0. To request
467+
// subsequent pages, the client generates this value by adding 1 to
468+
// the highest seen result ID.
456469
int64 start_server_id = 1;
470+
471+
// If non-zero, the server will return a page of results containing
472+
// at most this many items. If zero, the server will choose a
473+
// reasonable page size. Must never be negative.
474+
int64 max_results = 2;
457475
}
458476

459477
message GetServersResponse {
460478
// list of servers that the connection detail service knows about. Sorted in
461479
// ascending server_id order.
480+
// Must contain at least 1 result, otherwise 'end' must be true.
462481
repeated Server server = 1;
463482
// If set, indicates that the list of servers is the final list. Requesting
464483
// more servers will only return more if they are created after this RPC
@@ -470,12 +489,21 @@ message GetServerSocketsRequest {
470489
int64 server_id = 1;
471490
// start_socket_id indicates that only sockets at or above this id should be
472491
// included in the results.
492+
// To request the first page, this must be set to 0. To request
493+
// subsequent pages, the client generates this value by adding 1 to
494+
// the highest seen result ID.
473495
int64 start_socket_id = 2;
496+
497+
// If non-zero, the server will return a page of results containing
498+
// at most this many items. If zero, the server will choose a
499+
// reasonable page size. Must never be negative.
500+
int64 max_results = 3;
474501
}
475502

476503
message GetServerSocketsResponse {
477504
// list of socket refs that the connection detail service knows about. Sorted in
478505
// ascending socket_id order.
506+
// Must contain at least 1 result, otherwise 'end' must be true.
479507
repeated SocketRef socket_ref = 1;
480508
// If set, indicates that the list of sockets is the final list. Requesting
481509
// more sockets will only return more if they are created after this RPC

0 commit comments

Comments
 (0)