sonic-buildimage/src/sonic-yang-models/yang-models/sonic-tc-queue-map.yang
ohu1 459d3d1f55
SONiC QoS MAPs and PORT_QOS_MAP Yang (#7375)
Why I did it
Created SONiC Yang model for the following QOS MAPs and PORT QOS MAP:
DSCP_TO_TC_MAP
DOT1P_TO_TC_MAP
TC_TO_QUEUE_MAP
TC_TO_PRIORITY_GROUP_MAP
MAP_PFC_PRIORITY_TO_QUEUE
PORT_QOS_MAP

How I did it
Defined Yang models for QOS MAPs based on Guideline doc:
https://github.com/Azure/SONiC/blob/master/doc/mgmt/SONiC_YANG_Model_Guidelines.md
and
https://github.com/Azure/sonic-utilities/blob/master/doc/Command-Reference.md

How to verify it
sonic_yang_models package build
The infra code was modified to handle the nested list definition in YANG and translate it to a flat list in DB.
2021-10-19 12:50:07 -07:00

69 lines
1.7 KiB
YANG

module sonic-tc-queue-map {
yang-version 1.1;
namespace "http://github.com/Azure/sonic-tc-queue-map";
prefix tqm;
organization
"SONiC";
contact
"SONiC";
description
"TC_TO_QUEUE_MAP yang Module for SONiC OS";
revision 2021-04-15 {
description
"Initial revision.";
}
container sonic-tc-queue-map {
container TC_TO_QUEUE_MAP {
description "TC_TO_QUEUE_MAP part of config_db.json";
list TC_TO_QUEUE_MAP_LIST {
key "name";
leaf name {
type string {
pattern '[a-zA-Z0-9]{1}([-a-zA-Z0-9_]{0,31})';
length 1..32 {
error-message "Invalid length for map name.";
error-app-tag map-name-invalid-length;
}
}
}
list TC_TO_QUEUE_MAP { //this is list inside list for storing mapping between two fields
key "tc";
leaf tc {
type string {
pattern "[0-7]?" {
error-message "Invalid Traffic Class";
error-app-tag tc-invalid;
}
}
}
leaf qindex {
type string {
pattern "[0-7]?" {
error-message "Invalid queue index";
error-app-tag queue-index-invalid;
}
}
}
}
}
}
}
}