[yang] add set_owner to feature yang (#9075)

#### Why I did it
Add the configuration for the set_owner in the `feature` yang model

#### How I did it
Add new leaf `set_pwner` to the `feature` yang model

#### How to verify it
compile `sonic_yang_mgmt-1.0-py3-none-any.whl`
This commit is contained in:
arlakshm 2021-12-09 23:18:45 -08:00 committed by Judy Joseph
parent a56ecd711d
commit 4e7550e2bd
5 changed files with 89 additions and 23 deletions

View File

@ -1211,7 +1211,8 @@
"has_per_asic_scope": "true",
"has_timer": "false",
"high_mem_alert": "disabled",
"state": "enabled"
"state": "enabled",
"set_owner": "local"
},
"database": {
"auto_restart": "always_enabled",
@ -1219,7 +1220,8 @@
"has_per_asic_scope": "true",
"has_timer": "false",
"high_mem_alert": "disabled",
"state": "always_enabled"
"state": "always_enabled",
"set_owner": "local"
},
"snmp": {
"auto_restart": "enabled",
@ -1227,7 +1229,8 @@
"has_per_asic_scope": "false",
"has_timer": "true",
"high_mem_alert": "disabled",
"state": "enabled"
"state": "enabled",
"set_owner": "kube"
},
"swss": {
"auto_restart": "enabled",
@ -1235,7 +1238,8 @@
"has_per_asic_scope": "true",
"has_timer": "false",
"high_mem_alert": "disabled",
"state": "enabled"
"state": "enabled",
"set_owner": "local"
},
"syncd": {
"auto_restart": "enabled",
@ -1243,7 +1247,8 @@
"has_per_asic_scope": "true",
"has_timer": "false",
"high_mem_alert": "disabled",
"state": "enabled"
"state": "enabled",
"set_owner": "local"
},
"lldp": {
"auto_restart": "enabled",
@ -1251,7 +1256,8 @@
"has_per_asic_scope": "true",
"has_timer": "false",
"high_mem_alert": "disabled",
"state": "enabled"
"state": "enabled",
"set_owner": "kube"
}
},
"DHCP_RELAY": {

View File

@ -5,6 +5,14 @@
"FEATURE_WITH_INVALID_STATE" : {
"desc": "Referring invalid feature state.",
"eStrKey": "Pattern",
"eStr": ["enabled|disabled|always_enabled"]
"eStr": ["enabled|disabled|always_enabled|always_disabled"]
},
"FEATURE_WITH_INVALID_OWNER" : {
"desc": "Referring invalid feature set_owner field.",
"eStrKey": "Pattern",
"eStr": ["kube|local"]
},
"FEATURE_WITH_NO_OWNER" : {
"desc": "Config feature table without set_owner"
}
}

View File

@ -9,7 +9,8 @@
"auto_restart": "always_enabled",
"has_timer": "false",
"has_global_scope": "true",
"has_per_asic_scope": "true"
"has_per_asic_scope": "true",
"set_owner": "local"
},
{
"name": "swss",
@ -17,7 +18,8 @@
"auto_restart": "always_enabled",
"has_timer": "false",
"has_global_scope": "false",
"has_per_asic_scope": "true"
"has_per_asic_scope": "true",
"set_owner": "local"
},
{
"name": "syncd",
@ -25,7 +27,8 @@
"auto_restart": "always_enabled",
"has_timer": "false",
"has_global_scope": "false",
"has_per_asic_scope": "true"
"has_per_asic_scope": "true",
"set_owner": "local"
},
{
"name": "snmp",
@ -33,7 +36,8 @@
"auto_restart": "enabled",
"has_timer": "false",
"has_global_scope": "true",
"has_per_asic_scope": "false"
"has_per_asic_scope": "false",
"set_owner": "kube"
},
{
"name": "lldp",
@ -41,7 +45,8 @@
"auto_restart": "disabled",
"has_timer": "false",
"has_global_scope": "false",
"has_per_asic_scope": "true"
"has_per_asic_scope": "true",
"set_owner": "kube"
}
]
}
@ -57,6 +62,40 @@
"auto_restart": "always_enabled",
"has_timer": "false",
"has_global_scope": "true",
"has_per_asic_scope": "true",
"set_owner": "local"
}
]
}
}
},
"FEATURE_WITH_INVALID_OWNER": {
"sonic-feature:sonic-feature": {
"sonic-feature:FEATURE": {
"FEATURE_LIST": [
{
"name": "lldp",
"state": "disabled",
"auto_restart": "disabled",
"has_timer": "false",
"has_global_scope": "false",
"has_per_asic_scope": "true",
"set_owner": "invalid"
}
]
}
}
},
"FEATURE_WITH_NO_OWNER": {
"sonic-feature:sonic-feature": {
"sonic-feature:FEATURE": {
"FEATURE_LIST": [
{
"name": "lldp",
"state": "disabled",
"auto_restart": "disabled",
"has_timer": "false",
"has_global_scope": "false",
"has_per_asic_scope": "true"
}
]

View File

@ -5,11 +5,22 @@ module sonic-feature{
namespace "http://github.com/Azure/sonic-feature";
prefix feature;
import sonic-types {
prefix stypes;
description "Feature Table yang Module for SONiC";
typedef feature-state {
description "configuration to set the feature running state";
type string {
pattern "enabled|disabled|always_enabled|always_disabled";
}
}
description "Feature Table yang Module for SONiC OS";
typedef feature-owner {
description "configuration to set if the container is controlled
by kubernetes or locally";
type string {
pattern "kube|local";
}
}
container sonic-feature {
@ -30,12 +41,12 @@ module sonic-feature{
leaf state {
description "state of the feature";
type stypes:feature_state;
type feature-state;
default "enabled";
}
leaf auto_restart {
type stypes:feature_state;
type feature-state;
default "enabled";
}
@ -63,9 +74,16 @@ module sonic-feature{
leaf high_mem_alert {
description "This configuration controls the trigger to generate
alert on high memory utilization";
type stypes:feature_state;
type feature-state;
default "disabled";
}
leaf set_owner {
description " This configuration set the feature owner is
kubernetes or local";
type feature-owner;
default "local";
}
}
}
}

View File

@ -197,11 +197,6 @@ module sonic-types {
}
}
typedef feature_state {
type string {
pattern "enabled|disabled|always_enabled";
}
}
typedef meter_type {
type enumeration {
enum packets;