Skip to content

Commit

Permalink
update/tag.v2: Release Batched GetAll/Subscribe verbs
Browse files Browse the repository at this point in the history
Change-Id: Ie54edafc10611b115e780a3118c093633b45c756
  • Loading branch information
oumichae1 committed May 13, 2024
1 parent 14c8ffe commit 38eab1b
Show file tree
Hide file tree
Showing 3 changed files with 370 additions and 94 deletions.
174 changes: 174 additions & 0 deletions arista/tag.v2/services.gen.proto
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,54 @@ message TagStreamResponse {
arista.subscriptions.Operation type = 3;
};

message TagBatchedStreamRequest {
// PartialEqFilter provides a way to server-side filter a GetAll/Subscribe.
// This requires all provided fields to be equal to the response.
//
// While transparent to users, this field also allows services to optimize internal
// subscriptions if filter(s) are sufficiently specific.
repeated Tag partial_eq_filter = 1;

// TimeRange allows limiting response data to within a specified time window.
// If this field is populated, at least one of the two time fields are required.
//
// For GetAll, the fields start and end can be used as follows:
//
// * end: Returns the state of each Tag at end.
// * Each Tag response is fully-specified (all fields set).
// * start: Returns the state of each Tag at start, followed by updates until now.
// * Each Tag response at start is fully-specified, but updates may be partial.
// * start and end: Returns the state of each Tag at start, followed by updates
// until end.
// * Each Tag response at start is fully-specified, but updates until end may
// be partial.
//
// This field is not allowed in the Subscribe RPC.
arista.time.TimeBounds time = 3;

// MaxMessages limits the maximum number of messages that can be contained in one batch.
// MaxMessages is required to be at least 1.
// The maximum number of messages in a batch is min(max_messages, INTERNAL_BATCH_LIMIT)
// INTERNAL_BATCH_LIMIT is set based on the maximum message size.
google.protobuf.UInt32Value max_messages = 4;
};

message TagBatchedStreamResponse {
// Values are the values deemed relevant to the initiating request.
// The length of this structure is guaranteed to be between (inclusive) 1 and
// min(req.max_messages, INTERNAL_BATCH_LIMIT).
repeated TagStreamResponse responses = 1;
};

service TagService {
rpc GetOne (TagRequest) returns (TagResponse);
rpc GetSome (TagSomeRequest) returns (stream TagSomeResponse);
rpc GetAll (TagStreamRequest) returns (stream TagStreamResponse);
rpc Subscribe (TagStreamRequest) returns (stream TagStreamResponse);
rpc GetMeta (TagStreamRequest) returns (MetaResponse);
rpc SubscribeMeta (TagStreamRequest) returns (stream MetaResponse);
rpc GetAllBatched (TagBatchedStreamRequest) returns (stream TagBatchedStreamResponse);
rpc SubscribeBatched (TagBatchedStreamRequest) returns (stream TagBatchedStreamResponse);
}

message TagAssignmentRequest {
Expand Down Expand Up @@ -211,13 +252,54 @@ message TagAssignmentStreamResponse {
arista.subscriptions.Operation type = 3;
};

message TagAssignmentBatchedStreamRequest {
// PartialEqFilter provides a way to server-side filter a GetAll/Subscribe.
// This requires all provided fields to be equal to the response.
//
// While transparent to users, this field also allows services to optimize internal
// subscriptions if filter(s) are sufficiently specific.
repeated TagAssignment partial_eq_filter = 1;

// TimeRange allows limiting response data to within a specified time window.
// If this field is populated, at least one of the two time fields are required.
//
// For GetAll, the fields start and end can be used as follows:
//
// * end: Returns the state of each TagAssignment at end.
// * Each TagAssignment response is fully-specified (all fields set).
// * start: Returns the state of each TagAssignment at start, followed by updates until now.
// * Each TagAssignment response at start is fully-specified, but updates may be partial.
// * start and end: Returns the state of each TagAssignment at start, followed by updates
// until end.
// * Each TagAssignment response at start is fully-specified, but updates until end may
// be partial.
//
// This field is not allowed in the Subscribe RPC.
arista.time.TimeBounds time = 3;

// MaxMessages limits the maximum number of messages that can be contained in one batch.
// MaxMessages is required to be at least 1.
// The maximum number of messages in a batch is min(max_messages, INTERNAL_BATCH_LIMIT)
// INTERNAL_BATCH_LIMIT is set based on the maximum message size.
google.protobuf.UInt32Value max_messages = 4;
};

message TagAssignmentBatchedStreamResponse {
// Values are the values deemed relevant to the initiating request.
// The length of this structure is guaranteed to be between (inclusive) 1 and
// min(req.max_messages, INTERNAL_BATCH_LIMIT).
repeated TagAssignmentStreamResponse responses = 1;
};

service TagAssignmentService {
rpc GetOne (TagAssignmentRequest) returns (TagAssignmentResponse);
rpc GetSome (TagAssignmentSomeRequest) returns (stream TagAssignmentSomeResponse);
rpc GetAll (TagAssignmentStreamRequest) returns (stream TagAssignmentStreamResponse);
rpc Subscribe (TagAssignmentStreamRequest) returns (stream TagAssignmentStreamResponse);
rpc GetMeta (TagAssignmentStreamRequest) returns (MetaResponse);
rpc SubscribeMeta (TagAssignmentStreamRequest) returns (stream MetaResponse);
rpc GetAllBatched (TagAssignmentBatchedStreamRequest) returns (stream TagAssignmentBatchedStreamResponse);
rpc SubscribeBatched (TagAssignmentBatchedStreamRequest) returns (stream TagAssignmentBatchedStreamResponse);
}

message TagAssignmentConfigRequest {
Expand Down Expand Up @@ -305,6 +387,45 @@ message TagAssignmentConfigStreamResponse {
arista.subscriptions.Operation type = 3;
};

message TagAssignmentConfigBatchedStreamRequest {
// PartialEqFilter provides a way to server-side filter a GetAll/Subscribe.
// This requires all provided fields to be equal to the response.
//
// While transparent to users, this field also allows services to optimize internal
// subscriptions if filter(s) are sufficiently specific.
repeated TagAssignmentConfig partial_eq_filter = 1;

// TimeRange allows limiting response data to within a specified time window.
// If this field is populated, at least one of the two time fields are required.
//
// For GetAll, the fields start and end can be used as follows:
//
// * end: Returns the state of each TagAssignmentConfig at end.
// * Each TagAssignmentConfig response is fully-specified (all fields set).
// * start: Returns the state of each TagAssignmentConfig at start, followed by updates until now.
// * Each TagAssignmentConfig response at start is fully-specified, but updates may be partial.
// * start and end: Returns the state of each TagAssignmentConfig at start, followed by updates
// until end.
// * Each TagAssignmentConfig response at start is fully-specified, but updates until end may
// be partial.
//
// This field is not allowed in the Subscribe RPC.
arista.time.TimeBounds time = 3;

// MaxMessages limits the maximum number of messages that can be contained in one batch.
// MaxMessages is required to be at least 1.
// The maximum number of messages in a batch is min(max_messages, INTERNAL_BATCH_LIMIT)
// INTERNAL_BATCH_LIMIT is set based on the maximum message size.
google.protobuf.UInt32Value max_messages = 4;
};

message TagAssignmentConfigBatchedStreamResponse {
// Values are the values deemed relevant to the initiating request.
// The length of this structure is guaranteed to be between (inclusive) 1 and
// min(req.max_messages, INTERNAL_BATCH_LIMIT).
repeated TagAssignmentConfigStreamResponse responses = 1;
};

message TagAssignmentConfigSetRequest {
// TagAssignmentConfig carries the value to set into the datastore.
// See the documentation on the TagAssignmentConfig struct for which fields are required.
Expand Down Expand Up @@ -371,10 +492,15 @@ message TagAssignmentConfigDeleteSomeResponse {
};

message TagAssignmentConfigDeleteAllRequest {
// PartialEqFilter provides a way to server-side filter a DeleteAll.
// This requires all provided fields to be equal to the response.
// A filtered DeleteAll will use GetAll with filter to find things to delete.
repeated TagAssignmentConfig partial_eq_filter = 1;
};

message TagAssignmentConfigDeleteAllResponse {
// This describes the class of delete error.
// A DeleteAllResponse is only sent when there is an error.
fmp.DeleteError type = 1;
// This indicates the error message from the delete failure.
google.protobuf.StringValue error = 2;
Expand All @@ -396,6 +522,8 @@ service TagAssignmentConfigService {
rpc Delete (TagAssignmentConfigDeleteRequest) returns (TagAssignmentConfigDeleteResponse);
rpc DeleteSome (TagAssignmentConfigDeleteSomeRequest) returns (stream TagAssignmentConfigDeleteSomeResponse);
rpc DeleteAll (TagAssignmentConfigDeleteAllRequest) returns (stream TagAssignmentConfigDeleteAllResponse);
rpc GetAllBatched (TagAssignmentConfigBatchedStreamRequest) returns (stream TagAssignmentConfigBatchedStreamResponse);
rpc SubscribeBatched (TagAssignmentConfigBatchedStreamRequest) returns (stream TagAssignmentConfigBatchedStreamResponse);
}

message TagConfigRequest {
Expand Down Expand Up @@ -483,6 +611,45 @@ message TagConfigStreamResponse {
arista.subscriptions.Operation type = 3;
};

message TagConfigBatchedStreamRequest {
// PartialEqFilter provides a way to server-side filter a GetAll/Subscribe.
// This requires all provided fields to be equal to the response.
//
// While transparent to users, this field also allows services to optimize internal
// subscriptions if filter(s) are sufficiently specific.
repeated TagConfig partial_eq_filter = 1;

// TimeRange allows limiting response data to within a specified time window.
// If this field is populated, at least one of the two time fields are required.
//
// For GetAll, the fields start and end can be used as follows:
//
// * end: Returns the state of each TagConfig at end.
// * Each TagConfig response is fully-specified (all fields set).
// * start: Returns the state of each TagConfig at start, followed by updates until now.
// * Each TagConfig response at start is fully-specified, but updates may be partial.
// * start and end: Returns the state of each TagConfig at start, followed by updates
// until end.
// * Each TagConfig response at start is fully-specified, but updates until end may
// be partial.
//
// This field is not allowed in the Subscribe RPC.
arista.time.TimeBounds time = 3;

// MaxMessages limits the maximum number of messages that can be contained in one batch.
// MaxMessages is required to be at least 1.
// The maximum number of messages in a batch is min(max_messages, INTERNAL_BATCH_LIMIT)
// INTERNAL_BATCH_LIMIT is set based on the maximum message size.
google.protobuf.UInt32Value max_messages = 4;
};

message TagConfigBatchedStreamResponse {
// Values are the values deemed relevant to the initiating request.
// The length of this structure is guaranteed to be between (inclusive) 1 and
// min(req.max_messages, INTERNAL_BATCH_LIMIT).
repeated TagConfigStreamResponse responses = 1;
};

message TagConfigSetRequest {
// TagConfig carries the value to set into the datastore.
// See the documentation on the TagConfig struct for which fields are required.
Expand Down Expand Up @@ -549,10 +716,15 @@ message TagConfigDeleteSomeResponse {
};

message TagConfigDeleteAllRequest {
// PartialEqFilter provides a way to server-side filter a DeleteAll.
// This requires all provided fields to be equal to the response.
// A filtered DeleteAll will use GetAll with filter to find things to delete.
repeated TagConfig partial_eq_filter = 1;
};

message TagConfigDeleteAllResponse {
// This describes the class of delete error.
// A DeleteAllResponse is only sent when there is an error.
fmp.DeleteError type = 1;
// This indicates the error message from the delete failure.
google.protobuf.StringValue error = 2;
Expand All @@ -574,4 +746,6 @@ service TagConfigService {
rpc Delete (TagConfigDeleteRequest) returns (TagConfigDeleteResponse);
rpc DeleteSome (TagConfigDeleteSomeRequest) returns (stream TagConfigDeleteSomeResponse);
rpc DeleteAll (TagConfigDeleteAllRequest) returns (stream TagConfigDeleteAllResponse);
rpc GetAllBatched (TagConfigBatchedStreamRequest) returns (stream TagConfigBatchedStreamResponse);
rpc SubscribeBatched (TagConfigBatchedStreamRequest) returns (stream TagConfigBatchedStreamResponse);
}
Loading

0 comments on commit 38eab1b

Please sign in to comment.