Skip to content

Add port access (NAC) resource classes#73

Open
ed6869 wants to merge 3 commits into
aruba:masterfrom
ed6869:feature/port-access
Open

Add port access (NAC) resource classes#73
ed6869 wants to merge 3 commits into
aruba:masterfrom
ed6869:feature/port-access

Conversation

@ed6869

@ed6869 ed6869 commented Jun 28, 2026

Copy link
Copy Markdown

Description

Add the resource classes needed to manage the full AOS-CX port access (NAC)
configuration.

Top-level, name-indexed resources (modelled on the existing
AaaServerGroup pattern — POST body includes name, PUT-based update()
reconcile):

  • CaptivePortalProfilesystem/captive_portal_profiles
  • PortAccessRolesystem/port_access_roles
  • PortAccessVlanGroupsystem/port_access_vlan_groups

Traffic classes (compound name,type index, with a child entry list):

  • Classsystem/classes
  • ClassEntrysystem/classes/{name},{type}/cfg_entries

Three-level policy families (container → entry → action set). A generic
base (PortAccessPolicyContainer / PortAccessPolicyEntry /
PortAccessActionSet) lives in port_access_policy_common.py, with thin family
modules layered on top:

  • PortAccessGbpsystem/port_access_gbps (group based policy)
  • PortAccessAbpsystem/port_access_abps (application based policy)
  • PortAccessPolicysystem/port_access_policies

All classes are registered in pyaoscx/api.py.

The full PortAccessRole schema (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 this
PR also adds the pyaoscx/rest/v10_16 API version module. (The same
pyaoscx/rest/v10_16 module is introduced by the MACsec PR #75; whichever
merges 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).
  • All mocked-session, no switch required; flake8 and
    black --line-length 79 clean.
  • Validated end-to-end against an AOS-CX 6300 (firmware FL.10.17, REST v10.16):
    full create / idempotent re-run / update / delete lifecycle for every
    resource, including the PortAccessRole references to
    CaptivePortalProfile and to the gbp/abp/policy containers, and the policy
    entries' traffic-class references.

Fixes #72


Note on contribution guidelines: CONTRIBUTING.md asks to target a
development branch, but this repository only has master, so this PR targets
master. It is linked to the required issue (#72).

Companion collection PR: aruba/aoscx-ansible-collection#154

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>
ed6869 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add port access (NAC) resource classes: captive portal profile, port access role, port access VLAN group

1 participant