Support for additional API paths (#125)

* adding api path interface pppoe-client

Signed-off-by: Tomas Herfert <herfik>

* support for api path interface vlan

Signed-off-by: Tomas Herfert <herfik>

* support for api path interface bridge vlan

Signed-off-by: Tomas Herfert <herfik>

* PR ID update

Signed-off-by: Tomas Herfert <herfik>

* typo fix

Signed-off-by: Tomas Herfert <herfik>

* support for API path interface bridge and update of interface bridge port ingress-filtering to True

Signed-off-by: Tomas Herfert <herfik>

* Apply suggestion per code review

Signed-off-by: Tomas Herfert <herfik>

* Update changelogs/fragments/125-api.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Signed-off-by: Tomas Herfert <herfik>
Co-authored-by: Tomas Herfert <herfik>
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Tomas Herfert 2022-11-12 16:08:25 +01:00 committed by GitHub
parent 9567bbf292
commit ad9d7c3829
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 77 additions and 4 deletions

View file

@ -0,0 +1,6 @@
minor_changes:
- api_modify, api_info - support API paths ``interface pppoe-client``, ``interface vlan``, ``interface bridge``, ``interface bridge vlan``
(https://github.com/ansible-collections/community.routeros/pull/125).
bugfixes:
- api_modify, api_info - the default of the field ``ingress-filtering`` in ``interface bridge port`` is now ``true``, which is the default in ROS
(https://github.com/ansible-collections/community.routeros/pull/125).

View file

@ -79,25 +79,29 @@ def join_path(path):
PATHS = { PATHS = {
('interface', 'bridge'): APIData( ('interface', 'bridge'): APIData(
# fully_understood=True, fully_understood=True,
primary_keys=('name', ), primary_keys=('name', ),
fields={ fields={
'admin-mac': KeyInfo(), 'admin-mac': KeyInfo(default=''),
'ageing-time': KeyInfo(default='5m'), 'ageing-time': KeyInfo(default='5m'),
'arp': KeyInfo(default='enabled'), 'arp': KeyInfo(default='enabled'),
'arp-timeout': KeyInfo(default='auto'), 'arp-timeout': KeyInfo(default='auto'),
'auto-mac': KeyInfo(default=False), 'auto-mac': KeyInfo(default=True),
'comment': KeyInfo(can_disable=True, remove_value=''), 'comment': KeyInfo(can_disable=True, remove_value=''),
'dhcp-snooping': KeyInfo(default=False), 'dhcp-snooping': KeyInfo(default=False),
'disabled': KeyInfo(default=False), 'disabled': KeyInfo(default=False),
'ether-type': KeyInfo(default='0x8100'),
'fast-forward': KeyInfo(default=True), 'fast-forward': KeyInfo(default=True),
'frame-types': KeyInfo(default='admit-all'),
'forward-delay': KeyInfo(default='15s'), 'forward-delay': KeyInfo(default='15s'),
'igmp-snooping': KeyInfo(default=False), 'igmp-snooping': KeyInfo(default=False),
'ingress-filtering': KeyInfo(default=True),
'max-message-age': KeyInfo(default='20s'), 'max-message-age': KeyInfo(default='20s'),
'mtu': KeyInfo(default='auto'), 'mtu': KeyInfo(default='auto'),
'name': KeyInfo(), 'name': KeyInfo(),
'priority': KeyInfo(default='0x8000'), 'priority': KeyInfo(default='0x8000'),
'protocol-mode': KeyInfo(default='rstp'), 'protocol-mode': KeyInfo(default='rstp'),
'pvid': KeyInfo(default=1),
'transmit-hold-count': KeyInfo(default=6), 'transmit-hold-count': KeyInfo(default=6),
'vlan-filtering': KeyInfo(default=False), 'vlan-filtering': KeyInfo(default=False),
}, },
@ -173,6 +177,49 @@ PATHS = {
'use-peer-dns': KeyInfo(), 'use-peer-dns': KeyInfo(),
}, },
), ),
('interface', 'pppoe-client'): APIData(
fully_understood=True,
primary_keys=('name', ),
fields={
'ac-name': KeyInfo(default=''),
'add-default-route': KeyInfo(default=False),
'allow': KeyInfo(default='pap,chap,mschap1,mschap2'),
'comment': KeyInfo(can_disable=True, remove_value=''),
'default-route-distance': KeyInfo(default=1),
'dial-on-demand': KeyInfo(default=False),
'disabled': KeyInfo(default=True),
'host-uniq': KeyInfo(can_disable=True),
'interface': KeyInfo(required=True),
'keepalive-timeout': KeyInfo(default=10),
'max-mru': KeyInfo(default='auto'),
'max-mtu': KeyInfo(default='auto'),
'mrru': KeyInfo(default='disabled'),
'name': KeyInfo(),
'password': KeyInfo(default=''),
'profile': KeyInfo(default='default'),
'service-name': KeyInfo(default=''),
'use-peer-dns': KeyInfo(default=False),
'user': KeyInfo(default=''),
},
),
('interface', 'vlan'): APIData(
fully_understood=True,
primary_keys=('name', ),
fields={
'arp': KeyInfo(default='enabled'),
'arp-timeout': KeyInfo(default='auto'),
'comment': KeyInfo(can_disable=True, remove_value=''),
'disabled': KeyInfo(default=False),
'interface': KeyInfo(required=True),
'loop-protect': KeyInfo(default='default'),
'loop-protect-disable-time': KeyInfo(default='5m'),
'loop-protect-send-interval': KeyInfo(default='5s'),
'mtu': KeyInfo(default=1500),
'name': KeyInfo(),
'use-service-tag': KeyInfo(default=False),
'vlan-id': KeyInfo(required=True),
},
),
('interface', 'wireless', 'security-profiles'): APIData( ('interface', 'wireless', 'security-profiles'): APIData(
unknown_mechanism=True, unknown_mechanism=True,
# primary_keys=('default', ), # primary_keys=('default', ),
@ -486,7 +533,7 @@ PATHS = {
'frame-types': KeyInfo(default='admit-all'), 'frame-types': KeyInfo(default='admit-all'),
'horizon': KeyInfo(default='none'), 'horizon': KeyInfo(default='none'),
'hw': KeyInfo(default=True), 'hw': KeyInfo(default=True),
'ingress-filtering': KeyInfo(default=False), 'ingress-filtering': KeyInfo(default=True),
'interface': KeyInfo(), 'interface': KeyInfo(),
'internal-path-cost': KeyInfo(default=10), 'internal-path-cost': KeyInfo(default=10),
'learn': KeyInfo(default='auto'), 'learn': KeyInfo(default='auto'),
@ -531,6 +578,18 @@ PATHS = {
'use-ip-firewall-for-vlan': KeyInfo(default=False), 'use-ip-firewall-for-vlan': KeyInfo(default=False),
}, },
), ),
('interface', 'bridge', 'vlan'): APIData(
fully_understood=True,
primary_keys=('bridge', 'vlan-ids', ),
fields={
'bridge': KeyInfo(),
'comment': KeyInfo(can_disable=True, remove_value=''),
'disabled': KeyInfo(default=False),
'tagged': KeyInfo(default=''),
'untagged': KeyInfo(default=''),
'vlan-ids': KeyInfo(),
},
),
('ip', 'firewall', 'connection', 'tracking'): APIData( ('ip', 'firewall', 'connection', 'tracking'): APIData(
single_value=True, single_value=True,
fully_understood=True, fully_understood=True,

View file

@ -44,10 +44,12 @@ options:
# BEGIN PATH LIST # BEGIN PATH LIST
- caps-man aaa - caps-man aaa
- certificate settings - certificate settings
- interface bridge
- interface bridge port - interface bridge port
- interface bridge port-controller - interface bridge port-controller
- interface bridge port-extender - interface bridge port-extender
- interface bridge settings - interface bridge settings
- interface bridge vlan
- interface detect-internet - interface detect-internet
- interface ethernet - interface ethernet
- interface ethernet switch - interface ethernet switch
@ -56,8 +58,10 @@ options:
- interface list - interface list
- interface list member - interface list member
- interface ovpn-server server - interface ovpn-server server
- interface pppoe-client
- interface pptp-server server - interface pptp-server server
- interface sstp-server server - interface sstp-server server
- interface vlan
- interface wireless align - interface wireless align
- interface wireless cap - interface wireless cap
- interface wireless sniffer - interface wireless sniffer

View file

@ -49,10 +49,12 @@ options:
# BEGIN PATH LIST # BEGIN PATH LIST
- caps-man aaa - caps-man aaa
- certificate settings - certificate settings
- interface bridge
- interface bridge port - interface bridge port
- interface bridge port-controller - interface bridge port-controller
- interface bridge port-extender - interface bridge port-extender
- interface bridge settings - interface bridge settings
- interface bridge vlan
- interface detect-internet - interface detect-internet
- interface ethernet - interface ethernet
- interface ethernet switch - interface ethernet switch
@ -61,8 +63,10 @@ options:
- interface list - interface list
- interface list member - interface list member
- interface ovpn-server server - interface ovpn-server server
- interface pppoe-client
- interface pptp-server server - interface pptp-server server
- interface sstp-server server - interface sstp-server server
- interface vlan
- interface wireless align - interface wireless align
- interface wireless cap - interface wireless cap
- interface wireless sniffer - interface wireless sniffer