From ae0f08a19cdb305e11f4dd24ad8d75d2fbc83eea Mon Sep 17 00:00:00 2001 From: Lukas Bindreiter Date: Wed, 13 May 2026 15:49:14 +0200 Subject: [PATCH] Sort direction in query jobs --- apis/tilebox/v1/query.proto | 10 ++++++++++ apis/workflows/v1/job.proto | 2 ++ apis/workflows/v1/telemetry.proto | 16 +++------------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/apis/tilebox/v1/query.proto b/apis/tilebox/v1/query.proto index 0746f58..ab9a8bc 100644 --- a/apis/tilebox/v1/query.proto +++ b/apis/tilebox/v1/query.proto @@ -51,3 +51,13 @@ message Pagination { // This is the id of the last entry returned in the previous page as the next parameter in each paginated query. tilebox.v1.ID starting_after = 2 [features.field_presence = EXPLICIT]; } + +// SortDirection specifies the direction in which to sort log entries when querying logs. It can be used in combination +// with the cursor field in TelemetryPagination to paginate through log entries in either ascending or descending order. +enum SortDirection { + SORT_DIRECTION_UNSPECIFIED = 0; + // Sort in ascending order (oldest entries first). + SORT_DIRECTION_ASCENDING = 1; + // Sort in descending order (newest entries first). + SORT_DIRECTION_DESCENDING = 2; +} diff --git a/apis/workflows/v1/job.proto b/apis/workflows/v1/job.proto index 3455886..47fc363 100644 --- a/apis/workflows/v1/job.proto +++ b/apis/workflows/v1/job.proto @@ -134,6 +134,8 @@ message QueryJobsRequest { QueryFilters filters = 1; // The pagination parameters for this request. tilebox.v1.Pagination page = 2 [features.field_presence = EXPLICIT]; + // The sort order for jobs (by submission date). Defaults to descending order (newest jobs first). + tilebox.v1.SortDirection sort_direction = 3; } // A list of jobs. diff --git a/apis/workflows/v1/telemetry.proto b/apis/workflows/v1/telemetry.proto index 0ced67f..7018fe4 100644 --- a/apis/workflows/v1/telemetry.proto +++ b/apis/workflows/v1/telemetry.proto @@ -9,16 +9,6 @@ import "opentelemetry/proto/trace/v1/trace.proto"; import "tilebox/v1/id.proto"; import "tilebox/v1/query.proto"; -// SortDirection specifies the direction in which to sort log entries when querying logs. It can be used in combination -// with the cursor field in TelemetryPagination to paginate through log entries in either ascending or descending order. -enum SortDirection { - SORT_DIRECTION_UNSPECIFIED = 0; - // Sort in ascending order (oldest entries first). - SORT_DIRECTION_ASCENDING = 1; - // Sort in descending order (newest entries first). - SORT_DIRECTION_DESCENDING = 2; -} - // QueryJobLogsRequest is the request message for querying logs of a specific job, in ascending or descending order, // with pagination support. message QueryJobLogsRequest { @@ -27,7 +17,7 @@ message QueryJobLogsRequest { // The pagination parameters for this request. tilebox.v1.Pagination page = 2 [features.field_presence = EXPLICIT]; // The direction in which to sort log entries. If not specified, defaults to ascending order (oldest entries first). - SortDirection sort_direction = 3; + tilebox.v1.SortDirection sort_direction = 3; } // QueryLogsInIntervalRequest is the request message for querying logs in a specific time interval. @@ -38,7 +28,7 @@ message QueryLogsInIntervalRequest { // The pagination parameters for this request. tilebox.v1.Pagination page = 2 [features.field_presence = EXPLICIT]; // The direction in which to sort log entries. If not specified, defaults to descending order (newest entries first). - SortDirection sort_direction = 3; + tilebox.v1.SortDirection sort_direction = 3; } // PaginatedLogsData is the response message for paginated log queries. It's a message compatible with LogsData, @@ -58,7 +48,7 @@ message QueryJobSpansRequest { // The pagination parameters for this request. tilebox.v1.Pagination page = 2 [features.field_presence = EXPLICIT]; // The direction in which to sort log entries. If not specified, defaults to ascending order (oldest entries first). - SortDirection sort_direction = 3; + tilebox.v1.SortDirection sort_direction = 3; } // PaginatedSpansData is the response message for paginated log queries. It's a message compatible with LogsData,