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

Add filters ids and type #210

Draft
wants to merge 1 commit into
base: v0.x.x
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

* Added more detailed documentation on how to use pagination.
* Added `start_immediately` to the create RPC.
* New filters for the list rpc have been added: "ids" to search for one or more ids using partial matching and "type" to filter by the type of the dispatch, also partial matching.

## Bug Fixes

Expand Down
16 changes: 16 additions & 0 deletions proto/frequenz/api/dispatch/v1/dispatch.proto
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,22 @@ message DispatchFilter {

// Optional filter by update time
TimeIntervalFilter update_time_interval = 8;

// Optional filter by partial id matches
// If this field is not set, dispatches of any id will be included.
// Example:
// - To retrieve dispatches with ids containing 123 (e.g.: [5123, 1234, 1235, 123]):
// filter { ids: [123] }
// - To retrieve dispatches with ids containing 1 and 5 (e.g.: [5, 1, 15, 51]):
// filter { ids: [1, 5] }
Comment on lines +316 to +319
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this say "or" instead of "and"? If it is "and", I would expect 5 and 1 not to match.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, though this will be changed again once UX made up their mind what they even want

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I guess we wait...

repeated uint64 ids = 9;

// Optional filter by partial type match
// If this field is not set, dispatches of any type will be included.
// Example:
// - To retrieve dispatches with type containing "charge" (e.g.: ["charge", "discharge", "fast_charge"]):
// filter { type: "charge" }
optional string type = 10;
}

// Parameter for controlling which components a dispatch applies to
Expand Down
Loading