Skip to content

Update iBGP, eBGP, and External Fabric Type Modules (NDA-24 NDA-23)#260

Open
mtarking wants to merge 13 commits into
developfrom
issue-259
Open

Update iBGP, eBGP, and External Fabric Type Modules (NDA-24 NDA-23)#260
mtarking wants to merge 13 commits into
developfrom
issue-259

Conversation

@mtarking
Copy link
Copy Markdown
Collaborator

@mtarking mtarking commented Apr 14, 2026

Related Issue(s)

Resolves #259
Resolves #263

Proposed Changes

Shared Base Model Extraction

  • Created FabricBaseModel in manage_fabric_base.py — abstract base class for all fabric models
  • Extracted 13 shared fields (category, fabric_name, location, license_tier, alert_suspend, telemetry_collection, telemetry_collection_type, telemetry_streaming_protocol, telemetry_source_interface, telemetry_source_vrf, security_domain, telemetry_settings, external_streaming_settings) into the base class
  • Refactored FabricEbgpModel, FabricIbgpModel, and FabricExternalConnectivityModel to inherit from FabricBaseModel
  • Base class includes _fabric_type ClassVar, _post_validate_consistency() hook, validate_fabric_consistency(), and get_argument_spec()

Module and File Renames

  • Renamed eBGP and iBGP model, orchestrator, and module files to include _vxlan suffix for clarity:
    • manage_fabric_ebgp.pymanage_fabric_ebgp_vxlan.py
    • manage_fabric_ibgp.pymanage_fabric_ibgp_vxlan.py
    • nd_manage_fabric_ebgp.pynd_manage_fabric_ebgp_vxlan.py
    • nd_manage_fabric_ibgp.pynd_manage_fabric_ibgp_vxlan.py
  • Updated integration tests (fabric_ebgp.yaml, fabric_ibgp.yaml) to reference the new module names

Default and Type Alignment

  • Aligned defaults across all three fabric models to use consistent values from FabricBaseModel:
    • license_tierLicenseTierEnum.ESSENTIALS
    • telemetry_collectionTrue
    • telemetry_collection_typeTelemetryCollectionTypeEnum.IN_BAND
    • telemetry_source_interface"loopback0"
    • telemetry_source_vrf"default"
  • Changed telemetry_collection_type and telemetry_streaming_protocol from str to their proper enum types
  • Removed duplicate field block in manage_fabric_external.py where license_tier through security_domain were defined twice with conflicting values

Module Documentation Fixes

  • Updated DOCUMENTATION defaults in all three module files to match the pydantic model defaults:
    • license_tier: premieressentials
    • telemetry_collection: falsetrue
    • telemetry_collection_type: outOfBandinBand
    • telemetry_source_interface: ""loopback0
    • telemetry_source_vrf: ""default
    • nxapi (eBGP + iBGP): falsetrue
  • Removed evpn from eBGP DOCUMENTATION (internal field, not user-configurable)

Bug Fixes

• Added missing enable_dpu_pinning field to iBGP model and module documentation (already present in eBGP model)

Modern Type Annotations

  • Replaced from __future__ import absolute_import, division, print_function with from __future__ import annotations across all fabric model files
  • Removed __metaclass__ = type (Python 2 artifact) from all fabric model files
  • Modernized type hints throughout:
    • Optional[X]X | None
    • List[X]list[X]
    • Dict[K, V]dict[K, V]
    • ClassVar[Optional[List[str]]]ClassVar[list[str] | None]
  • Removed unused typing imports (Dict, List, Optional)

Shared Types File

  • Created plugins/module_utils/models/types.py with reusable NdFabricName annotated type
  • NdFabricName uses Annotated with BeforeValidator for fabric name validation (letters, digits, underscores, hyphens; 1-64 chars)
  • Replaced inline validate_fabric_name field validator in FabricBaseModel with the shared NdFabricName type

eBGP Model Cleanup

  • Removed to_diff_dict() override that excluded nxapiHttp — ND now correctly returns the configured value, so the workaround is no longer needed
  • Removed unused Dict and Any imports from eBGP model

Code Organization

  • Alphabetized enum and manage_fabric_common imports in all three fabric model files
  • Fixed module docstrings to accurately list only the classes defined in each file
  • Removed __all__ exports from all non-__init__.py model files (per PEP8, wildcard imports are discouraged, making __all__ unnecessary overhead)
  • Alphabetized class definitions in manage_fabric_common.py

Test Notes

  • All 368 unit tests pass
  • 29 fabric endpoint tests pass
  • Import verification confirms all 3 models correctly inherit FabricBaseModel with proper _fabric_type values (vxlanEbgp, vxlanIbgp, externalConnectivity)
  • Verified base fields are consistent across all models
  • No behavioral changes to API payloads

Cisco Nexus Dashboard Version

4.2.1

Related ND API Resource Category

  • analyze
  • infa
  • manage
  • onemanage
  • other

Checklist

  • Latest commit is rebased from develop with merge conflicts resolved
  • New or updates to documentation has been made accordingly
  • Assigned the proper reviewers

@mtarking mtarking self-assigned this Apr 14, 2026
@mtarking mtarking added the bug Something isn't working label Apr 14, 2026
@mtarking mtarking requested a review from akinross as a code owner April 14, 2026 10:32
@mtarking mtarking added the 2.0.0 Release 2.0.0 label Apr 14, 2026
@github-actions github-actions Bot changed the title Update iBGP, eBGP, and External Fabric Type Modules Update iBGP, eBGP, and External Fabric Type Modules (NDA-24 NDA-23) Apr 20, 2026
Copy link
Copy Markdown
Collaborator

@allenrobel allenrobel left a comment

Choose a reason for hiding this comment

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

Leaving some comments. Will defer to you though, so feel free to ignore and resolve them as appropriate.

Comment thread plugins/module_utils/models/manage_fabric/manage_fabric_base.py Outdated
Comment thread plugins/module_utils/models/manage_fabric/manage_fabric_base.py Outdated
Comment thread plugins/module_utils/models/manage_fabric/manage_fabric_base.py Outdated
Comment thread plugins/module_utils/models/manage_fabric/manage_fabric_base.py Outdated
Comment thread plugins/module_utils/models/manage_fabric/manage_fabric_common.py Outdated
@mtarking mtarking added the nda-project Move this issue to the NDA project label May 20, 2026
@mtarking mtarking requested a review from allenrobel May 21, 2026 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.0.0 Release 2.0.0 bug Something isn't working nda-project Move this issue to the NDA project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update iBGP, eBGP, and External Fabric Modules to Use FabricBaseModel (NDA-23) Update iBGP, eBGP, and External Fabric Modules Defaults (NDA-24)

2 participants