diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 4d264417d509..4ebae55c3ea2 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -86,6 +86,7 @@ Table of Contents * [Virtual router](#virtual-router) * [LOGGER](#logger) * [WRED_PROFILE](#wred_profile) + * [XCVRD_LOG](#xcvrd_log) * [PASSWORD_HARDENING](#password_hardening) * [SSH_SERVER](#ssh_server) * [SYSTEM_DEFAULTS table](#systemdefaults-table) diff --git a/src/sonic-yang-models/setup.py b/src/sonic-yang-models/setup.py index 420dd36a24ca..5e130854eeba 100644 --- a/src/sonic-yang-models/setup.py +++ b/src/sonic-yang-models/setup.py @@ -203,6 +203,7 @@ def run(self): './yang-models/sonic-macsec.yang', './yang-models/sonic-bgp-sentinel.yang', './yang-models/sonic-bmp.yang', + './yang-models/sonic-xcvrd-log.yang', './yang-models/sonic-serial-console.yang', './yang-models/sonic-smart-switch.yang',]), ('cvlyang-models', ['./cvlyang-models/sonic-acl.yang', diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 1ed8940f826c..c692571f8c84 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -2703,6 +2703,11 @@ "midplane_interface": "dpu1" } }, + "XCVRD_LOG": { + "Y_CABLE": { + "log_verbosity": "notice" + } + }, "BANNER_MESSAGE": { "global": { "state": "enabled", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/xcvrd-log.json b/src/sonic-yang-models/tests/yang_model_tests/tests/xcvrd-log.json new file mode 100644 index 000000000000..19b85bad5ee5 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/xcvrd-log.json @@ -0,0 +1,5 @@ +{ + "XCVRD_LOG_Y_CABLE_CHANGE_VERBOSITY_LEVEL": { + "desc": "Consume verbosity level config changes. " + } +} diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/xcvrd-log.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/xcvrd-log.json new file mode 100644 index 000000000000..9135a43198b5 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/xcvrd-log.json @@ -0,0 +1,12 @@ +{ + "XCVRD_LOG_Y_CABLE_CHANGE_VERBOSITY_LEVEL": { + "sonic-xcvrd-log:sonic-xcvrd-log": { + "sonic-xcvrd-log:XCVRD_LOG": { + "sonic-xcvrd-log:Y_CABLE": + { + "log_verbosity": "debug" + } + } + } + } +} diff --git a/src/sonic-yang-models/yang-models/sonic-xcvrd-log.yang b/src/sonic-yang-models/yang-models/sonic-xcvrd-log.yang new file mode 100644 index 000000000000..5d7c8866c6ed --- /dev/null +++ b/src/sonic-yang-models/yang-models/sonic-xcvrd-log.yang @@ -0,0 +1,41 @@ +module sonic-xcvrd-log { + namespace "http://github.com/sonic-net/sonic-xcvrd-log"; + prefix xcvrd_log; + yang-version 1.1; + + organization + "SONiC"; + + contact + "SONiC"; + + description + "SONiC DualToR xcvrd logging configuration data"; + + revision 2024-10-14 { + description + "Initial revision"; + } + + container sonic-xcvrd-log { + + container XCVRD_LOG { + + container Y_CABLE { + + leaf log_verbosity { + type enumeration { + enum info; + enum notice; + enum debug; + enum warning; + enum critical; + } + + description "xcvrd log verbosity level. "; + + } + } + } + } +}