nd_vpc_pair#278
Open
allenrobel wants to merge 4 commits into
Open
Conversation
9e5fac2 to
c8dc38b
Compare
c8dc38b to
6feffd8
Compare
6feffd8 to
1e1d26d
Compare
1e1d26d to
69c77c5
Compare
69c77c5 to
b993187
Compare
01d4292 to
3061435
Compare
a042e60 to
297e66c
Compare
297e66c to
539ac4e
Compare
Adds EpManageInterfacesDelete to manage_interfaces.py. The per-interface
DELETE endpoint at /fabrics/{fabric}/switches/{sn}/interfaces/{name} returns
204 on success and a subsequent GET returns 404.
This is the workaround path used by VpcBaseOrchestrator.delete() because the
interfaceActions/remove bulk endpoint returns "Invalid Interface" (HTTP 207
with per-item status "Failed") for vPC entries on ND 4.2.1 (lab-verified).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Introduces vPC pair management plus the shared orchestrator base reused by every vpc_* interface module (vpc_access, vpc_trunk_host, etc.). Module: - nd_vpc_pair: create / replace / delete a vPC pair between two switches in a fabric. Wraps the ND vpcPair PUT endpoint with the merged / replaced / deleted state machine. Shared infrastructure (intended to land on this branch so downstream interface modules can rebase on top of it): - VpcBaseOrchestrator (orchestrators/vpc_base.py): generic CRUD for any vPC-typed interface model. Resolves the peer-switch serial from the vpcPair record (cached per orchestrator instance), uses per-interface DELETE (workaround for ND 4.2.1 interfaceActions/remove returning "Invalid Interface" on vPC entries), and dedupes the query_all results ND echoes once per peer switch. - EpManageFabricSwitchVpcPairGet, EpManageFabricVpcPairsListGet: endpoint models for the vpcPair / vpcPairs GETs. - EpManageFabricSwitchActionsDeploy: bulk deploy endpoint used after vPC pair mutations. Models: - VpcPairModel with vpcPairDetails subtree, identifier strategy single on switch_ip, frozen scaffolding for action/type discriminators. Tests: - 69 unit tests (model + orchestrator + 3 endpoint test files + fixture JSON). - Integration target with merged / replaced / deleted state coverage, vPC pair create + un-pair lifecycle on the live ND 4.2 lab. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Five unit test files introduced by c5ac406 had stale agent-style boilerplate: - Generic "Cisco Systems, Inc." copyright instead of the per-author form - Bloated `from __future__ import absolute_import, annotations, division, print_function` - `__metaclass__ = type` block (no longer needed; documented in CLAUDE.md) Update copyright to Allen Robel (@allenrobel), trim the future import to just `annotations`, and drop the __metaclass__ stanza. Pre-existing pylint disables unrelated to invalid-name are preserved (line-too-long, too-many-lines in test_vpc_pair.py models). All 69 vpc_pair-side unit tests still pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
539ac4e to
9825378
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)
Sivakami has an open PR 197 - VPC Pair 4.x Implementation for VPC pairing. I needed this to implement VPC interface modules, but this has not been merged into develop, and it does not currently leverage Gaspard's framework. Due to this, I asked Claude to write a VPC pair module that I could stack my VPC interface PRs (both will be created today) onto. I want to acknowledge Sivakami's work and did ask Claude to ensure nd_vpc_pair is functionally equivalent to it (so the PR did serve as a baseline reference from a functionality perspective). I'll reach out to Sivakami to explain this situation and ask if this is OK with her.
Proposed Changes
nd_vpc_pairmodule, which manages vPC pair lifecycle (pair / unpair) between two switches in a fabric via the NDPUT /api/v1/manage/fabrics/{fabric}/switches/{sn}/vpcPairendpoint.VpcBaseOrchestrator(plugins/module_utils/orchestrators/vpc_base.py) that everynd_interface_vpc_*module will reuse for CRUD, peer-serial resolution, per-interface DELETE, andquery_alldedupe.EpManageFabricSwitchVpcPairGet,EpManageFabricVpcPairsListGet,EpManageFabricSwitchActionsDeploy, andEpManageInterfacesDelete.VpcPairModelPydantic model withvpcPairDetailssubtree andidentifier_strategy = "single"onswitch_ip.Three ND 4.2.1 wire quirks are accommodated and tagged
TODO(4.2.1):interfaceActions/removereturns "Invalid Interface" for vPC entries; vPC delete uses the per-interface DELETE endpoint instead./interfacesGET; the orchestrator dedupes byinterfaceName, keeping the alphabetically-lowerswitchIdas canonical./nd-workaround-audit.Test Notes
Cisco Nexus Dashboard Version
4.2.1
Related ND API Resource Category
Checklist