Skip to content

Commit 6dc9804

Browse files
committed
feat(api): add ListMicrogrids and GetGridpool RPCs
Signed-off-by: Richard Sandoval <rsandovaldev@gmail.com>
1 parent 68b7f83 commit 6dc9804

3 files changed

Lines changed: 50 additions & 32 deletions

File tree

RELEASE_NOTES.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@
22

33
## Summary
44

5-
Documentation improvement
6-
Rename service
5+
This release adds `ListMicrogrids` and `GetGridpool` to
6+
`frequenz.api.platformassets.v1alpha1`.
77

88
## Upgrading
99

10-
- Improved ListMicrogridElectricalComponentConnectionsRequest header doc
11-
- Rename service
12-
- Introduced new version
10+
- `frequenz.api.platformassets.v1alpha1.PlatformAssetsService` now includes
11+
`ListMicrogrids`.
12+
- `frequenz.api.platformassets.v1alpha1` includes the `GetGridpool`
13+
request/response messages and RPC.
14+
- `frequenz.api.platformassets.v1alpha1` remains a separate versioned package
15+
with the renamed `PlatformAssetsService`.
1316

1417
## New Features
15-
- Add the `GetGridpool` RPC to the `PlatformAssets` service.
18+
19+
- Add the `ListMicrogrids` RPC to the `PlatformAssetsService` service.
20+
- Add the `GetGridpool` RPC to the `PlatformAssetsService` service.

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

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,8 @@ syntax = "proto3";
1212

1313
package frequenz.api.assets.v1;
1414

15-
// protolint:disable:next MAX_LINE_LENGTH
16-
import "frequenz/api/common/v1alpha8/gridpool/gridpool.proto";
1715
// protolint:disable:next MAX_LINE_LENGTH
1816
import "frequenz/api/common/v1alpha8/microgrid/electrical_components/electrical_components.proto";
19-
// protolint:disable:next MAX_LINE_LENGTH
2017
import "frequenz/api/common/v1alpha8/microgrid/microgrid.proto";
2118

2219
// Service providing access to manage and retrieve information
@@ -28,13 +25,13 @@ service PlatformAssets {
2825
// Returns list of a electrical components for a specific microgrid.
2926
rpc ListMicrogridElectricalComponents(
3027
ListMicrogridElectricalComponentsRequest)
31-
returns (ListMicrogridElectricalComponentsResponse);
28+
returns (ListMicrogridElectricalComponentsResponse);
3229

3330
// Returns a list of the connections between electrical components for a
3431
// specific microgrid.
3532
rpc ListMicrogridElectricalComponentConnections(
36-
ListMicrogridElectricalComponentConnectionsRequest)
37-
returns (ListMicrogridElectricalComponentConnectionsResponse);
33+
ListMicrogridElectricalComponentConnectionsRequest)
34+
returns (ListMicrogridElectricalComponentConnectionsResponse);
3835
}
3936

4037
// GetMicrogridRequest is the input parameter for fetching details
@@ -56,7 +53,7 @@ message ListMicrogridElectricalComponentsRequest {
5653
// Mandatory field. The ID of the microgrid for which components
5754
// are to be listed.
5855
uint64 microgrid_id = 1;
59-
56+
6057
// Return components that have the specified IDs only.
6158
repeated uint64 component_ids = 2;
6259

@@ -69,7 +66,7 @@ message ListMicrogridElectricalComponentsRequest {
6966
message ListMicrogridElectricalComponentsResponse {
7067
// Unique microgrid identifier used in the request.
7168
uint64 microgrid_id = 1;
72-
69+
7370
// List of electrical components matching the filter criteria.
7471
repeated frequenz.api.common.v1alpha8.microgrid.electrical_components.
7572
ElectricalComponent components = 2;
@@ -115,24 +112,8 @@ message ListMicrogridElectricalComponentConnectionsRequest {
115112
message ListMicrogridElectricalComponentConnectionsResponse {
116113
// The ID of the microgrid for which connections are returned.
117114
uint64 microgrid_id = 1;
118-
115+
119116
// Contains the list of connections that match the filtering criteria.
120117
repeated frequenz.api.common.v1alpha8.microgrid.electrical_components.
121-
ElectricalComponentConnection connections = 2;
122-
}
123-
124-
// GetGridpoolRequest is the input parameter for fetching details
125-
// given a specific gridpool.
126-
message GetGridpoolRequest {
127-
// The unique identifier of the gridpool for which to fetch details.
128-
uint64 gridpool_id = 1;
129-
}
130-
131-
// GetGridpoolResponse is the response for fetching details
132-
// given a specific gridpool.
133-
message GetGridpoolResponse {
134-
// Details of the requested gridpool.
135-
frequenz.api.common.v1alpha8.gridpool.Gridpool gridpool = 1;
136-
// List of microgrids in the gridpool.
137-
repeated frequenz.api.common.v1alpha8.microgrid.Microgrid microgrids = 2;
118+
ElectricalComponentConnection connections =2;
138119
}

proto/frequenz/api/platformassets/v1alpha1/platformassets.proto

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ syntax = "proto3";
1212

1313
package frequenz.api.platformassets.v1alpha1;
1414

15+
// protolint:disable:next MAX_LINE_LENGTH
16+
import "frequenz/api/common/v1alpha8/gridpool/gridpool.proto";
1517
// protolint:disable:next MAX_LINE_LENGTH
1618
import "frequenz/api/common/v1alpha8/microgrid/electrical_components/electrical_components.proto";
1719
import "frequenz/api/common/v1alpha8/microgrid/microgrid.proto";
@@ -36,6 +38,12 @@ import "frequenz/api/common/v1alpha8/microgrid/microgrid.proto";
3638
// over TLS (HTTPS).
3739
//
3840
service PlatformAssetsService {
41+
// Returns metadata for all microgrids visible to the caller.
42+
rpc ListMicrogrids(ListMicrogridsRequest) returns (ListMicrogridsResponse);
43+
44+
// Returns metadata for a specific gridpool.
45+
rpc GetGridpool(GetGridpoolRequest) returns (GetGridpoolResponse);
46+
3947
// Returns metadata for a specific microgrid.
4048
rpc GetMicrogrid(GetMicrogridRequest) returns (GetMicrogridResponse);
4149

@@ -51,6 +59,30 @@ service PlatformAssetsService {
5159
returns (ListMicrogridElectricalComponentConnectionsResponse);
5260
}
5361

62+
// Request message for listing all visible microgrids.
63+
message ListMicrogridsRequest {
64+
}
65+
66+
// Response message containing all visible microgrids.
67+
message ListMicrogridsResponse {
68+
// Microgrids visible to the caller.
69+
repeated frequenz.api.common.v1alpha8.microgrid.Microgrid microgrids = 1;
70+
}
71+
72+
// Request message for retrieving metadata for a specific gridpool.
73+
message GetGridpoolRequest {
74+
// The unique identifier of the gridpool for which to fetch details.
75+
uint64 gridpool_id = 1;
76+
}
77+
78+
// Response message containing metadata for a specific gridpool.
79+
message GetGridpoolResponse {
80+
// Details of the requested gridpool.
81+
frequenz.api.common.v1alpha8.gridpool.Gridpool gridpool = 1;
82+
// Microgrids belonging to the requested gridpool.
83+
repeated frequenz.api.common.v1alpha8.microgrid.Microgrid microgrids = 2;
84+
}
85+
5486
// Filters for selecting electrical component connections in a microgrid.
5587
//
5688
// A connection must match all specified filter fields to be included in the

0 commit comments

Comments
 (0)