From e3748df8ac38d4be150d5ab7ef30305ec05ec962 Mon Sep 17 00:00:00 2001 From: Tomas Herfert Date: Sat, 12 Nov 2022 21:59:08 +0100 Subject: [PATCH 1/4] api path support: system logging action Signed-off-by: Tomas Herfert --- plugins/module_utils/_api_data.py | 36 +++++++++++++++++-------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 17acb293..35877fec 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -2059,24 +2059,28 @@ def join_path(path): }, ), ('system', 'logging', 'action'): APIData( - has_identifier=True, + fully_understood=True, + primary_keys=('name',), fields={ - 'bsd-syslog': KeyInfo(), - 'disk-file-count': KeyInfo(), - 'disk-file-name': KeyInfo(), - 'disk-lines-per-file': KeyInfo(), - 'disk-stop-on-full': KeyInfo(), - 'memory-lines': KeyInfo(), - 'memory-stop-on-full': KeyInfo(), + 'bsd-syslog': KeyInfo(default=False), + 'comment': KeyInfo(can_disable=True, remove_value=''), + 'disk-file-count': KeyInfo(default=2), + 'disk-file-name': KeyInfo(default='log'), + 'disk-lines-per-file': KeyInfo(default=1000), + 'disk-stop-on-full': KeyInfo(default=False), + 'email-start-tls': KeyInfo(default=False), + 'email-to': KeyInfo(default=''), + 'memory-lines': KeyInfo(default=1000), + 'memory-stop-on-full': KeyInfo(default=False), 'name': KeyInfo(), - 'remember': KeyInfo(), - 'remote': KeyInfo(), - 'remote-port': KeyInfo(), - 'src-address': KeyInfo(), - 'syslog-facility': KeyInfo(), - 'syslog-severity': KeyInfo(), - 'syslog-time-format': KeyInfo(), - 'target': KeyInfo(), + 'remember': KeyInfo(default=True), + 'remote': KeyInfo(default='0.0.0.0'), + 'remote-port': KeyInfo(default=514), + 'src-address': KeyInfo(default='0.0.0.0'), + 'syslog-facility': KeyInfo(default='daemon'), + 'syslog-severity': KeyInfo(default='auto'), + 'syslog-time-format': KeyInfo(default='bsd-syslog'), + 'target': KeyInfo(required=True), }, ), ('user', 'group'): APIData( From 4fd37c63a2b020b3fe5520502ef8d85b78ad4dad Mon Sep 17 00:00:00 2001 From: Tomas Herfert Date: Sat, 12 Nov 2022 22:17:05 +0100 Subject: [PATCH 2/4] api path support: system logging Signed-off-by: Tomas Herfert --- plugins/module_utils/_api_data.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 35877fec..5bac5341 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -2152,12 +2152,12 @@ def join_path(path): }, ), ('system', 'logging'): APIData( - has_identifier=True, + fully_understood=True, fields={ - 'action': KeyInfo(), - 'disabled': KeyInfo(), - 'prefix': KeyInfo(), - 'topics': KeyInfo(), + 'action': KeyInfo(default='memory'), + 'disabled': KeyInfo(default=False), + 'prefix': KeyInfo(default=''), + 'topics': KeyInfo(default=''), }, ), ('system', 'resource', 'irq'): APIData( From 8f20faabd6434a34ad624da8c2e966d596323194 Mon Sep 17 00:00:00 2001 From: Tomas Herfert Date: Sat, 12 Nov 2022 22:23:20 +0100 Subject: [PATCH 3/4] docs & changelog Signed-off-by: Tomas Herfert --- changelogs/fragments/127-logging.yml | 3 +++ plugins/modules/api_info.py | 2 ++ plugins/modules/api_modify.py | 2 ++ 3 files changed, 7 insertions(+) create mode 100644 changelogs/fragments/127-logging.yml diff --git a/changelogs/fragments/127-logging.yml b/changelogs/fragments/127-logging.yml new file mode 100644 index 00000000..cc23248f --- /dev/null +++ b/changelogs/fragments/127-logging.yml @@ -0,0 +1,3 @@ +minor_changes: + - api_modify, api_info - support API paths ``system logging``, ``system loggin action`` + (https://github.com/ansible-collections/community.routeros/pull/127). diff --git a/plugins/modules/api_info.py b/plugins/modules/api_info.py index 5820c28d..b8d6aa69 100644 --- a/plugins/modules/api_info.py +++ b/plugins/modules/api_info.py @@ -127,6 +127,8 @@ - system clock manual - system identity - system leds settings + - system logging + - system logging action - system note - system ntp client - system ntp client servers diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index f8dfbdcb..633836b6 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -132,6 +132,8 @@ - system clock manual - system identity - system leds settings + - system logging + - system logging action - system note - system ntp client - system ntp client servers From b1e38348e926b207a1aeae7b22c32b0afff96e9f Mon Sep 17 00:00:00 2001 From: Tomas Herfert Date: Sat, 12 Nov 2022 22:34:00 +0100 Subject: [PATCH 4/4] typo fix Signed-off-by: Tomas Herfert --- changelogs/fragments/127-logging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/fragments/127-logging.yml b/changelogs/fragments/127-logging.yml index cc23248f..59245d2e 100644 --- a/changelogs/fragments/127-logging.yml +++ b/changelogs/fragments/127-logging.yml @@ -1,3 +1,3 @@ minor_changes: - - api_modify, api_info - support API paths ``system logging``, ``system loggin action`` + - api_modify, api_info - support API paths ``system logging``, ``system logging action`` (https://github.com/ansible-collections/community.routeros/pull/127).