-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 (#11117)
* Add Yang model for SYSTEM_DEFAULTS table Signed-off-by: bingwang <wang.bing@microsoft.com>
- Loading branch information
1 parent
8fb534e
commit 201ae28
Showing
6 changed files
with
110 additions
and
3 deletions.
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 "http://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; | ||
} | ||
|
||
} | ||
} | ||
} | ||
} |