-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Yang model for SYSTEM_DEFAULTS table (#15129)
Why I did it This PR is to backport PR #11117 into 202205 branch. This PR is to define Yang model for SYSTEM_DEFAULTS table. The table was introduced in PR sonic-net/SONiC#982 The table will be like "SYSTEM_DEFAULTS": { "tunnel_qos_remap": { "status": "enabled" } } Work item tracking Microsoft ADO (https://msazure.visualstudio.com/One/_workitems/edit/23037078) How I did it Add a new yang file sonic-system-defaults. Yang. How to verify it Verified by UT
- Loading branch information
1 parent
3521c29
commit fd59559
Showing
6 changed files
with
108 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/sonic-yang-models/tests/yang_model_tests/tests/system_defaults.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"SYSTEM_DEFAULTS_WITH_CORRECT_VALUES": { | ||
"desc": "CONFIG SYSTEM_DEFAULTS TABLE WITH ALL THE CORRECT VALUES" | ||
}, | ||
"SYSTEM_DEFAULTS_WITH_INVALID_STATUS_VALUE" : { | ||
"desc": "Referring invalid status value", | ||
"eStrKey": "InvalidValue" | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/sonic-yang-models/tests/yang_model_tests/tests_config/system_defaults.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"SYSTEM_DEFAULTS_WITH_CORRECT_VALUES": { | ||
"sonic-system-defaults:sonic-system-defaults": { | ||
"sonic-system-defaults:SYSTEM_DEFAULTS": { | ||
"SYSTEM_DEFAULTS_LIST": [ | ||
{ | ||
"name": "tunnel_qos_remap", | ||
"status": "enabled" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"SYSTEM_DEFAULTS_WITH_INVALID_STATUS_VALUE": { | ||
"sonic-system-defaults:sonic-system-defaults": { | ||
"sonic-system-defaults:SYSTEM_DEFAULTS": { | ||
"SYSTEM_DEFAULTS_LIST": [ | ||
{ | ||
"name": "tunnel_qos_remap", | ||
"status": "invalid_status" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
src/sonic-yang-models/yang-models/sonic-system-defaults.yang
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
module sonic-system-defaults{ | ||
|
||
yang-version 1.1; | ||
|
||
namespace "https://github.com/Azure/system-defaults"; | ||
prefix system-defaults; | ||
|
||
import sonic-types { | ||
prefix stypes; | ||
} | ||
|
||
description "SYSTEM_DEFAULTS Table yang Module for SONiC"; | ||
|
||
container sonic-system-defaults { | ||
|
||
container SYSTEM_DEFAULTS { | ||
|
||
description "system_defaults table in config_db.json"; | ||
|
||
list SYSTEM_DEFAULTS_LIST { | ||
|
||
key "name"; | ||
|
||
leaf name { | ||
description "feature name in SYSTEM_DEFAULTS table"; | ||
type string { | ||
length 1..32; | ||
} | ||
} | ||
|
||
leaf status { | ||
description "default status of the feature"; | ||
type stypes:admin_mode; | ||
} | ||
|
||
} | ||
} | ||
} | ||
} |