Repository navigation
feat(adapters): add Cisco Catalyst SD-WAN source adapter (ciscosdwan) - #426
Draft
pcDamasceno wants to merge 2 commits into
Draft
pcDamasceno wants to merge 2 commits into
pcDamasceno wants to merge 2 commits into
Conversation
Read inventory from SD-WAN Manager with its form login and XSRF token, pageInfo pagination, bounded retries and a logout at the end of the run. The example maps the Manager, its sites, configuration groups and WAN edge routers to the Sdwan schema. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying infrahub-sync with
|
| Latest commit: |
00cc63f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://44b3da35.infrahub-sync.pages.dev |
| Branch Preview URL: | https://017-cisco-sdwan-adapter.infrahub-sync.pages.dev |
Vale 3.13.0, the version pinned in the linter workflow, flags "onboarded" in docs/docs/adapters/cisco-sdwan.mdx as a spelling error. Newer Vale releases accept the word, so the check passed locally. Cisco uses "onboard" for registering a WAN edge router with the Manager. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Network teams that run Cisco Catalyst SD-WAN can now compare the inventory in SD-WAN Manager with Infrahub and sync it with the usual configuration-driven workflow. The new
ciscosdwansource adapter reads any JSON resource under/dataservice/. The example maps the Manager, its sites, its configuration groups and its WAN edge routers to theSdwanInstance,SdwanSite,SdwanConfigurationGroupandSdwanRouterkinds.Adapter behavior
CISCO_SDWAN_USERNAMEandCISCO_SDWAN_PASSWORD, andCISCO_SDWAN_URLreplaces theurlsetting when set.pageInfopagination (moreEntries, thenstartIdset to the receivedendId). An endpoint that uses scroll pagination stops the run instead of loading part of the resource.Retry-After. Logs in once more when the Manager rejects the session during a run.host-namebecomeshost_name), so Jinja2 transforms can use those fields.Part of the router mapping in the example:
The change adds no dependencies and does not change infrahub-sync core. The example schema (
examples/cisco_sdwan_to_infrahub/schema.yml) contains the fourSdwannode definitions from a complete SD-WAN schema, unchanged, without the relationships to nodes outside those four.Lab validation
diffandsyncran against the Cisco DevNet SD-WAN sandbox (SD-WAN Manager 20.18.2.1) and an Infrahub 1.12.1 instance, into a dedicated Infrahub branch. The sync created 1 instance, 1 configuration group, 5 sites and 4 routers with their relationships. A seconddiffagainst that branch reported no differences.configuredSiteIdkeeps those 4.tests/fixtures/ciscosdwan/.Documentation updates
docs/docs/adapters/cisco-sdwan.mdx(new): authentication, the example mapping, connection settings, mapping other resources, and failure handling.docs/sidebars.ts,docs/docs/adapters/choosing-an-adapter.mdx,docs/docs/readme.mdx,README.mdandAGENTS.mdlist the adapter..vale/styles/spelling-exceptions.txtaddsvManage.changelog/+cisco-sdwan-adapter.added.mdrecords the adapter and the example.The docs page passes rumdl, Vale and a Docusaurus build. Its statements were checked against the code, the lab and the Cisco authentication page. It did not go through the outline and review stops of the OpsMill docs-writing workflow.
Not covered by this change
Sdwanschema has no kinds for them; the Manager provides them through the device state endpoints.infrahub-sync generatereads the Infrahub address and token only fromconfig.yml, and ignoresINFRAHUB_ADDRESS.Test plan
Results before opening: ruff passes,
uv run ty check .exits 0, pylint rates the new modules 10.00/10, yamllint passes on the example, and the unit suite reports 432 passed and 5 skipped. For a live check, load the example schema, set theCISCO_SDWAN_*andINFRAHUB_API_TOKENvariables, then rungenerateanddiffforfrom-cisco-sdwan.🤖 Generated with Claude Code