From 86b4b934f1c2f5ccb98bacd0460e139f4170adb9 Mon Sep 17 00:00:00 2001 From: Michael Hanselmann Date: Wed, 16 Aug 2023 21:54:51 +0200 Subject: [PATCH] Add "interface wireless" to API data The default values match those of RouterOS 7.11 on a Mikrotik RB924i-2nD-BT5&BG77 ("Knot"). They're cross-checked with upstream documentation[1]. [1] https://help.mikrotik.com/docs/display/ROS/Wireless+Interface Signed-off-by: Michael Hanselmann --- .../195-add-interface-wireless-data.yml | 2 + plugins/module_utils/_api_data.py | 98 +++++++++++++++++++ plugins/modules/api_info.py | 1 + plugins/modules/api_modify.py | 1 + 4 files changed, 102 insertions(+) create mode 100644 changelogs/fragments/195-add-interface-wireless-data.yml diff --git a/changelogs/fragments/195-add-interface-wireless-data.yml b/changelogs/fragments/195-add-interface-wireless-data.yml new file mode 100644 index 00000000..cdb91b54 --- /dev/null +++ b/changelogs/fragments/195-add-interface-wireless-data.yml @@ -0,0 +1,2 @@ +minor_changes: + - api_info, api_modify - add support for the ``interface wireless`` path (https://github.com/ansible-collections/community.routeros/pull/195). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index d57ddaea..06606bd6 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -1214,6 +1214,104 @@ def join_path(path): 'public-key': KeyInfo(), }, ), + ('interface', 'wireless'): APIData( + fully_understood=True, + primary_keys=('name', ), + required_one_of=[['default-name', 'master-interface']], + fields={ + 'adaptive-noise-immunity': KeyInfo(default='none'), + 'allow-sharedkey': KeyInfo(default=False), + 'ampdu-priorities': KeyInfo(default=0), + 'amsdu-limit': KeyInfo(default=8192), + 'amsdu-threshold': KeyInfo(default=8192), + 'antenna-gain': KeyInfo(default=0), + 'antenna-mode': KeyInfo(), + 'area': KeyInfo(default=''), + 'arp': KeyInfo(default='enabled'), + 'arp-timeout': KeyInfo(default='auto'), + 'band': KeyInfo(), + 'basic-rates-a/g': KeyInfo(default='6Mbps'), + 'basic-rates-b': KeyInfo(default='1Mbps'), + 'bridge-mode': KeyInfo(default='enabled'), + 'channel-width': KeyInfo(default='20mhz'), + 'comment': KeyInfo(can_disable=True, remove_value=''), + 'compression': KeyInfo(default=False), + 'country': KeyInfo(default='etsi'), + 'default-ap-tx-limit': KeyInfo(default=0), + 'default-authentication': KeyInfo(default=True), + 'default-client-tx-limit': KeyInfo(default=0), + 'default-forwarding': KeyInfo(default=True), + 'default-name': KeyInfo(), + 'disable-running-check': KeyInfo(default=False), + 'disabled': KeyInfo(default=True), + 'disconnect-timeout': KeyInfo(default='3s'), + 'distance': KeyInfo(default='dynamic'), + 'frame-lifetime': KeyInfo(default=0), + 'frequency': KeyInfo(), + 'frequency-mode': KeyInfo(default='regulatory-domain'), + 'frequency-offset': KeyInfo(default=0), + 'guard-interval': KeyInfo(default='any'), + 'hide-ssid': KeyInfo(default=False), + 'ht-basic-mcs': KeyInfo(), + 'ht-supported-mcs': KeyInfo(), + 'hw-fragmentation-threshold': KeyInfo(default='disabled'), + 'hw-protection-mode': KeyInfo(default='none'), + 'hw-protection-threshold': KeyInfo(default=0), + 'hw-retries': KeyInfo(default=7), + 'installation': KeyInfo(default='any'), + 'interworking-profile': KeyInfo(default='disabled'), + 'keepalive-frames': KeyInfo(default='enabled'), + 'l2mtu': KeyInfo(default=1600), + 'mac-address': KeyInfo(), + 'master-interface': KeyInfo(), + 'max-station-count': KeyInfo(default=2007), + 'mode': KeyInfo(default='ap-bridge'), + 'mtu': KeyInfo(default=1500), + 'multicast-buffering': KeyInfo(default='enabled'), + 'multicast-helper': KeyInfo(default='default'), + 'name': KeyInfo(), + 'noise-floor-threshold': KeyInfo(default='default'), + 'nv2-cell-radius': KeyInfo(default=30), + 'nv2-downlink-ratio': KeyInfo(default=50), + 'nv2-mode': KeyInfo(default='dynamic-downlink'), + 'nv2-noise-floor-offset': KeyInfo(default='default'), + 'nv2-preshared-key': KeyInfo(default=''), + 'nv2-qos': KeyInfo(default='default'), + 'nv2-queue-count': KeyInfo(default=2), + 'nv2-security': KeyInfo(default='disabled'), + 'nv2-sync-secret': KeyInfo(default=''), + 'on-fail-retry-time': KeyInfo(default='100ms'), + 'preamble-mode': KeyInfo(default='both'), + 'radio-name': KeyInfo(), + 'rate-selection': KeyInfo(default='advanced'), + 'rate-set': KeyInfo(default='default'), + 'running': KeyInfo(default=False), + 'rx-chains': KeyInfo(default='0,1'), + 'scan-list': KeyInfo(default='default'), + 'secondary-frequency': KeyInfo(default=''), + 'security-profile': KeyInfo(default='default'), + 'skip-dfs-channels': KeyInfo(default='disabled'), + 'ssid': KeyInfo(required=True), + 'station-bridge-clone-mac': KeyInfo(), + 'station-roaming': KeyInfo(default='disabled'), + 'supported-rates-a/g': KeyInfo(), + 'supported-rates-b': KeyInfo(), + 'tdma-period-size': KeyInfo(default=2), + 'tx-chains': KeyInfo(), + 'tx-power-mode': KeyInfo(default='default'), + 'update-stats-interval': KeyInfo(default='disabled'), + 'vlan-id': KeyInfo(default=1), + 'vlan-mode': KeyInfo(default='no-tag'), + 'wds-cost-range': KeyInfo(default='50-150'), + 'wds-default-bridge': KeyInfo(default='none'), + 'wds-default-cost': KeyInfo(default=100), + 'wds-ignore-ssid': KeyInfo(default=False), + 'wds-mode': KeyInfo(default='disabled'), + 'wireless-protocol': KeyInfo(default='any'), + 'wmm-support': KeyInfo(default='disabled'), + 'wps-mode': KeyInfo(default='push-button'), + }, + ), ('interface', 'wireless', 'align'): APIData( single_value=True, fully_understood=True, diff --git a/plugins/modules/api_info.py b/plugins/modules/api_info.py index 31db39ee..c44522bc 100644 --- a/plugins/modules/api_info.py +++ b/plugins/modules/api_info.py @@ -79,6 +79,7 @@ - interface vrrp - interface wireguard - interface wireguard peers + - interface wireless - interface wireless align - interface wireless cap - interface wireless sniffer diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index d5c319bd..e10aba41 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -84,6 +84,7 @@ - interface vrrp - interface wireguard - interface wireguard peers + - interface wireless - interface wireless align - interface wireless cap - interface wireless sniffer