Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[yang] syslog yang model #9265

Merged
merged 6 commits into from
Dec 7, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,10 @@
"23.92.29.245": {},
"2001:aa:aa::aa": {}
},
"SYSLOG_SERVER" : {
"10.13.14.17": {},
"20.1.1.1": {}
},
"PORT": {
"Ethernet0": {
"alias": "Eth1/1",
Expand Down
15 changes: 15 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests/syslog.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"SYSLOG_SERVER_TEST": {
"desc": "LOAD SYSLOG SERVER TABLE WITH ADDRESS WITH IPV4, IPV6 AND HOST NAME AS SYSLOG SERVERS."
},
"SYSLOG_SERVER_1_NEG_TEST": {
"desc": "LOAD SYSLOG SERVER TABLE WITH EMPTY ADDRESS AS SYSLOG SERVER.",
"eStrKey": "InvalidValue",
"eStr": ["server_address"]
},
"SYSLOG_SERVER_2_NEG_TEST": {
"desc": "LOAD SYSLOG SERVER TABLE WITH INVALID IP ADDRESS AS SYSLOG SERVER.",
"eStrKey": "InvalidValue",
"eStr": ["server_address"]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"SYSLOG_SERVER_TEST": {
"sonic-syslog:sonic-syslog": {
"sonic-syslog:SYSLOG_SERVER": {
"SYSLOG_SERVER_LIST": [
{
"server_address": "10.11.12.13"
},
{
"server_address": "20.1.1.1"
}
]
}
}
},
"SYSLOG_SERVER_1_NEG_TEST": {
"sonic-syslog:sonic-syslog": {
"sonic-syslog:SYSLOG_SERVER": {
"SYSLOG_SERVER_LIST": [
{
"server_address": ""
}
]
}
}
},
"SYSLOG_SERVER_2_NEG_TEST": {
arlakshm marked this conversation as resolved.
Show resolved Hide resolved
"sonic-syslog:sonic-syslog": {
"sonic-syslog:SYSLOG_SERVER": {
"SYSLOG_SERVER_LIST": [
{
"server_address": "2001:aa:aa:aa"
}
]
}
}
}
}
33 changes: 33 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-syslog.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module sonic-syslog {

yang-version 1.1;

namespace "http://github.com/Azure/sonic-system-syslog";
prefix syslog;

import ietf-inet-types {
prefix inet;
}

container sonic-syslog {

container SYSLOG_SERVER {

description "SYSLOG SERVER part of config_db.json";

list SYSLOG_SERVER_LIST {
max-elements 10;
arlakshm marked this conversation as resolved.
Show resolved Hide resolved
description
"Number of upstream SYSLOG servers, limiting to 10";

key "server_address";

leaf server_address {
description "syslog server ip address";
type inet:host;
}
} /* end of list SYSLOG_SERVER_LIST */

} /* end of container SYSLOG_SERVER */
}
}