Skip to content

Commit f0f6fd3

Browse files
authored
Split & Rename the Dispatch object (#194)
* `DispatchDetail` is now `Dispatch` * `Dispatch` became `DispatchData` * Member part of `Dispatch` is now the new message `DispatchMedatata` fixes #193
2 parents caf1e00 + 75dd10d commit f0f6fd3

File tree

2 files changed

+23
-15
lines changed

2 files changed

+23
-15
lines changed

RELEASE_NOTES.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66

77
## Upgrading
88

9-
<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
9+
* `DispatchDetail` is now `Dispatch`
10+
* `Dispatch` became `DispatchData`
11+
* Member part of `Dispatch` is now the new message `DispatchMedatata`
1012

1113
## New Features
1214

proto/frequenz/api/dispatch/v1/dispatch.proto

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ message StreamMicrogridDispatchesResponse {
109109
}
110110

111111
// Dispatch record returned.
112-
DispatchDetail dispatch_detail = 1;
112+
Dispatch dispatch = 1;
113113

114114
// Which event this response was triggered by
115115
Event event = 2;
@@ -119,7 +119,7 @@ message StreamMicrogridDispatchesResponse {
119119
//
120120
// Timezone Note: Timestamps are in UTC. It is the responsibility of each microgrid to translate UTC
121121
// to its local timezone.
122-
message Dispatch {
122+
message DispatchData {
123123
// The dispatch type.
124124
// Contains user-defined information about what "type" of dispatch this is.
125125
// Downstream applications that consume the dispatch API are responsible for
@@ -170,24 +170,30 @@ message Dispatch {
170170
}
171171

172172
// Represents a dispatch, including its metadata
173-
message DispatchDetail {
174-
// Unique identifier of the microgrid dispatch.
175-
uint64 dispatch_id = 1;
173+
message Dispatch {
174+
// Dispatch Metadata (id, create time, etc)
175+
DispatchMetadata metadata = 1;
176176

177177
// The dispatch data
178-
Dispatch dispatch = 2;
178+
DispatchData data = 2;
179+
}
180+
181+
// Represents the metadata of a dispatch
182+
message DispatchMetadata {
183+
// Unique identifier of the microgrid dispatch.
184+
uint64 dispatch_id = 1;
179185

180186
// UTC Timestamp when the order was created.
181-
google.protobuf.Timestamp create_time = 3;
187+
google.protobuf.Timestamp create_time = 2;
182188

183189
// UTC Timestamp of the last update to the order.
184-
google.protobuf.Timestamp modification_time = 4;
190+
google.protobuf.Timestamp modification_time = 3;
185191

186192
// UTC Timestamp when the dispatch will stop working.
187193
// Will be calculated internally based on the given: start_time,
188194
// duration and RecurenceRule
189195
// None if dispatch duration time is infinite and this value can't be calculated.
190-
google.protobuf.Timestamp end_time = 5;
196+
google.protobuf.Timestamp end_time = 4;
191197
}
192198

193199
// Filter parameter for specifying multiple time intervals
@@ -522,7 +528,7 @@ message ListMicrogridDispatchesRequest {
522528
// A list of dispatches
523529
message ListMicrogridDispatchesResponse {
524530
// The dispatches
525-
repeated DispatchDetail dispatches = 1;
531+
repeated Dispatch dispatches = 1;
526532

527533
// Pagination parameters
528534
frequenz.api.common.v1.pagination.PaginationParams pagination_params = 4;
@@ -534,13 +540,13 @@ message CreateMicrogridDispatchRequest {
534540
uint64 microgrid_id = 1;
535541

536542
// Content of the dispatch to be created
537-
Dispatch dispatch = 2;
543+
DispatchData dispatch_data = 2;
538544
}
539545

540546
// Response message for creating a new dispatch
541547
message CreateMicrogridDispatchResponse {
542548
// The created dispatch
543-
DispatchDetail dispatch = 1;
549+
Dispatch dispatch = 1;
544550
}
545551

546552
// Message to update the dispatch with the given ID, with the given attributes
@@ -615,7 +621,7 @@ message UpdateMicrogridDispatchRequest {
615621
// Response message for updating a dispatch
616622
message UpdateMicrogridDispatchResponse {
617623
// The updated dispatch
618-
DispatchDetail dispatch = 1;
624+
Dispatch dispatch = 1;
619625
}
620626

621627
// Message to get a single dispatch by its ID
@@ -633,7 +639,7 @@ message GetMicrogridDispatchResponse {
633639
uint64 microgrid_id = 1;
634640

635641
// The dispatch
636-
DispatchDetail dispatch = 2;
642+
Dispatch dispatch = 2;
637643
}
638644

639645
// Message to delete a single dispatch by its ID

0 commit comments

Comments
 (0)