Feature/fabric family gathered - #514
Draft
deekpand-cisco wants to merge 11 commits into
Draft
Conversation
deekpand-cisco
force-pushed
the
feature/fabric-family-gathered
branch
from
August 18, 2026 17:00
db65916 to
f1702c2
Compare
Add gathered_all state to the state machine for modules that retrieve all instances, mask_secrets helper for sensitive field redaction, and associated unit tests. Note: gathered-all framework cherry-picked from PR CiscoDevNet#312
Add server-side Lucene candidate filtering for gathered loopback interfaces with pagination, deduplication, and final local matching. Support gather-all and login-ID filtering for local users while rejecting unsupported gathered criteria. Add unit and integration coverage for filtering, validation, secrecy, and reusable output.
- Remove early return in filter_gathered_response() so deduplication runs unconditionally regardless of whether filters are provided - Add validate_gathered_filters() pre-flight check called before query_all() to reject invalid filters without wasted API calls
- Add gathered_filter_properties ClassVar to NDBaseModel for declarative filter whitelisting per module - Add pre-flight property validation (_extract_active_leaf_paths, _reject_unsupported_filter_properties) that rejects unsupported filter fields before any API call - Replace local_user custom normalize_gathered_filter validation with shared gathered_filter_properties tuple (login_id, email, first_name, last_name) - Add gathered_filter_properties to loopback model (switch_ip, interface_name, admin_state, ip, ipv6, vrf) - Pass supported_properties from model to validate_gathered_filters in state machine - Add gathered_transform support in NDOutput for modules with input/output shape differences - Fix loopback pagination: add max_pages safety cap, handle missing or invalid remaining metadata gracefully - Update nd_local_user DOCUMENTATION with supported filter properties - Update local_user unit tests to use shared validation path
- Apply black formatting to all gathered filtering module and test files - Add gathered state as no-op pass in manage_state() so modules can call manage_state unconditionally without raising InvalidState - Address review formatting feedback (trailing whitespace, blank lines)
- Extract gathered query logic into _query_existing() private helper - Move user-input validation outside try block for clean error messages - Build proposed before querying ND (fail-fast on bad config) - Declare get_argument_spec on NDBaseModel and gathered_transform on NDBaseOrchestrator; remove getattr probes for discoverability - Rename supports_gathered_lucene_filtering to supports_gathered_server_filtering (mechanism-neutral) - Normalize filters once in state machine; pass normalize_filter=None downstream to eliminate triple normalization - Return models from filter_gathered_response to avoid double Pydantic validation; use pre-built models for NDConfigCollection construction - Cap Lucene query fan-out at 3 expressions per switch; collapse to base expression beyond threshold - Raise ValueError for unknown switch_ip in gathered filters instead of silently returning empty results - Raise RuntimeError on pagination limit exhaustion instead of silently truncating gathered results - Update unit tests for new return types, renamed flags, and pre-normalized filter inputs
… group modules Enable gathered state and Lucene filtering for: - nd_interface_ethernet_access - nd_interface_ethernet_trunk_host - nd_fabric_update_group Includes: - Model gathered_spec and gathered_transform definitions - Orchestrator gathered workflow with pagination - Integration test tasks for gathered state - Unit tests for gathered filtering round-trip
- Add TODO(4.2.1) interface-lucene-or-silently-empty workaround markers - Remove unreachable _switches_to_query override from ethernet_base - Update query_all docstring to cover gathered path - Consolidate loopback duplicated pagination/query-plan into base class via _configure_lucene_endpoint hook - Remove gathered early-return in trunk-host so _is_unconfigured_default filters on all states - Use modern annotations (set[str], dict[str, Any]) in new code - Remove Python 2 boilerplate from new test file - Fix trailing whitespace
- Add gathered state support to eBGP, iBGP, External, AI eBGP, AI iBGP - Add bounded pagination with meta.counts.remaining - Add exact-name endpoint optimization for fabric_name-only filters - Fallback uses type-only paginated query instead of unfiltered scan - Reject config_actions.save/deploy with state=gathered - Update config_actions docstring to reflect rejection behavior - Add unit and integration tests for all fabric gathered paths
deekpand-cisco
force-pushed
the
feature/fabric-family-gathered
branch
from
August 19, 2026 03:48
f1702c2 to
a53112d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue(s)
Related to #340.
This PR builds on the foundational framework established in
#312
including the state machine, base model infrastructure, orchestrator pattern,
and secrets handling.
Proposed Changes
Enable
state: gatheredwith server-side and local filtering for all five fabric modules:nd_manage_fabric_ebgp_vxlannd_manage_fabric_ibgp_vxlannd_manage_fabric_externalnd_manage_fabric_ai_ebgp_vxlannd_manage_fabric_ai_ibgp_vxlanStacked PR
Orchestrators (5 files)
_fetch_fabrics_paginated()with bounded pagination andmeta.counts.remainingsupport (aligned withbase_interface._query_interfaces_with_lucene)_query_one_by_name()for exact-name lookups viaGET /fabrics/{name}, bypassing Lucene quoting issues with hyphens and special characters_query_all_for_gathered()splits filters:fabric_name-only → exact endpoint, compound → LuceneModule runners (5 files)
config_actions.save/deploywithstate=gathered(fail-fast, aligned withnd_manage_vpc_pair)config_actionsdocstring to reflect rejection behaviorModel
gathered_filter_propertiesandsupports_gathered_filteringto fabric base modelTest Notes
Unit Tests
test_manage_fabric_gathered.py— pagination, exact-name, wrong-type rejection, mixed filters, non-existent name, parametrized across all 5 fabric typesIntegration Tests
Cisco Nexus Dashboard Version
4.2.1.10
Related ND API Resource Category
Checklist