VPC Pair 4.x Implementation#1
Open
sivakasi-cisco wants to merge 27 commits intorest_send_integrationfrom
Open
Conversation
42969a0 to
e6b0609
Compare
commit a7f263d Merge: 4d1a4b0 e4676e0 Author: Neil John <39439797+neiljohn-gh@users.noreply.github.com> Date: Mon Aug 18 16:26:10 2025 +0530 Merge branch 'CiscoDevNet:master' into vpc_peers_module commit 4d1a4b0 Author: neiljohn-gh <neiljohn9125@gmail.com> Date: Mon Aug 18 15:52:51 2025 +0530 added deploy and dry_run options to nd_manage_vpc_pair.py with corresponding functionality and examples commit b8bf64f Author: neiljohn-gh <neiljohn9125@gmail.com> Date: Sun Aug 17 19:24:34 2025 +0530 added merged, overridden, replaced and deleted (WIP) commit 3b46915 Author: neiljohn-gh <neiljohn9125@gmail.com> Date: Tue Jul 29 19:01:57 2025 +0530 added functionality for nd_manage_vpc_pair.py along with the pydantic model required
1. Schema migration
2. 4.x version update on create, update, delete with PUT
3. Field name changes from peer1SwitchId to switchId and switch_id python attribute
4. vpcAction discriminator for PUT EP
5. Update in delete and merged
6. Validation changes
- Add Pydantic-based NDBaseModel for network resource models - Add NDConfigCollection for type-safe config management with O(1) lookups - Add NDNetworkResourceModule base class for network resource modules - Add nd_local_user module as reference implementation - Supports merged/replaced/overridden/deleted states - Implements composition pattern with actions_overwrite_map Co-authored-by: Gaspard Micol <gmicol@cisco.com>
e6b0609 to
6055c96
Compare
b1adc39 to
3b30fce
Compare
3b30fce to
253d119
Compare
sivakasi-cisco
commented
Feb 25, 2026
| raise ValueError(f"fabric_name must be a non-empty string. Got: {fabric_name!r}") | ||
|
|
||
| # Initialize RestSend via NDModuleV2 | ||
| nd_v2 = NDModuleV2(nrm.module) |
Owner
Author
There was a problem hiding this comment.
NDModuleV2 is used for vpc_pair module specific custom functions and used above as an argument
sivakasi-cisco
commented
Feb 25, 2026
Owner
Author
There was a problem hiding this comment.
CReate, Update, Delete, deploy, query_all custom functions use NDModuleV2 custom RestSend path
sivakasi-cisco
commented
Feb 26, 2026
| VpcFieldNames, | ||
| ) | ||
| from ansible_collections.cisco.nd.plugins.module_utils.manage.vpc_pair.vpc_pair_endpoints import ( | ||
| EpVpcPairConsistencyGet, |
Owner
Author
There was a problem hiding this comment.
Added missing API usage for vPC support/consistency/list endpoints
sivakasi-cisco
commented
Feb 26, 2026
| @@ -888,6 +944,123 @@ def _get_recommendation_details(nd_v2, fabric_name: str, switch_id: str, timeout | |||
| raise | |||
|
|
|||
|
|
|||
Owner
Author
There was a problem hiding this comment.
Added endpoint helpers
- vpc_pairs_list
- switch_vpc_support
- switch_vpc_consistency
- _extract_vpc_pairs_from_list_response
- _get_pairing_support_details
- _get_consistency_details
commit df99ff3 Author: Gaspard Micol <gmicol@cisco.com> Date: Thu Feb 26 14:09:18 2026 -0500 [ignore] Make a small change to NDModule request function. commit 9cdfa66 Author: Gaspard Micol <gmicol@cisco.com> Date: Thu Feb 26 14:01:24 2026 -0500 [ignore] Rename NDNetworkResourceModule to NDStateMachine. Add file for NDNestedModel. Add types.file. Various Renaming and small Modifications across the repo. WIP. commit b41b5b8 Author: Gaspard Micol <gmicol@cisco.com> Date: Thu Feb 26 10:44:23 2026 -0500 [ignore] Fix and in nd_config_collections.py. Move to utils.py. commit e2101f9 Author: Gaspard Micol <gmicol@cisco.com> Date: Thu Feb 26 10:42:12 2026 -0500 [ignore] Complete orchestrators/base.py by making simple CRUD operations methods that work for single_identifier strategy (meant to be overridden if needed). commit 48b62be Author: Gaspard Micol <gmicol@cisco.com> Date: Thu Feb 26 10:38:50 2026 -0500 [ignore] Add choice for when no identifier is needed. Add quick comments and changes to models/local_user.py and api_endpoints/base.py commit b04a82b Author: Gaspard Micol <gmicol@cisco.com> Date: Wed Feb 25 08:24:28 2026 -0500 [ignore] Default to none and update condition for regarding in models/base.py. commit 229af5a Author: Gaspard Micol <gmicol@cisco.com> Date: Tue Feb 24 12:57:37 2026 -0500 [ignore] Adapt the Network Resource Module architecture for ND to smart endpoints and Pydantic models modification (works for merge and replace states). Add comments for next steps. commit 4b65c25 Author: Gaspard Micol <gmicol@cisco.com> Date: Wed Feb 18 01:23:37 2026 -0500 [ignore] Modifiy models/local_user to take full advantage of Pydantic built-in functionalities. Slightly modify models/base.py to enforce identifiers definitions in NDBaseModel subclasses. Added multiple notes to assert next steps. commit dead722 Author: Gaspard Micol <gmicol@cisco.com> Date: Tue Feb 17 13:46:10 2026 -0500 [ignore] Add api_endpoints for configuring endpoints and orchestrators for orchestrating crud api operations with model instances and endpoints. commit dc9649e Author: Gaspard Micol <gmicol@cisco.com> Date: Fri Jan 23 14:37:44 2026 -0500 [ignore] Modify nd_local_user based on Pydantic implementation and changes added to NDNetworkResourceModule. commit b35fa8d Author: Gaspard Micol <gmicol@cisco.com> Date: Fri Jan 23 13:51:54 2026 -0500 [ignore] Pydantic Base ND Network Resource Module: Final proposition of core design changing existing methods and adding new ones which will be used in future as a based for ND network resource modules as well as basic error handling and simple docstrings. commit d518bf3 Author: Gaspard Micol <gmicol@cisco.com> Date: Fri Jan 23 13:09:33 2026 -0500 [ignore] Pydantic ND Config Collection: Final proposition of core design changing existing methods and adding new ones which will be used in NDNetworkResourceModule class as well as basic error handling and simple docstrings. commit c4a4da2 Author: Gaspard Micol <gmicol@cisco.com> Date: Fri Jan 23 00:56:49 2026 -0500 [ignore] Pydantic ND base models and local_user models: Final proposition of core design adding new methods which will be used in NDConfigCollection and NDNetworkResourceModule classes as well as basic error handling and simple docstrings. commit fe944d0 Author: Gaspard Micol <gmicol@cisco.com> Date: Thu Jan 22 01:04:05 2026 -0500 [ignore] Pydantic Models: Modify and Clean both local_user.py and base.py based on comments. Add a get method and get_identifier_value function to NDBaseModel. commit 7089148 Author: Gaspard Micol <gmicol@cisco.com> Date: Tue Jan 20 13:17:35 2026 -0500 [ignore] Second Pydantic Implementation: Create a NDBaseModel to be inherited from future class models. Modify class models for local_user. commit a04235c Author: Gaspard Micol <gmicol@cisco.com> Date: Thu Jan 15 11:47:32 2026 -0500 [ignore] First Pydantic implementation: Add Pydantic Models for nd_local_user. commit 2a27f38 Author: Gaspard Micol <gmicol@cisco.com> Date: Tue Aug 19 12:44:17 2025 -0400 [minor_change] Add nd_local_user as a new network resource module for Nexus Dashboard v4.1.0 and higher.
and corresponding integration test refinements.
Cherrypicked from PR172
sivakasi-cisco
added a commit
that referenced
this pull request
Mar 9, 2026
Owner
Author
|
changes continued in CiscoDevNet#197 |
sivakasi-cisco
added a commit
that referenced
this pull request
Mar 25, 2026
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.
Summary
This PR implements the VPC Pair management module for ND 4.x with comprehensive Pydantic validation.
Changes
nd_manage_vpc_pairmodule for VPC pair lifecycle managementcommon/log.py: File-based logging for debuggingcommon/models.py: Pydantic model helper functionsFiles Changed
plugins/modules/nd_manage_vpc_pair.py(1,912 lines)plugins/module_utils/manage/vpc_pair/model_playbook_vpc_pair.py(658 lines)plugins/module_utils/manage/vpc_pair/__init__.py(90 lines)plugins/module_utils/common/log.py(369 lines)plugins/module_utils/common/models.py(111 lines)plugins/module_utils/nd.py(61 lines modified)Total: +3,200 insertions, -1 deletion across 6 files