nd_interface_subinterface_unmanaged#297
Open
allenrobel wants to merge 14 commits into
Open
Conversation
d6ffd4d to
fe87d36
Compare
c2c53a1 to
c83a9f2
Compare
fe87d36 to
28b57a4
Compare
c83a9f2 to
6edb32c
Compare
28b57a4 to
0a92a71
Compare
6edb32c to
f209152
Compare
0a92a71 to
c85f5d4
Compare
f209152 to
0892797
Compare
c85f5d4 to
f5ebacf
Compare
0892797 to
cfd6e5e
Compare
f5ebacf to
8c05c0d
Compare
cfd6e5e to
ceb752b
Compare
8c05c0d to
b63fa6f
Compare
ceb752b to
0140a79
Compare
b63fa6f to
ec2060a
Compare
0140a79 to
26f876c
Compare
Sibling to SubinterfaceManagedPolicyTypeEnum. One value: monitorSubinterface. Used by the upcoming nd_interface_subinterface_unmanaged module. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Pydantic model for the unmanaged-variant L3 subinterface. Mirrors the managed model's nesting (configData/networkOS/policy) but the policy body carries only policyType=monitorSubinterface. Scaffolding fields hardcoded via Literal+frozen and excluded from the arg spec per the frozen-scaffolding convention. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…lding Class signature, ClassVars, _raise_on_multi_status_failures helper. Test file boilerplate and an empty fixture file with TEST_NOTES. Body methods follow in subsequent commits, TDD-style. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Seven cases covering success/failed/error/empty/missing/none/non-dict. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Covers happy path, 207 status:failed raise, and 500 _request failure. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Covers happy path and 500 _request failure. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Queues remove + deploy; covers happy path and unknown-switch-IP error. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Groups by switch, one POST per switch, covers 207 success and 500 failure. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Queues remove + deploy for each instance; no API calls until remove_pending/deploy_pending. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
query_one, query_all (filtering for monitorSubinterface only), and the remaining CRUD methods. Coverage at 98% on the orchestrator file. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Wires SubinterfaceUnmanagedInterfaceModel + Orchestrator into the NDStateMachine. DOCUMENTATION exposes only switch_ip + interface_name under config; all scaffolding is hidden. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
ansible-test sanity runs pylint against py3.8 compat, which rejects PEP 604 X | None syntax at file scope. The future-annotations import makes all annotations lazy strings; runtime behavior unchanged. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Mirrors the managed sibling's structure. Sub-id .20-.29 range to avoid collision with the managed target's .2-.5 range so both targets can run on the same testbed without interference. Phases: - setup: bulk cleanup - merged: create Ethernet + Port-channel subinterfaces, multi-item task, idempotency on re-apply - replaced: no-op on existing (no user-configurable fields to overwrite); fall-back-to-create on missing; idempotency on re-apply - overridden: reduce to subset, assert removed entries are gone, idempotency - deleted: delete single, idempotency, bulk teardown Requires parents in routed (L3) policy on the target switch: - Ethernet1/3 in a routed Ethernet policy (e.g. routedHost) - Port-channel10 in l3PortChannel Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
ec2060a to
94796ca
Compare
26f876c to
0864073
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)
References #295 (the 207-status:failed silent-success bug in
response_handler_nd.pyis worked around in this module via_raise_on_multi_status_failures; remove the workaround when #295 lands).Note: This PR is stacked on #296 (
nd_interface_subinterface_managed). Please review #296 first; this PR will be retargeted todevelopand rebased once #296 merges.Proposed Changes
nd_interface_subinterface_unmanagedmodule to manage L3 subinterfaces in monitor mode (unmanaged variant,policyType: monitorSubinterface) on Cisco Nexus Dashboard 4.2.SubinterfaceUnmanagedInterfaceModelandSubinterfaceUnmanagedInterfaceOrchestrator, mirroring the managed variant's structure but with the policy body reduced to itspolicyTypediscriminator only.interface_type,mode,network_os_type,policy_type) are hardcoded viaLiteral[...] + Field(frozen=True)and hidden from the user-facing argument spec. The user supplies onlyswitch_ipandinterface_nameper item.query_allfilters onpolicyType in {monitorSubinterface}via a dedicatedSubinterfaceUnmanagedPolicyTypeEnum, so managed and unmanaged subinterfaces are cleanly partitioned across the two modules.extra="ignore"on the policy model absorbs any read-only fields ND echoes underpolicyon GET (e.g. the schema'suserDefineddiscriminator branch siblings)._raise_on_multi_status_failuresmatrix and a positive assertion thatquery_allfilters out the managedsubinterfacepolicyType)..20-.29to coexist with the managed target's.2-.5range. Phases: merged (single, multi, Port-channel parent, idempotency), replaced (no-op on existing + fall-back-to-create on missing), overridden (fabric-wide reduce), deleted.Test Notes
Ethernet1/3andPort-channel10onS1_TOR1). Both managed and unmanaged targets were run successfully back-to-back to confirm the sub-id ranges do not collide.python -m pytest tests/unit/module_utils/orchestrators/test_subinterface_unmanaged_interface.py).ansible-test sanity --dockerclean on the touched files._raise_on_multi_status_failuresand documented innotes:.interface_nameechoed lowercased on GET — samenormalize_interface_namefield validator pattern as the managed variant.routing_tagint→str workaround does NOT apply here (no policy fields with that name in the unmanaged body).Cisco Nexus Dashboard Version
4.2.1
Related ND API Resource Category
Checklist
🤖 Generated with Claude Code