Skip to content

Support max_depth and exclude parameters for gRPC Get#32

Closed
sha90w wants to merge 1 commit into
holo-routing:mainfrom
sha90w:grpc-filtering
Closed

Support max_depth and exclude parameters for gRPC Get#32
sha90w wants to merge 1 commit into
holo-routing:mainfrom
sha90w:grpc-filtering

Conversation

@sha90w

@sha90w sha90w commented May 3, 2026

Copy link
Copy Markdown
Contributor

Plumbs the new structured Path filtering parameters through the client. Each request's Path now carries an optional max_depth, and GetRequest gains a list of exclude Paths for skipping subtrees.

  • grpc/session: forward max_depth and exclude through GrpcClient::get and Session::get; convert exclude name strings to single-element Path values via Path::from_xpath. Synthesize an empty-elem Path to carry max_depth when no xpath is supplied (preserves the prior "show state depth N" UX at root).
  • show state: accept "depth N" and "exclude name1,name2,..." args, including when combined with an xpath value (depth/exclude tokens are mirrored under the xpath value token, not just at the top level, so "show state xpath /foo depth N" parses).
  • YangTableBuilder: add max_depth() and exclude() builder methods, plus a DEFAULT_EXCLUDES list (currently ["ietf-bgp:rib"]) applied to every query to keep large RIB sub-trees out of unrelated tables.
  • fetch_data split into fetch_data_filtered + thin wrapper so existing call sites stay unchanged.

Plumbs the new structured Path filtering parameters through the
client. Each request's Path now carries an optional max_depth, and
GetRequest gains a list of exclude Paths for skipping subtrees.

- grpc/session: forward max_depth and exclude through GrpcClient::get
  and Session::get; convert exclude name strings to single-element
  Path values via Path::from_xpath. Synthesize an empty-elem Path to
  carry max_depth when no xpath is supplied (preserves the prior
  "show state depth N" UX at root).
- show state: accept "depth N" and "exclude name1,name2,..." args,
  including when combined with an xpath value (depth/exclude tokens
  are mirrored under the xpath value token, not just at the top
  level, so "show state xpath /foo depth N" parses).
- YangTableBuilder: add max_depth() and exclude() builder methods,
  plus a DEFAULT_EXCLUDES list (currently ["ietf-bgp:rib"]) applied
  to every query to keep large RIB sub-trees out of unrelated tables.
- fetch_data split into fetch_data_filtered + thin wrapper so
  existing call sites stay unchanged.
@sha90w

sha90w commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

We can solve the same problem in another way, using a recent structured path.
So, closing that PR for now.

@sha90w sha90w closed this Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant