|
| 1 | +// Frequenz Assets API |
| 2 | +// |
| 3 | +// Frequenz gRPC API to retrieval platform assets information. |
| 4 | +// |
| 5 | +// Copyright: |
| 6 | +// Copyright 2025 Frequenz Energy-as-a-Service GmbH |
| 7 | +// |
| 8 | +// License: |
| 9 | +// MIT |
| 10 | + |
| 11 | +syntax = "proto3"; |
| 12 | + |
| 13 | +package frequenz.api.platformassets.v1alpha1; |
| 14 | + |
| 15 | +// protolint:disable:next MAX_LINE_LENGTH |
| 16 | +import "frequenz/api/common/v1alpha8/microgrid/electrical_components/electrical_components.proto"; |
| 17 | +import "frequenz/api/common/v1alpha8/microgrid/microgrid.proto"; |
| 18 | + |
| 19 | +// PlatformAssetsService provides read-only access to platform asset metadata. |
| 20 | +// |
| 21 | +// The service exposes technical asset information required by downstream |
| 22 | +// services and applications, including microgrid metadata, electrical |
| 23 | +// component inventories, and the directed electrical component graph within a |
| 24 | +// microgrid. |
| 25 | +// |
| 26 | +// Platform assets describe the technical structure of a deployed or planned |
| 27 | +// microgrid. They are commonly used by reporting, forecasting, monitoring, |
| 28 | +// trading, optimization, and operational tooling to resolve stable asset |
| 29 | +// identifiers into their associated metadata. |
| 30 | +// |
| 31 | +// !!! important "Authentication" |
| 32 | +// All requests to FlexMarketService must be signed. The key identifier and |
| 33 | +// signature must be included in the request metadata (gRPC metadata / |
| 34 | +// HTTP headers). The signature must be computed using the HMAC-SHA256 |
| 35 | +// algorithm and secret key. All requests to this service must be made |
| 36 | +// over TLS (HTTPS). |
| 37 | +// |
| 38 | +service PlatformAssetsService { |
| 39 | + // Returns metadata for a specific microgrid. |
| 40 | + rpc GetMicrogrid(GetMicrogridRequest) returns (GetMicrogridResponse); |
| 41 | + |
| 42 | + // Lists electrical components for a specific microgrid. |
| 43 | + rpc ListMicrogridElectricalComponents( |
| 44 | + ListMicrogridElectricalComponentsRequest) |
| 45 | + returns (ListMicrogridElectricalComponentsResponse); |
| 46 | + |
| 47 | + // Lists directed electrical connections between components in a specific |
| 48 | + // microgrid. |
| 49 | + rpc ListMicrogridElectricalComponentConnections( |
| 50 | + ListMicrogridElectricalComponentConnectionsRequest) |
| 51 | + returns (ListMicrogridElectricalComponentConnectionsResponse); |
| 52 | +} |
| 53 | + |
| 54 | +// Filters for selecting electrical component connections in a microgrid. |
| 55 | +// |
| 56 | +// A connection must match all specified filter fields to be included in the |
| 57 | +// response. |
| 58 | +// |
| 59 | +// !!! note "Filter Semantics" |
| 60 | +// Each repeated field is evaluated using logical OR. |
| 61 | +// |
| 62 | +// Different filter fields are combined using logical AND. |
| 63 | +// |
| 64 | +// If no filters are provided, all known electrical connections in the |
| 65 | +// microgrid are returned. |
| 66 | +// |
| 67 | +message MicrogridElectricalComponentConnectionsFilter { |
| 68 | + // Optional. Return only connections whose source component ID is included in |
| 69 | + // this list. |
| 70 | + // |
| 71 | + // If empty, connections from any source component are returned. |
| 72 | + repeated uint64 source_component_ids = 1; |
| 73 | + |
| 74 | + // Optional. Return only connections whose destination component ID is |
| 75 | + // included in this list. |
| 76 | + // |
| 77 | + // If empty, connections to any destination component are returned. |
| 78 | + repeated uint64 destination_component_ids = 2; |
| 79 | +} |
| 80 | + |
| 81 | +// Filters for selecting electrical components in a microgrid. |
| 82 | +// |
| 83 | +// An electrical component must match all specified filter fields to be |
| 84 | +// included in the response. |
| 85 | +// |
| 86 | +// !!! note "Filter Semantics" |
| 87 | +// Each repeated field is evaluated using logical OR. |
| 88 | +// |
| 89 | +// Different filter fields are combined using logical AND. |
| 90 | +// |
| 91 | +// If no filters are provided, all electrical components in the microgrid |
| 92 | +// are returned. |
| 93 | +// |
| 94 | +message MicrogridElectricalComponentsFilter { |
| 95 | + // Optional. Return only components whose IDs are included in this list. |
| 96 | + // |
| 97 | + // If empty, no component-ID filtering is applied. |
| 98 | + repeated uint64 component_ids = 1; |
| 99 | + |
| 100 | + // Optional. Return only components whose categories are included in this |
| 101 | + // list. |
| 102 | + // |
| 103 | + // If empty, no category filtering is applied. |
| 104 | + repeated frequenz.api.common.v1alpha8.microgrid.electrical_components. |
| 105 | + ElectricalComponentCategory categories = 2; |
| 106 | +} |
| 107 | + |
| 108 | +// Request message for retrieving metadata for a specific microgrid. |
| 109 | +message GetMicrogridRequest { |
| 110 | + // The unique identifier of the microgrid for which to fetch details. |
| 111 | + uint64 microgrid_id = 1; |
| 112 | +} |
| 113 | + |
| 114 | +// Response message containing metadata for a specific microgrid. |
| 115 | +message GetMicrogridResponse { |
| 116 | + // Details of the requested microgrid. |
| 117 | + frequenz.api.common.v1alpha8.microgrid.Microgrid microgrid = 1; |
| 118 | +} |
| 119 | + |
| 120 | +// Request parameters for the RPC `ListMicrogridElectricalComponents`. |
| 121 | +message ListMicrogridElectricalComponentsRequest { |
| 122 | + // Mandatory field. The ID of the microgrid for which components |
| 123 | + // are to be listed. |
| 124 | + uint64 microgrid_id = 1; |
| 125 | + |
| 126 | + // Optional. Filtering criteria for narrowing the returned components. |
| 127 | + // |
| 128 | + // If omitted, all electrical components in the microgrid are returned. |
| 129 | + MicrogridElectricalComponentsFilter filter = 2; |
| 130 | +} |
| 131 | + |
| 132 | +// Response message containing electrical components for a microgrid. |
| 133 | +message ListMicrogridElectricalComponentsResponse { |
| 134 | + // The unique identifier of the microgrid the returned components belong to. |
| 135 | + uint64 microgrid_id = 1; |
| 136 | + |
| 137 | + // Electrical components matching the request filters. |
| 138 | + repeated frequenz.api.common.v1alpha8.microgrid.electrical_components. |
| 139 | + ElectricalComponent components = 2; |
| 140 | +} |
| 141 | + |
| 142 | +// Request message for listing directed electrical connections between |
| 143 | +// components in a microgrid. |
| 144 | +// |
| 145 | +// Connections define the directed electrical component graph of a microgrid. |
| 146 | +// The source component is closer to the grid-connection point or logical root, |
| 147 | +// while the destination component is further downstream. |
| 148 | +// |
| 149 | +// !!! note "Component Graph" |
| 150 | +// A component graph in the context of a microgrid refers to a directed |
| 151 | +// graph where the nodes represent electrical components (like |
| 152 | +// generators, batteries, or loads) and the edges represent electrical |
| 153 | +// connections between them. The edges are directional, pointing away |
| 154 | +// from the grid-connection point (or the root point for island microgrids). |
| 155 | +// This means that for each edge, the source component is towards the grid |
| 156 | +// connection point, and the destination component is pointing towards |
| 157 | +// an underlying component. This graph provides a structured view of how |
| 158 | +// electrical energy flows within the microgrid. |
| 159 | +// |
| 160 | +message ListMicrogridElectricalComponentConnectionsRequest { |
| 161 | + // The unique identifier of the microgrid whose electrical component |
| 162 | + // connections should be listed. |
| 163 | + uint64 microgrid_id = 1; |
| 164 | + |
| 165 | + // Optional filtering criteria for narrowing the returned connections. |
| 166 | + // |
| 167 | + // If omitted, all known electrical connections in the microgrid are returned. |
| 168 | + MicrogridElectricalComponentConnectionsFilter filter = 2; |
| 169 | +} |
| 170 | + |
| 171 | +// Response message containing directed electrical connections for a microgrid. |
| 172 | +// |
| 173 | +// The response contains all connections matching the requested filters. If no |
| 174 | +// connection matches the filters, `connections` is empty. |
| 175 | +message ListMicrogridElectricalComponentConnectionsResponse { |
| 176 | + // The unique identifier of the microgrid the returned connections belong to. |
| 177 | + uint64 microgrid_id = 1; |
| 178 | + |
| 179 | + // Electrical component connections matching the request filters. |
| 180 | + repeated frequenz.api.common.v1alpha8.microgrid.electrical_components. |
| 181 | + ElectricalComponentConnection connections = 2; |
| 182 | +} |
0 commit comments