Skip to content

Commit

Permalink
add Summary proto definition
Browse files Browse the repository at this point in the history
Signed-off-by: Avinal Kumar <[email protected]>
  • Loading branch information
avinal authored and tekton-robot committed Jan 29, 2024
1 parent 0f57560 commit e4d4ce7
Show file tree
Hide file tree
Showing 6 changed files with 797 additions and 178 deletions.
24 changes: 24 additions & 0 deletions proto/v1alpha2/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,18 @@ service Results {
delete: "/apis/results.tekton.dev/v1alpha2/parents/{name=*/results/*/records/*}"
};
}

rpc GetResultSummary(GetResultRequest) returns (Summary) {
option (google.api.http) = {
get: "/apis/results.tekton.dev/v1alpha2/parents/{name=*/results/*}/summary"
};
}

rpc GetResultsListSummary(ResultListSummaryRequest) returns (Summary) {
option (google.api.http) = {
get: "/apis/results.tekton.dev/v1alpha2/parents/{parent=*}/results/summary"
};
}
}

service Logs {
Expand Down Expand Up @@ -163,6 +175,18 @@ message GetResultRequest {
}];
}

message ResultListSummaryRequest {
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "tekton.results.v1alpha2/Result"
}];

string filter = 2;

string group_by = 3;
}

message ListResultsRequest {
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
Expand Down
18 changes: 17 additions & 1 deletion proto/v1alpha2/resources.proto
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,20 @@ message LogSummary {

// Number of bytes received while streaming
int64 bytesReceived = 2;
}
}

message Summary {
// The query that was used to generate this summary
string query = 1;

// The criteria for grouping
string group_by = 2;

// The aggregated results of the query. It is a map of the form "group-name" : <map-of-aggregations>
// for a non grouped response it is "default": <map-of-aggregations>
map<string, Aggregations> data = 3;
}

message Aggregations {
map<string, string> aggregations = 1;
}
Loading

0 comments on commit e4d4ce7

Please sign in to comment.