|
| 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 | +// Service providing access to manage and retrieve information |
| 20 | +// related to Gridpools and microgrids, and other platform assets. |
| 21 | +service PlatformAssetsService { |
| 22 | + // Returns details of a specific microgrid. |
| 23 | + rpc GetMicrogrid(GetMicrogridRequest) returns (GetMicrogridResponse); |
| 24 | + |
| 25 | + // Returns list of a electrical components for a specific microgrid. |
| 26 | + rpc ListMicrogridElectricalComponents( |
| 27 | + ListMicrogridElectricalComponentsRequest) |
| 28 | + returns (ListMicrogridElectricalComponentsResponse); |
| 29 | + |
| 30 | + // Returns a list of the connections between electrical components for a |
| 31 | + // specific microgrid. |
| 32 | + rpc ListMicrogridElectricalComponentConnections( |
| 33 | + ListMicrogridElectricalComponentConnectionsRequest) |
| 34 | + returns (ListMicrogridElectricalComponentConnectionsResponse); |
| 35 | +} |
| 36 | + |
| 37 | +// GetMicrogridRequest is the input parameter for fetching details |
| 38 | +// given a specific microgrid. |
| 39 | +message GetMicrogridRequest { |
| 40 | + // The unique identifier of the microgrid for which to fetch details. |
| 41 | + uint64 microgrid_id = 1; |
| 42 | +} |
| 43 | + |
| 44 | +// GetMicrogridResponse is the response for fetching details |
| 45 | +// given a specific microgrid. |
| 46 | +message GetMicrogridResponse { |
| 47 | + // Details of the requested microgrid. |
| 48 | + frequenz.api.common.v1alpha8.microgrid.Microgrid microgrid = 1; |
| 49 | +} |
| 50 | + |
| 51 | +// Request parameters for the RPC `ListMicrogridElectricalComponents`. |
| 52 | +message ListMicrogridElectricalComponentsRequest { |
| 53 | + // Mandatory field. The ID of the microgrid for which components |
| 54 | + // are to be listed. |
| 55 | + uint64 microgrid_id = 1; |
| 56 | + |
| 57 | + // Return components that have the specified IDs only. |
| 58 | + repeated uint64 component_ids = 2; |
| 59 | + |
| 60 | + // Return components that have the specified categories only. |
| 61 | + repeated frequenz.api.common.v1alpha8.microgrid.electrical_components. |
| 62 | + ElectricalComponentCategory categories = 3; |
| 63 | +} |
| 64 | + |
| 65 | +// A message containing a list of electrical components. |
| 66 | +message ListMicrogridElectricalComponentsResponse { |
| 67 | + // Unique microgrid identifier used in the request. |
| 68 | + uint64 microgrid_id = 1; |
| 69 | + |
| 70 | + // List of electrical components matching the filter criteria. |
| 71 | + repeated frequenz.api.common.v1alpha8.microgrid.electrical_components. |
| 72 | + ElectricalComponent components = 2; |
| 73 | +} |
| 74 | + |
| 75 | +// ListMicrogridElectricalComponentConnectionsRequest is used for listing |
| 76 | +// the electrical connections between components in a microgrid. Connections |
| 77 | +// define a directed graph of electrical energy flow. |
| 78 | +// |
| 79 | +// !!! note "Component Graph" |
| 80 | +// A component graph in the context of a microgrid refers to a directed |
| 81 | +// graph where the nodes represent electrical components (like |
| 82 | +// generators, batteries, or loads) and the edges represent electrical |
| 83 | +// connections between them. The edges are directional, pointing away |
| 84 | +// from the grid-connection point (or the root point for island microgrids). |
| 85 | +// This means that for each edge, the source component is towards the grid |
| 86 | +// connection point, and the destination component is pointing towards |
| 87 | +// an underlying component. This graph provides a structured view of how |
| 88 | +// electrical energy flows within the microgrid. |
| 89 | +// |
| 90 | +// !!! note "Filtering" |
| 91 | +// Filtering can be done based on the source_component_id or |
| 92 | +// destination_component_id. If these fields are left empty, connections |
| 93 | +// with any source or destination will be returned. |
| 94 | +// |
| 95 | +message ListMicrogridElectricalComponentConnectionsRequest { |
| 96 | + // Mandatory field. The ID of the microgrid |
| 97 | + // for which connections are to be listed. |
| 98 | + uint64 microgrid_id = 1; |
| 99 | + |
| 100 | + // Only return connections that originate from these component IDs. |
| 101 | + // If empty, no filtering is applied. |
| 102 | + repeated uint64 source_component_ids = 2; |
| 103 | + |
| 104 | + // Only return connections that terminate at these component IDs. |
| 105 | + // If empty, no filtering is applied. |
| 106 | + repeated uint64 destination_component_ids = 3; |
| 107 | +} |
| 108 | + |
| 109 | +// ListMicrogridElectricalComponentConnectionsResponse holds the list of |
| 110 | +// electrical connections that match the filter criteria specified in the |
| 111 | +// ListMicrogridElectricalComponentConnectionsRequest. |
| 112 | +message ListMicrogridElectricalComponentConnectionsResponse { |
| 113 | + // The ID of the microgrid for which connections are returned. |
| 114 | + uint64 microgrid_id = 1; |
| 115 | + |
| 116 | + // Contains the list of connections that match the filtering criteria. |
| 117 | + repeated frequenz.api.common.v1alpha8.microgrid.electrical_components. |
| 118 | + ElectricalComponentConnection connections =2; |
| 119 | +} |
0 commit comments