Skip to content

Commit 69ea702

Browse files
Re-design dispatch filter message
Removes a few fields that shouldn't be filterable, and introduces the DispatchListRequest message, where the microgrid_id is mandatory Fixes #27 Signed-off-by: Stefan Brus <[email protected]>
1 parent 83515b1 commit 69ea702

File tree

2 files changed

+16
-19
lines changed

2 files changed

+16
-19
lines changed

RELEASE_NOTES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
- The field `create_time` has been removed from update requests.
44
- An `update_time` field has been added to the Dispatch object.
55
- The `type` field has been removed from update requests, to prevent it from being modified after creation.
6+
- `DispatchFilter` has been replaced by `DispatchListRequest` as a parameter for `ListDispatches`.
7+
- The filter has additionally been re-designed, with fields that lack use cases being removed.

proto/frequenz/api/dispatch/dispatch.proto

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import "frequenz/api/common/components.proto";
2121

2222
service DispatchService {
2323
// Returns a list of all dispatches
24-
rpc ListDispatches(DispatchFilter) returns (DispatchList) {
24+
rpc ListDispatches(DispatchListRequest) returns (DispatchList) {
2525
option (google.api.http) = {
2626
get: "/v1/dispatches"
2727
};
@@ -116,31 +116,26 @@ message DispatchComponentIDs {
116116
repeated uint64 component_ids = 1;
117117
}
118118

119-
// Parameters for filtering the dispatch list
120-
message DispatchFilter {
121-
// Filter by dispatch ID
122-
repeated uint64 ids = 1;
123-
124-
// Filter by microgrid ID
125-
repeated uint64 microgrid_ids = 2;
119+
// Message for listing dispatches for a given microgrid, and an optional filter
120+
message DispatchListRequest {
121+
// The microgrid ID
122+
uint64 microgrid_id = 1;
126123

127-
// Filter by dispatch type
128-
repeated string types = 3;
124+
// Additional filter parameters
125+
DispatchFilter filter = 2;
126+
}
129127

128+
// Parameters for filtering the dispatch list
129+
message DispatchFilter {
130130
// Filter by component ID or category
131-
repeated DispatchComponentSelector selectors = 4;
131+
repeated DispatchComponentSelector selectors = 1;
132132

133133
// Filter by time interval
134-
TimeIntervalFilter time_interval = 5;
135-
136-
// Filter by "active" status
137-
optional bool is_active = 6;
138-
139-
// Filter by "dry run" status
140-
optional bool is_dry_run = 7;
134+
// If no interval is provided, all dispatches starting from the
135+
// current timestamp will be included.
136+
TimeIntervalFilter time_interval = 2;
141137
}
142138

143-
144139
// A list of dispatches
145140
message DispatchList {
146141
// The dispatches

0 commit comments

Comments
 (0)