Add port access (NAC) resource classes#73
Open
ed6869 wants to merge 3 commits into
Open
Conversation
Add CaptivePortalProfile, PortAccessRole and PortAccessVlanGroup resource modules to manage the AOS-CX port access (NAC) configuration: - captive_portal_profile.py: system/captive_portal_profiles - port_access_role.py: system/port_access_roles - port_access_vlan_group.py: system/port_access_vlan_groups All three are registered in pyaoscx/api.py. This change also adds the pyaoscx/rest/v10_16 API version module, required by the full port access role schema, and 19 offline unit tests in tests/test_port_access.py. Signed-off-by: ed6869 <ed6869@mail.com>
This was referenced Jun 28, 2026
added 2 commits
June 28, 2026 23:53
Add pyaoscx SDK classes for AOS-CX traffic classes (system/classes) and their cfg_entries children, register them in the API dispatcher, and add offline unit tests. Signed-off-by: ed6869 <ed6869@mail.com>
Add generic three-level base classes (container, entry, action set) in port_access_policy_common.py and thin family modules for port_access_gbps, port_access_abps and port_access_policies. Register the containers in the API module dispatch table and cover them with unit tests. Signed-off-by: ed6869 <ed6869@mail.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.
Description
Add the resource classes needed to manage the full AOS-CX port access (NAC)
configuration.
Top-level,
name-indexed resources (modelled on the existingAaaServerGrouppattern — POST body includesname, PUT-basedupdate()reconcile):
CaptivePortalProfile—system/captive_portal_profilesPortAccessRole—system/port_access_rolesPortAccessVlanGroup—system/port_access_vlan_groupsTraffic classes (compound
name,typeindex, with a child entry list):Class—system/classesClassEntry—system/classes/{name},{type}/cfg_entriesThree-level policy families (container → entry → action set). A generic
base (
PortAccessPolicyContainer/PortAccessPolicyEntry/PortAccessActionSet) lives inport_access_policy_common.py, with thin familymodules layered on top:
PortAccessGbp—system/port_access_gbps(group based policy)PortAccessAbp—system/port_access_abps(application based policy)PortAccessPolicy—system/port_access_policiesAll classes are registered in
pyaoscx/api.py.The full
PortAccessRoleschema (e.g.macsec_policy,app_recognition_enable,poe_allocate_by_method,traffic_inspection_enable,in_abp,ipfix_flow_monitor) is only present at REST API v10.16, so thisPR also adds the
pyaoscx/rest/v10_16API version module. (The samepyaoscx/rest/v10_16module is introduced by the MACsec PR #75; whichevermerges first creates it and the other PR's copy becomes a no-op.)
Testing
tests/test_port_access.py— 19 offline unit tests (CaptivePortalProfile /PortAccessRole / PortAccessVlanGroup).
tests/test_class.py— 9 offline unit tests (Class / ClassEntry).tests/test_port_access_policy.py— 13 offline unit tests (gbp / abp /policy containers, entries and action sets).
flake8andblack --line-length 79clean.full create / idempotent re-run / update / delete lifecycle for every
resource, including the
PortAccessRolereferences toCaptivePortalProfileand to the gbp/abp/policy containers, and the policyentries' traffic-class references.
Fixes #72
Note on contribution guidelines:
CONTRIBUTING.mdasks to target adevelopmentbranch, but this repository only hasmaster, so this PR targetsmaster. It is linked to the required issue (#72).Companion collection PR: aruba/aoscx-ansible-collection#154