diff --git a/changelogs/fragments/159-snmp_community.yml b/changelogs/fragments/159-snmp_community.yml new file mode 100644 index 0000000..b8d678e --- /dev/null +++ b/changelogs/fragments/159-snmp_community.yml @@ -0,0 +1,3 @@ +minor_changes: + - api_modify - add support for ``trap-interfaces`` in API path ``snmp`` (https://github.com/ansible-collections/community.routeros/pull/159). + - api_modify - add support for API path ``snmp community`` (https://github.com/ansible-collections/community.routeros/pull/159). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 75a3610..8d78588 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -748,20 +748,20 @@ PATHS = { }, ), ('snmp', 'community'): APIData( - unknown_mechanism=True, - # primary_keys=('default', ), + fully_understood=True, + primary_keys=('name', ), fields={ - 'default': KeyInfo(), - 'addresses': KeyInfo(), - 'authentication-password': KeyInfo(), - 'authentication-protocol': KeyInfo(), - 'disabled': KeyInfo(), - 'encryption-password': KeyInfo(), - 'encryption-protocol': KeyInfo(), - 'name': KeyInfo(), - 'read-access': KeyInfo(), - 'security': KeyInfo(), - 'write-access': KeyInfo(), + 'addresses': KeyInfo(default='::/0'), + 'authentication-password': KeyInfo(default=''), + 'authentication-protocol': KeyInfo(default='MD5'), + 'comment': KeyInfo(can_disable=True, remove_value=''), + 'disabled': KeyInfo(default=False), + 'encryption-password': KeyInfo(default=''), + 'encryption-protocol': KeyInfo(default='DES'), + 'name': KeyInfo(required=True), + 'read-access': KeyInfo(default=True), + 'security': KeyInfo(default='none'), + 'write-access': KeyInfo(default=False), }, ), ('caps-man', 'aaa'): APIData( @@ -2286,6 +2286,7 @@ PATHS = { 'trap-generators': KeyInfo(default='temp-exception'), 'trap-target': KeyInfo(default=''), 'trap-version': KeyInfo(default=1), + 'trap-interfaces': KeyInfo(default=''), }, ), ('system', 'clock'): APIData( diff --git a/plugins/modules/api_info.py b/plugins/modules/api_info.py index b5c684c..3220a52 100644 --- a/plugins/modules/api_info.py +++ b/plugins/modules/api_info.py @@ -154,6 +154,7 @@ options: - routing rip - routing ripng - snmp + - snmp community - system clock - system clock manual - system identity diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index 40d9069..029fcd0 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -159,6 +159,7 @@ options: - routing rip - routing ripng - snmp + - snmp community - system clock - system clock manual - system identity