From c2e58c3ae47630a1d3df2dd77cf71cdc275e39bd Mon Sep 17 00:00:00 2001 From: Tomas Herfert <68421396+therfert@users.noreply.github.com> Date: Wed, 9 Nov 2022 21:10:25 +0100 Subject: [PATCH] Interface list (#120) * interface list & member Signed-off-by: Tomas Herfert * adding changelog fragment Signed-off-by: Tomas Herfert * changelog fix Signed-off-by: Tomas Herfert * sanity fix Signed-off-by: Tomas Herfert * Apply suggestions from code review Co-authored-by: Felix Fontein Signed-off-by: Tomas Herfert Co-authored-by: Tomas Herfert Co-authored-by: Felix Fontein --- changelogs/fragments/120-api.yml | 3 +++ plugins/module_utils/_api_data.py | 11 +++++++++++ plugins/modules/api_info.py | 2 ++ plugins/modules/api_modify.py | 2 ++ 4 files changed, 18 insertions(+) create mode 100644 changelogs/fragments/120-api.yml diff --git a/changelogs/fragments/120-api.yml b/changelogs/fragments/120-api.yml new file mode 100644 index 00000000..61fbe3b7 --- /dev/null +++ b/changelogs/fragments/120-api.yml @@ -0,0 +1,3 @@ +minor_changes: + - api_modify, api_info - support API paths ``interface list`` and ``interface list member`` + (https://github.com/ansible-collections/community.routeros/pull/120). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index fc23127f..5ba3e26d 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -132,6 +132,7 @@ def join_path(path): ), ('interface', 'list'): APIData( primary_keys=('name', ), + fully_understood=True, fields={ 'comment': KeyInfo(can_disable=True, remove_value=''), 'exclude': KeyInfo(), @@ -139,6 +140,16 @@ def join_path(path): 'name': KeyInfo(), }, ), + ('interface', 'list', 'member'): APIData( + primary_keys=('list', 'interface', ), + fully_understood=True, + fields={ + 'comment': KeyInfo(can_disable=True, remove_value=''), + 'interface': KeyInfo(), + 'list': KeyInfo(), + 'disabled': KeyInfo(default=False), + }, + ), ('interface', 'lte', 'apn'): APIData( unknown_mechanism=True, # primary_keys=('default', ), diff --git a/plugins/modules/api_info.py b/plugins/modules/api_info.py index bf1b23f8..b7db4659 100644 --- a/plugins/modules/api_info.py +++ b/plugins/modules/api_info.py @@ -53,6 +53,8 @@ - interface ethernet switch - interface ethernet switch port - interface l2tp-server server + - interface list + - interface list member - interface ovpn-server server - interface pptp-server server - interface sstp-server server diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index 9e73c91f..5b3fc15a 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -58,6 +58,8 @@ - interface ethernet switch - interface ethernet switch port - interface l2tp-server server + - interface list + - interface list member - interface ovpn-server server - interface pptp-server server - interface sstp-server server