From ec4bace88e61c8f3d9d5ad3b27862554a8047b12 Mon Sep 17 00:00:00 2001 From: "Mathias L. Baumann" Date: Wed, 2 Apr 2025 17:22:08 +0200 Subject: [PATCH] Add new message definitions for streaming events Signed-off-by: Mathias L. Baumann --- RELEASE_NOTES.md | 1 + .../api/common/v1/streaming/event.proto | 26 +++++++++++++++++++ .../api/common/v1/streaming/__init__.py | 4 +++ 3 files changed, 31 insertions(+) create mode 100644 proto/frequenz/api/common/v1/streaming/event.proto create mode 100644 py/frequenz/api/common/v1/streaming/__init__.py diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 0002cc67..7d2c0ad9 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -20,6 +20,7 @@ - Added warnings to sensor `SensorState`. - Added a common `TimeIntervalFilter` message in `frequenz.api.common.v1.types` to standardize time interval filtering across APIs. This uses `start_time` (inclusive) and `end_time` (exclusive) fields, aligning with ISO 8601 and common programming conventions. - Added new message `CommunicationComponentDiagnostic` to represent warnings and errors in microgrid communication components. +- Added new message definitions for streaming events (Deleted, Created, Updated) ## Bug Fixes diff --git a/proto/frequenz/api/common/v1/streaming/event.proto b/proto/frequenz/api/common/v1/streaming/event.proto new file mode 100644 index 00000000..8f420a24 --- /dev/null +++ b/proto/frequenz/api/common/v1/streaming/event.proto @@ -0,0 +1,26 @@ +// Possible streaming events +// +// Copyright 2025 Frequenz Energy-as-a-Service GmbH +// +// Licensed under the MIT License (the "License"); +// you may not use this file except in compliance with the License. + +syntax = "proto3"; + +package frequenz.api.common.v1.streaming; + +// This enum message is used to inform receivers of events what kind of +// event they just received +enum Event { + // Default, unspecified event + EVENT_UNSPECIFIED = 0; + + // A new dispatch has been created + EVENT_CREATED = 1; + + // An existing dispatch has been updated + EVENT_UPDATED = 2; + + // An existing dispatch has been deleted + EVENT_DELETED = 3; +} diff --git a/py/frequenz/api/common/v1/streaming/__init__.py b/py/frequenz/api/common/v1/streaming/__init__.py new file mode 100644 index 00000000..6e2c2a7c --- /dev/null +++ b/py/frequenz/api/common/v1/streaming/__init__.py @@ -0,0 +1,4 @@ +# License: MIT +# Copyright © 2023 Frequenz Energy-as-a-Service GmbH + +"""Frequenz common gRPC API and bindings."""