Skip to content

Commit c2d5330

Browse files
committed
refactor(api): rename list methods to streaming methods in assets.proto
Updated the RPC methods in assets.proto to use streaming for electrical components and connections, enhancing consistency with other APIs. Adjusted corresponding request and response message names in the proto file. Updated release notes to reflect these breaking changes. Signed-off-by: Richard Sandoval <[email protected]>
1 parent 676e2c5 commit c2d5330

File tree

2 files changed

+16
-19
lines changed

2 files changed

+16
-19
lines changed

RELEASE_NOTES.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
22

33
## Summary
44

5+
## Breaking Changes
56

6-
## Upgrading
7-
8-
- Update the `frequenz-api-common` dependency
9-
10-
## New Features
7+
- Changed list methods to streaming methods to align with the rest of the APIs
118

129

proto/frequenz/api/assets/v1/assets.proto

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ service PlatformAssets {
2525
rpc GetMicrogrid(GetMicrogridRequest) returns (GetMicrogridResponse);
2626

2727
// Returns list of a electrical components for a specific microgrid.
28-
rpc ListMicrogridElectricalComponents(ListMicrogridElectricalComponentsRequest)
29-
returns (ListMicrogridElectricalComponentsResponse);
28+
rpc ReceiveMicrogridElectricalComponentsStream(ReceiveMicrogridElectricalComponentsStreamRequest)
29+
returns (stream ReceiveMicrogridElectricalComponentsStreamResponse);
3030

3131
// Returns a list of the connections between electrical components for a
3232
// specific microgrid.
33-
rpc ListMicrogridElectricalComponentConnections(
34-
ListMicrogridElectricalComponentConnectionsRequest
35-
) returns (ListMicrogridElectricalComponentConnectionsResponse);
33+
rpc ReceiveMicrogridElectricalComponentConnectionsStream(
34+
ReceiveMicrogridElectricalComponentConnectionsStreamRequest
35+
) returns (stream ReceiveMicrogridElectricalComponentConnectionsStreamResponse);
3636
}
3737

3838
// GetMicrogridRequest is the input parameter for fetching details
@@ -49,8 +49,8 @@ message GetMicrogridResponse {
4949
frequenz.api.common.v1alpha8.microgrid.Microgrid microgrid = 1;
5050
}
5151

52-
// Request parameters for the RPC `ListMicrogridElectricalComponents`.
53-
message ListMicrogridElectricalComponentsRequest {
52+
// Request parameters for the RPC `ReceiveMicrogridElectricalComponentsStream`.
53+
message ReceiveMicrogridElectricalComponentsStreamRequest {
5454
// Mandatory field. The ID of the microgrid for which components
5555
// are to be listed.
5656
uint64 microgrid_id = 1;
@@ -62,16 +62,16 @@ message ListMicrogridElectricalComponentsRequest {
6262
repeated frequenz.api.common.v1alpha8.microgrid.electrical_components.ElectricalComponentCategory categories = 3;
6363
}
6464

65-
// A message containing a list of electrical components.
66-
message ListMicrogridElectricalComponentsResponse {
65+
// ReceiveMicrogridElectricalComponentsStreamResponse is a message containing a list of electrical components.
66+
message ReceiveMicrogridElectricalComponentsStreamResponse {
6767
// Unique microgrid identifier used in the request.
6868
uint64 microgrid_id = 1;
6969

7070
// List of electrical components matching the filter criteria.
7171
repeated frequenz.api.common.v1alpha8.microgrid.electrical_components.ElectricalComponent components = 2;
7272
}
7373

74-
// ListMicrogridElectricalComponentConnectionsRequest is used for filtering and listing
74+
// ReceiveMicrogridElectricalComponentConnectionsStreamRequest is used for filtering and listing
7575
// the electrical connections between components in a specific microgrid.
7676
// These connections can be used to construct a component graph of the
7777
// microgrid.
@@ -94,7 +94,7 @@ message ListMicrogridElectricalComponentsResponse {
9494
// destination_component_id. If these fields are left empty, connections with
9595
// any source or destination will be returned.
9696
//
97-
message ListMicrogridElectricalComponentConnectionsRequest {
97+
message ReceiveMicrogridElectricalComponentConnectionsStreamRequest {
9898
// Mandatory field. The ID of the microgrid
9999
// for which connections are to be listed.
100100
uint64 microgrid_id = 1;
@@ -108,10 +108,10 @@ message ListMicrogridElectricalComponentConnectionsRequest {
108108
repeated uint64 destination_component_ids = 3;
109109
}
110110

111-
// ListMicrogridElectricalComponentConnectionsResponse holds the list of electrical
111+
// ReceiveMicrogridElectricalComponentConnectionsStreamResponse holds the list of electrical
112112
// connections that match the filter criteria specified in the
113-
// ListMicrogridElectricalComponentConnectionsRequest.
114-
message ListMicrogridElectricalComponentConnectionsResponse {
113+
// ReceiveMicrogridElectricalComponentConnectionsStreamRequest.
114+
message ReceiveMicrogridElectricalComponentConnectionsStreamResponse {
115115
// The ID of the microgrid for which connections are returned.
116116
uint64 microgrid_id = 1;
117117

0 commit comments

Comments
 (0)