File tree Expand file tree Collapse file tree 12 files changed +116
-44
lines changed
proto/frequenz/api/common/v1 Expand file tree Collapse file tree 12 files changed +116
-44
lines changed Original file line number Diff line number Diff line change 5757
5858- Added a message ` Microgrid ` to represent a microgrid.
5959
60+ - Updated the package name of ` location.proto ` to ` frequenz.api.common.v1 ` .
61+
62+ - Added messages to support pagination in APIs.
63+
6064## New Features
6165
6266<!-- Here goes the main new features and examples or instructions on how to use them -->
Original file line number Diff line number Diff line change 77
88syntax = "proto3" ;
99
10- package frequenz.api.common.v1.location ;
10+ package frequenz.api.common.v1 ;
1111
1212// A pair of geographical co-ordinates, representing the location of a place.
1313message Location {
Original file line number Diff line number Diff line change 1+ // Definitions for bounds.
2+ //
3+ // Copyright:
4+ // Copyright 2023 Frequenz Energy-as-a-Service GmbH
5+ //
6+ // License:
7+ // MIT
8+
9+ syntax = "proto3" ;
10+
11+ package frequenz.api.common.v1.metrics ;
12+
13+ // A set of lower and upper bounds for any metric.
14+ // The units of the bounds are always the same as the related metric.
15+ message Bounds {
16+ // The lower bound.
17+ // If absent, there is no lower bound.
18+ optional float lower = 1 ;
19+
20+ // The upper bound.
21+ // If absent, there is no upper bound.
22+ optional float upper = 2 ;
23+ }
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ syntax = "proto3";
1010
1111package frequenz.api.common.v1.metrics.electrical ;
1212
13- import "frequenz/api/common/v1/metrics.proto" ;
13+ import "frequenz/api/common/v1/metrics/metric_sample .proto" ;
1414
1515// Metrics of a DC electrical connection.
1616message DC {
Original file line number Diff line number Diff line change 1- // Metrics & bounds definitions.
1+ // Metrics definitions.
22//
33// Copyright:
44// Copyright 2023 Frequenz Energy-as-a-Service GmbH
@@ -10,19 +10,9 @@ syntax = "proto3";
1010
1111package frequenz.api.common.v1.metrics ;
1212
13- import "google/protobuf/timestamp.proto" ;
14-
15- // A set of lower and upper bounds for any metric.
16- // The units of the bounds are always the same as the related metric.
17- message Bounds {
18- // The lower bound.
19- // If absent, there is no lower bound.
20- optional float lower = 1 ;
13+ import "frequenz/api/common/v1/metrics/bounds.proto" ;
2114
22- // The upper bound.
23- // If absent, there is no upper bound.
24- optional float upper = 2 ;
25- }
15+ import "google/protobuf/timestamp.proto" ;
2616
2717// Represents a single sample of a specific metric, the value of which is either
2818// measured or derived at a particular time.
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ syntax = "proto3";
1010
1111package frequenz.api.common.v1.microgrid.components ;
1212
13- import "frequenz/api/common/v1/metrics.proto" ;
13+ import "frequenz/api/common/v1/metrics/metric_sample .proto" ;
1414import "frequenz/api/common/v1/microgrid/components/battery.proto" ;
1515import "frequenz/api/common/v1/microgrid/components/ev_charger.proto" ;
1616import "frequenz/api/common/v1/microgrid/components/fuse.proto" ;
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ message Microgrid {
5454 frequenz.api.common.v1.grid.DeliveryArea delivery_area = 4 ;
5555
5656 // Physical location of the microgrid, in geographical co-ordinates.
57- frequenz.api.common.v1.location. Location location = 5 ;
57+ frequenz.api.common.v1.Location location = 5 ;
5858
5959 // The current status of the microgrid.
6060 MicrogridStatus status = 6 ;
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ syntax = "proto3";
1010
1111package frequenz.api.common.v1.microgrid.sensors ;
1212
13- import "frequenz/api/common/v1/metrics.proto" ;
13+ import "frequenz/api/common/v1/metrics/metric_sample .proto" ;
1414import "frequenz/api/common/v1/microgrid/lifetime.proto" ;
1515
1616import "google/protobuf/timestamp.proto" ;
Original file line number Diff line number Diff line change @@ -9,22 +9,6 @@ syntax = "proto3";
99
1010package frequenz.api.common.v1.pagination ;
1111
12- // A message defining parameters for paginating list requests.
13- // It can be appended to a request message to specify the desired page of
14- // results and the maximum number of results per page. For initial requests
15- // (requesting the first page), the page_token should not be provided. For
16- // subsequent requests (requesting any page after the first), the
17- // next_page_token from the previous responses PaginationInfo must be supplied.
18- // The page_size should only be specified in the initial request and will be
19- // disregarded in subsequent requests.
20- message PaginationParams {
21- // The maximum number of results to be returned per request.
22- optional uint32 page_size = 1 ;
23-
24- // The token identifying a specific page of the list results.
25- optional string page_token = 2 ;
26- }
27-
2812// A message providing metadata about paginated list results.
2913// The PaginationInfo message delivers metadata concerning the paginated list
3014// results and should be appended to the response message of a list request. The
Original file line number Diff line number Diff line change 1+ // Parameters for pagination.
2+ //
3+ // Copyright 2023 Frequenz Energy-as-a-Service GmbH
4+ //
5+ // Licensed under the MIT License (the "License");
6+ // you may not use this file except in compliance with the License.
7+
8+ syntax = "proto3" ;
9+
10+ package frequenz.api.common.v1.pagination ;
11+
12+ // A message defining parameters for paginating list requests.
13+ // It can be appended to a request message to specify the desired page of
14+ // results and the maximum number of results per page. For initial requests
15+ // (requesting the first page), the page_token should not be provided. For
16+ // subsequent requests (requesting any page after the first), the
17+ // next_page_token from the previous responses PaginationInfo must be supplied.
18+ // The page_size should only be specified in the initial request and will be
19+ // disregarded in subsequent requests.
20+ message PaginationParams {
21+ // The maximum number of results to be returned per request.
22+ optional uint32 page_size = 1 ;
23+
24+ // The token identifying a specific page of the list results.
25+ optional string page_token = 2 ;
26+ }
You can’t perform that action at this time.
0 commit comments