Add SNMP family resource modules (v10.16)#77
Open
ed6869 wants to merge 2 commits into
Open
Conversation
Add Snmpv3User, SnmpCommunity, SnmpView, SnmpViewEntry and SnmpTrap modules for system/snmpv3_users, snmp_community_attributes, snmp_views (with immutable view entries) and snmp_traps (compound index). Register them in api.py and add the v10.16 REST mapping. Includes offline tests. Signed-off-by: ed6869 <ed6869@mail.com>
Some firmware returns the snmp_view_entry attributes inline instead of a reference map; parse both shapes so enumeration does not crash and view entries stay idempotent. 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.
Summary
Add the SNMP family of resource modules so the AOS-CX Ansible collection
can manage SNMP through pyaoscx.
New modules (registered in
pyaoscx/api.py):Snmpv3User(system/snmpv3_users) — full CRUD, with auth/privprotocols and pass phrases, access level, remote engine ID, view link.
SnmpCommunity(system/snmp_community_attributes) — CRUD, optionalview link.
SnmpView(system/snmp_views) — CRUD.SnmpViewEntry(.../snmp_view_entry) — server-generated UUID index,create/delete only (entries are immutable).
SnmpTrap(system/snmp_traps) — compound index(vrf, receiver_address, receiver_udp_port, type, version), create/delete.
Adds the v10.16 REST mapping required by the SNMP endpoints.
Testing
tests/test_snmp.py) — mocked session, 6 passing.switch via the companion collection modules.
Companion collection PR
Companion collection PR: aruba/aoscx-ansible-collection#160
Fixes #79