[yang] syslog yang model (#9265)
Why I did it Add yang model for syslog server How I did it Add new file sonic-syslog.yang and new files for tests How to verify it Compile target/python-wheels/sonic_yang_mgmt-1.0-py3-none-any.whl Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan arlakshm@microsoft.com
This commit is contained in:
parent
7ebe44a2a0
commit
1509f433fd
@ -114,6 +114,7 @@ setup(
|
||||
'./yang-models/sonic-route-map.yang',
|
||||
'./yang-models/sonic-routing-policy-sets.yang',
|
||||
'./yang-models/sonic-sflow.yang',
|
||||
'./yang-models/sonic-syslog.yang',
|
||||
'./yang-models/sonic-system-aaa.yang',
|
||||
'./yang-models/sonic-system-tacacs.yang',
|
||||
'./yang-models/sonic-types.yang',
|
||||
|
@ -370,6 +370,11 @@
|
||||
"23.92.29.245": {},
|
||||
"2001:aa:aa::aa": {}
|
||||
},
|
||||
"SYSLOG_SERVER" : {
|
||||
"10.13.14.17": {},
|
||||
"20.1.1.1": {},
|
||||
"2001:aa:aa::aa": {}
|
||||
},
|
||||
"PORT": {
|
||||
"Ethernet0": {
|
||||
"alias": "Eth1/1",
|
||||
|
@ -0,0 +1,18 @@
|
||||
{
|
||||
"SYSLOG_SERVER_TEST": {
|
||||
"desc": "Load syslog server table with ipv4 address as syslog servers."
|
||||
},
|
||||
"SYSLOG_SERVER_1_NEG_TEST": {
|
||||
"desc": "Load syslog server table with empty address as syslog server.",
|
||||
"eStrKey": "InvalidValue"
|
||||
},
|
||||
"SYSLOG_SERVER_INVALID_IPADDR_TEST": {
|
||||
"desc": "Load syslog server table with invalid ipv4 address as syslog server.",
|
||||
"eStrKey": "InvalidValue"
|
||||
},
|
||||
"SYSLOG_SERVER_INVALID_IPV6_ADDR_TEST": {
|
||||
"desc": "Load syslog server table with invalid ipv6 address as syslog server.",
|
||||
"eStrKey": "InvalidValue"
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
{
|
||||
"SYSLOG_SERVER_TEST": {
|
||||
"sonic-syslog:sonic-syslog": {
|
||||
"sonic-syslog:SYSLOG_SERVER": {
|
||||
"SYSLOG_SERVER_LIST": [
|
||||
{
|
||||
"server_address": "1111::22"
|
||||
},
|
||||
{
|
||||
"server_address": "20.1.1.1"
|
||||
},
|
||||
{
|
||||
"server_address" : "1001:0ab8:0001:0000:0000:0abc:d012:0102"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"SYSLOG_SERVER_1_NEG_TEST": {
|
||||
"sonic-syslog:sonic-syslog": {
|
||||
"sonic-syslog:SYSLOG_SERVER": {
|
||||
"SYSLOG_SERVER_LIST": [
|
||||
{
|
||||
"server_address": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"SYSLOG_SERVER_INVALID_IPADDR_TEST" : {
|
||||
"sonic-syslog:sonic-syslog": {
|
||||
"sonic-syslog:SYSLOG_SERVER": {
|
||||
"SYSLOG_SERVER_LIST": [
|
||||
{
|
||||
"server_address": "1111.22.33.1"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"SYSLOG_SERVER_INVALID_IPV6_ADDR_TEST" : {
|
||||
"sonic-syslog:sonic-syslog": {
|
||||
"sonic-syslog:SYSLOG_SERVER": {
|
||||
"SYSLOG_SERVER_LIST": [
|
||||
{
|
||||
"server_address": "1111::22.33.1"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
30
src/sonic-yang-models/yang-models/sonic-syslog.yang
Normal file
30
src/sonic-yang-models/yang-models/sonic-syslog.yang
Normal file
@ -0,0 +1,30 @@
|
||||
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 {
|
||||
|
||||
key "server_address";
|
||||
|
||||
leaf server_address {
|
||||
description "syslog server ip address";
|
||||
type inet:ip-address;
|
||||
}
|
||||
} /* end of list SYSLOG_SERVER_LIST */
|
||||
|
||||
} /* end of container SYSLOG_SERVER */
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user