Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paths #137

Merged
merged 10 commits into from
Nov 29, 2022
Merged

Paths #137

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelogs/fragments/137-api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
minor_changes:
- api_info, api_modify - support API paths ``interface ethernet poe``, ``interface gre6``, ``interface vrrp`` and also support all previously missing fields of entries in ``ip dhcp-server`` (https://github.com/ansible-collections/community.routeros/pull/137).
bugfixes:
- api_modify - ``address-pool`` field of entries in API path ``ip dhcp-server`` is not required anymore (https://github.com/ansible-collections/community.routeros/pull/137).
74 changes: 73 additions & 1 deletion plugins/module_utils/_api_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,21 @@ def join_path(path):
'tx-flow-control': KeyInfo(default='off'),
},
),
('interface', 'ethernet', 'poe'): APIData(
fixed_entries=True,
fully_understood=True,
primary_keys=('name', ),
fields={
'name': KeyInfo(),
'poe-out': KeyInfo(default='auto-on'),
'poe-priority': KeyInfo(default=10),
'poe-voltage': KeyInfo(default='auto'),
'power-cycle-interval': KeyInfo(default='none'),
'power-cycle-ping-address': KeyInfo(can_disable=True),
'power-cycle-ping-enabled': KeyInfo(default=False),
'power-cycle-ping-timeout': KeyInfo(can_disable=True),
}
),
('interface', 'gre'): APIData(
fully_understood=True,
primary_keys=('name', ),
Expand All @@ -217,6 +232,22 @@ def join_path(path):
'remote-address': KeyInfo(required=True),
},
),
('interface', 'gre6'): APIData(
fully_understood=True,
primary_keys=('name',),
fields={
'clamp-tcp-mss': KeyInfo(default=True),
'comment': KeyInfo(can_disable=True, remove_value=''),
'disabled': KeyInfo(default=False),
'dscp': KeyInfo(default='inherit'),
'ipsec-secret': KeyInfo(can_disable=True),
'keepalive': KeyInfo(default='10s,10', can_disable=True),
'local-address': KeyInfo(default='::'),
'mtu': KeyInfo(default='auto'),
'name': KeyInfo(),
'remote-address': KeyInfo(required=True),
},
),
('interface', 'list'): APIData(
primary_keys=('name', ),
fully_understood=True,
Expand Down Expand Up @@ -292,6 +323,33 @@ def join_path(path):
'vlan-id': KeyInfo(required=True),
},
),
('interface', 'vrrp'): APIData(
fully_understood=True,
primary_keys=('name', ),
fields={
'arp': KeyInfo(default='enabled'),
'arp-timeout': KeyInfo(default='auto'),
'authentication': KeyInfo(default='none'),
'comment': KeyInfo(can_disable=True, remove_value=''),
'disabled': KeyInfo(default=False),
'group-master': KeyInfo(default=''),
'interface': KeyInfo(required=True),
'interval': KeyInfo(default='1s'),
'mtu': KeyInfo(default=1500),
'name': KeyInfo(),
'on-backup': KeyInfo(default=''),
'on-fail': KeyInfo(default=''),
'on-master': KeyInfo(default=''),
'password': KeyInfo(default=''),
'preemption-mode': KeyInfo(default=True),
'priority': KeyInfo(default=100),
'remote-address': KeyInfo(),
'sync-connection-tracking': KeyInfo(default=False),
'v3-protocol': KeyInfo(default='ipv4'),
'version': KeyInfo(default=3),
'vrid': KeyInfo(default=1),
},
),
('interface', 'wireless', 'security-profiles'): APIData(
unknown_mechanism=True,
# primary_keys=('default', ),
Expand Down Expand Up @@ -504,13 +562,27 @@ def join_path(path):
fully_understood=True,
primary_keys=('name', ),
fields={
'address-pool': KeyInfo(required=True),
'address-pool': KeyInfo(default='static-only'),
'allow-dual-stack-queue': KeyInfo(can_disable=True, remove_value=True),
'always-broadcast': KeyInfo(can_disable=True, remove_value=False),
'authoritative': KeyInfo(default=True),
'bootp-lease-time': KeyInfo(default='forever'),
'bootp-support': KeyInfo(can_disable=True, remove_value='static'),
'client-mac-limit': KeyInfo(can_disable=True, remove_value='unlimited'),
'comment': KeyInfo(can_disable=True, remove_value=''),
'conflict-detection': KeyInfo(can_disable=True, remove_value=True),
'delay-threshold': KeyInfo(can_disable=True, remove_value='none'),
'dhcp-option-set': KeyInfo(can_disable=True, remove_value='none'),
'disabled': KeyInfo(default=False),
'insert-queue-before': KeyInfo(can_disable=True, remove_value='first'),
'interface': KeyInfo(required=True),
'lease-script': KeyInfo(default=''),
'lease-time': KeyInfo(default='10m'),
'name': KeyInfo(),
'parent-queue': KeyInfo(can_disable=True, remove_value='none'),
'relay': KeyInfo(can_disable=True, remove_value='0.0.0.0'),
'server-address': KeyInfo(can_disable=True, remove_value='0.0.0.0'),
'use-framed-as-classless': KeyInfo(can_disable=True, remove_value=True),
'use-radius': KeyInfo(default=False),
},
),
Expand Down
3 changes: 3 additions & 0 deletions plugins/modules/api_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@
- interface detect-internet
- interface eoip
- interface ethernet
- interface ethernet poe
- interface ethernet switch
- interface ethernet switch port
- interface gre
- interface gre6
- interface l2tp-server server
- interface list
- interface list member
Expand All @@ -72,6 +74,7 @@
- interface pptp-server server
- interface sstp-server server
- interface vlan
- interface vrrp
- interface wireless align
- interface wireless cap
- interface wireless sniffer
Expand Down
3 changes: 3 additions & 0 deletions plugins/modules/api_modify.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@
- interface detect-internet
- interface eoip
- interface ethernet
- interface ethernet poe
- interface ethernet switch
- interface ethernet switch port
- interface gre
- interface gre6
- interface l2tp-server server
- interface list
- interface list member
Expand All @@ -77,6 +79,7 @@
- interface pptp-server server
- interface sstp-server server
- interface vlan
- interface vrrp
- interface wireless align
- interface wireless cap
- interface wireless sniffer
Expand Down