Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make AddComponentBounds more consistent with other RPCs #270

Open
wants to merge 2 commits into
base: v0.x.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
## Upgrading

- The minimum supported version of `protobuf` was bumped to 5.28.1 and to 1.66.1 for `grpcio`. Make sure to update your dependencies accordingly.
- The `AddComponentBoundsRequest.validity_duration` field was replaced by `AddComponentBoundsRequest.request_lifetime` to match the fields in `SetComponentPowerActiveRequest` and `SetComponentPowerReactiveRequest`. The default value was also changed from 5 to 60 seconds.
- The `AddComponentBoundsResponse.ts` field was renamed to `AddComponentBoundsResponse.valid_until` for extra clarity and also to match the fields in `SetComponentPowerActiveResponse` and `SetComponentPowerReactiveResponse`.

## New Features

Expand Down
25 changes: 10 additions & 15 deletions proto/frequenz/api/microgrid/v1/microgrid.proto
Original file line number Diff line number Diff line change
Expand Up @@ -446,15 +446,6 @@ message ReceiveSensorDataStreamResponse {
frequenz.api.common.v1.microgrid.sensors.SensorData data = 1;
}

// The duration for which a given list of bounds will stay in effect.
enum ComponentBoundsValidityDuration {
COMPONENT_BOUNDS_VALIDITY_DURATION_UNSPECIFIED = 0;
COMPONENT_BOUNDS_VALIDITY_DURATION_5_SECONDS = 1;
COMPONENT_BOUNDS_VALIDITY_DURATION_1_MINUTE = 2;
COMPONENT_BOUNDS_VALIDITY_DURATION_5_MINUTES = 3;
COMPONENT_BOUNDS_VALIDITY_DURATION_15_MINUTES = 4;
}

// Request parameters for the RPC `AddComponentBounds`.
message AddComponentBoundsRequest {
// The ID of the target component.
Expand All @@ -469,16 +460,20 @@ message AddComponentBoundsRequest {
// non-overlapping ones are kept separated.
repeated frequenz.api.common.v1.metrics.Bounds bounds = 3;

// The duration for which the given bounds will stay in effect.
// If this field is not provided, then the bounds will be removed after a
// default duration of 5 seconds.
ComponentBoundsValidityDuration validity_duration = 4;
// The duration, in seconds, until which the request will stay in effect.
// This duration has to be between 10 seconds and 15 minutes (including both
// limits), otherwise the request will be rejected.
// If not provided, it defaults to 60s.
optional uint64 request_lifetime = 4;
}

// Response message for the RPC `AddComponentBounds`.
message AddComponentBoundsResponse {
// The timestamp until which the given bounds will stay in effect.
google.protobuf.Timestamp ts = 1;
// The timestamp until which the added bounds will stay in effect.
// After this timestamp, the component bounds added by this request will be
// removed. By default, this timestamp will be set to the current time plus
// 60 seconds.
google.protobuf.Timestamp valid_until = 1;
}

// Request parameters for the RPC `SetComponentPowerActive`.
Expand Down