From 558eb501d28a4b86998edb7697aac7b27414acc7 Mon Sep 17 00:00:00 2001 From: PhiBo Date: Thu, 10 Nov 2022 21:09:58 +0100 Subject: [PATCH] Add support for ip route and ip route vrf (#123) * Add support for ip route and ip route vrf * Changelog --- changelogs/fragments/123-api.yml | 3 +++ plugins/module_utils/_api_data.py | 25 +++++++++++++++++++++++++ plugins/modules/api_info.py | 2 ++ plugins/modules/api_modify.py | 2 ++ 4 files changed, 32 insertions(+) create mode 100644 changelogs/fragments/123-api.yml diff --git a/changelogs/fragments/123-api.yml b/changelogs/fragments/123-api.yml new file mode 100644 index 00000000..561a6ed6 --- /dev/null +++ b/changelogs/fragments/123-api.yml @@ -0,0 +1,3 @@ +minor_changes: + - api_modify, api_info - support API paths ``ip route`` and ``ip route vrf`` + (https://github.com/ansible-collections/community.routeros/pull/123). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index fbaa9c37..88429bf9 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -298,6 +298,31 @@ def join_path(path): 'ranges': KeyInfo(), }, ), + ('ip', 'route'): APIData( + fully_understood=True, + fields={ + 'check-gateway': KeyInfo(can_disable=True), + 'comment': KeyInfo(can_disable=True, remove_value=''), + 'disabled': KeyInfo(default=False), + 'distance': KeyInfo(), + 'dst-address': KeyInfo(), + 'gateway': KeyInfo(required=True), + 'route-tag': KeyInfo(can_disable=True), + 'routing-mark': KeyInfo(can_disable=True), + 'scope': KeyInfo(), + 'target-scope': KeyInfo(), + }, + ), + ('ip', 'route', 'vrf'): APIData( + fully_understood=True, + primary_keys=('routing-mark', ), + fields={ + 'comment': KeyInfo(can_disable=True, remove_value=''), + 'disabled': KeyInfo(default=False), + 'interfaces': KeyInfo(), + 'routing-mark': KeyInfo(), + }, + ), ('ip', 'dhcp-server'): APIData( fully_understood=True, primary_keys=('name', ), diff --git a/plugins/modules/api_info.py b/plugins/modules/api_info.py index a297d630..8baa4185 100644 --- a/plugins/modules/api_info.py +++ b/plugins/modules/api_info.py @@ -86,6 +86,8 @@ - ip neighbor discovery-settings - ip pool - ip proxy + - ip route + - ip route vrf - ip service - ip settings - ip smb diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index a77fdc14..b657f9f6 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -91,6 +91,8 @@ - ip neighbor discovery-settings - ip pool - ip proxy + - ip route + - ip route vrf - ip service - ip settings - ip smb