From be25db5e3bea7f75476a622be68f3a8ef09253f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gurhem?= Date: Mon, 28 Aug 2023 07:33:08 +0200 Subject: [PATCH 1/3] feat: Add filters in events api --- Protos/V1/events_common.proto | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Protos/V1/events_common.proto b/Protos/V1/events_common.proto index 62d6b37a2..2013a5c32 100644 --- a/Protos/V1/events_common.proto +++ b/Protos/V1/events_common.proto @@ -4,14 +4,31 @@ package armonik.api.grpc.v1.events; import "result_status.proto"; import "task_status.proto"; +import "tasks_filters.proto"; +import "results_filters.proto"; option csharp_namespace = "ArmoniK.Api.gRPC.V1.Events"; + +/** + * Represents the events that can be returned in the EventSubscriptionResponse + */ +enum EventsEnum { + EVENTS_ENUM_NEW_TASK = 0; /** New task */ + EVENTS_ENUM_TASK_STATUS_UPDATE = 1; /** Task status update */ + EVENTS_ENUM_NEW_RESULT = 2; /** New restult */ + EVENTS_ENUM_RESULT_STATUS_UPDATE = 3; /** Result status update */ + EVENTS_ENUM_RESULT_OWNER_UPDATE = 4; /** Result owner update */ +} + /** * Request to subscribe to the event stream. */ message EventSubscriptionRequest { string session_id = 1; /** Id of the session that will be used to subscribe events for. **/ + tasks.Filters tasks_filters = 2; /** Filter for task related events. */ + results.Filters results_filters = 3; /** Filter for result related events. */ + repeated EventsEnum returned_events = 4; /** Filter the type of events to return. Empty means all. */ } /** From a3ec86b46aa9cee7a92b1d91dc058fc6acb298da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gurhem?= Date: Mon, 28 Aug 2023 07:35:29 +0200 Subject: [PATCH 2/3] style: reformat proto --- Protos/V1/events_common.proto | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Protos/V1/events_common.proto b/Protos/V1/events_common.proto index 2013a5c32..af1c106b3 100644 --- a/Protos/V1/events_common.proto +++ b/Protos/V1/events_common.proto @@ -3,13 +3,12 @@ syntax = "proto3"; package armonik.api.grpc.v1.events; import "result_status.proto"; +import "results_filters.proto"; import "task_status.proto"; import "tasks_filters.proto"; -import "results_filters.proto"; option csharp_namespace = "ArmoniK.Api.gRPC.V1.Events"; - /** * Represents the events that can be returned in the EventSubscriptionResponse */ From 16c675e32900fadfdfc502f9d55403bbc167e825 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gurhem?= Date: Mon, 28 Aug 2023 10:11:32 +0200 Subject: [PATCH 3/3] Add unspecified in the events enum --- Protos/V1/events_common.proto | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Protos/V1/events_common.proto b/Protos/V1/events_common.proto index af1c106b3..4c3171882 100644 --- a/Protos/V1/events_common.proto +++ b/Protos/V1/events_common.proto @@ -13,11 +13,12 @@ option csharp_namespace = "ArmoniK.Api.gRPC.V1.Events"; * Represents the events that can be returned in the EventSubscriptionResponse */ enum EventsEnum { - EVENTS_ENUM_NEW_TASK = 0; /** New task */ - EVENTS_ENUM_TASK_STATUS_UPDATE = 1; /** Task status update */ - EVENTS_ENUM_NEW_RESULT = 2; /** New restult */ - EVENTS_ENUM_RESULT_STATUS_UPDATE = 3; /** Result status update */ - EVENTS_ENUM_RESULT_OWNER_UPDATE = 4; /** Result owner update */ + EVENTS_ENUM_UNSPECIFIED = 0; /** Unspecified */ + EVENTS_ENUM_NEW_TASK = 1; /** New task */ + EVENTS_ENUM_TASK_STATUS_UPDATE = 2; /** Task status update */ + EVENTS_ENUM_NEW_RESULT = 3; /** New restult */ + EVENTS_ENUM_RESULT_STATUS_UPDATE = 4; /** Result status update */ + EVENTS_ENUM_RESULT_OWNER_UPDATE = 5; /** Result owner update */ } /**