diff --git a/changelogs/fragments/110-api.yml b/changelogs/fragments/110-api.yml new file mode 100644 index 0000000..844cb99 --- /dev/null +++ b/changelogs/fragments/110-api.yml @@ -0,0 +1,6 @@ +bugfixes: + - api_modify, api_info - make API path ``ip dhcp-server`` support ``script``, and ``ip firewall nat`` support ``in-interface`` and ``in-interface-list`` + (https://github.com/ansible-collections/community.routeros/pull/110). +minor_changes: + - api_modify, api_info - support API path ``ip firewall mangle`` + (https://github.com/ansible-collections/community.routeros/pull/110). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index e7cdce6..fc23127 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -732,6 +732,7 @@ PATHS = { 'dhcp-options': KeyInfo(default='hostname,clientid'), 'disabled': KeyInfo(default=False), 'interface': KeyInfo(), + 'script': KeyInfo(can_disable=True), 'use-peer-dns': KeyInfo(default=True), 'use-peer-ntp': KeyInfo(default=True), }, @@ -893,6 +894,82 @@ PATHS = { 'ttl': KeyInfo(can_disable=True), }, ), + ('ip', 'firewall', 'mangle'): APIData( + fully_understood=True, + stratify_keys=('chain', ), + fields={ + 'action': KeyInfo(), + 'chain': KeyInfo(), + 'comment': KeyInfo(can_disable=True, remove_value=''), + 'connection-bytes': KeyInfo(can_disable=True), + 'connection-limit': KeyInfo(can_disable=True), + 'connection-mark': KeyInfo(can_disable=True), + 'connection-nat-state': KeyInfo(can_disable=True), + 'connection-rate': KeyInfo(can_disable=True), + 'connection-state': KeyInfo(can_disable=True), + 'connection-type': KeyInfo(can_disable=True), + 'content': KeyInfo(can_disable=True), + 'disabled': KeyInfo(), + 'dscp': KeyInfo(can_disable=True), + 'dst-address': KeyInfo(can_disable=True), + 'dst-address-list': KeyInfo(can_disable=True), + 'dst-address-type': KeyInfo(can_disable=True), + 'dst-limit': KeyInfo(can_disable=True), + 'dst-port': KeyInfo(can_disable=True), + 'fragment': KeyInfo(can_disable=True), + 'hotspot': KeyInfo(can_disable=True), + 'icmp-options': KeyInfo(can_disable=True), + 'in-bridge-port': KeyInfo(can_disable=True), + 'in-bridge-port-list': KeyInfo(can_disable=True), + 'in-interface': KeyInfo(can_disable=True), + 'in-interface-list': KeyInfo(can_disable=True), + 'ingress-priority': KeyInfo(can_disable=True), + 'ipsec-policy': KeyInfo(can_disable=True), + 'ipv4-options': KeyInfo(can_disable=True), + 'layer7-protocol': KeyInfo(can_disable=True), + 'limit': KeyInfo(can_disable=True), + 'log': KeyInfo(), + 'log-prefix': KeyInfo(), + 'new-connection-mark': KeyInfo(can_disable=True), + 'new-dscp': KeyInfo(can_disable=True), + 'new-mss': KeyInfo(can_disable=True), + 'new-packet-mark': KeyInfo(can_disable=True), + 'new-priority': KeyInfo(can_disable=True), + 'new-routing-mark': KeyInfo(can_disable=True), + 'new-ttl': KeyInfo(can_disable=True), + 'nth': KeyInfo(can_disable=True), + 'out-bridge-port': KeyInfo(can_disable=True), + 'out-bridge-port-list': KeyInfo(can_disable=True), + 'out-interface': KeyInfo(can_disable=True), + 'out-interface-list': KeyInfo(can_disable=True), + 'p2p': KeyInfo(can_disable=True), + 'packet-mark': KeyInfo(can_disable=True), + 'packet-size': KeyInfo(can_disable=True), + 'passthrough': KeyInfo(can_disable=True), + 'per-connection-classifier': KeyInfo(can_disable=True), + 'port': KeyInfo(can_disable=True), + 'priority': KeyInfo(can_disable=True), + 'protocol': KeyInfo(can_disable=True), + 'psd': KeyInfo(can_disable=True), + 'random': KeyInfo(can_disable=True), + 'route-dst': KeyInfo(can_disable=True), + 'routing-mark': KeyInfo(can_disable=True), + 'routing-table': KeyInfo(can_disable=True), + 'sniff-id': KeyInfo(can_disable=True), + 'sniff-target': KeyInfo(can_disable=True), + 'sniff-target-port': KeyInfo(can_disable=True), + 'src-address': KeyInfo(can_disable=True), + 'src-address-list': KeyInfo(can_disable=True), + 'src-address-type': KeyInfo(can_disable=True), + 'src-mac-address': KeyInfo(can_disable=True), + 'src-port': KeyInfo(can_disable=True), + 'tcp-flags': KeyInfo(can_disable=True), + 'tcp-mss': KeyInfo(can_disable=True), + 'time': KeyInfo(can_disable=True), + 'tls-host': KeyInfo(can_disable=True), + 'ttl': KeyInfo(can_disable=True), + }, + ), ('ip', 'firewall', 'nat'): APIData( fully_understood=True, stratify_keys=('chain', ), @@ -902,6 +979,8 @@ PATHS = { 'comment': KeyInfo(can_disable=True, remove_value=''), 'dst-address': KeyInfo(can_disable=True), 'dst-port': KeyInfo(can_disable=True), + 'in-interface': KeyInfo(can_disable=True), + 'in-interface-list': KeyInfo(can_disable=True), 'out-interface': KeyInfo(can_disable=True), 'out-interface-list': KeyInfo(can_disable=True), 'protocol': KeyInfo(can_disable=True), diff --git a/plugins/modules/api_info.py b/plugins/modules/api_info.py index 75e1a00..d580bb6 100644 --- a/plugins/modules/api_info.py +++ b/plugins/modules/api_info.py @@ -71,6 +71,7 @@ options: - ip firewall address-list - ip firewall connection tracking - ip firewall filter + - ip firewall mangle - ip firewall nat - ip firewall service-port - ip hotspot service-port diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index fdf682e..a0d76ba 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -73,6 +73,7 @@ options: - ip firewall address-list - ip firewall connection tracking - ip firewall filter + - ip firewall mangle - ip firewall nat - ip firewall service-port - ip hotspot service-port