f4a9f7edaa
- Why I did it An issue is encountered when a value "False" is written for a feature in "check_up_status" field, which does not pass YANG validation. - How I did it We usually use stypes::boolean_type for such fields, even in this YANG model. This custom type, supports "False" value. - How to verify it Write "False" in "check_up_status" field and see if YANG validation passes. Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
100 lines
2.9 KiB
YANG
100 lines
2.9 KiB
YANG
module sonic-feature{
|
|
|
|
yang-version 1.1;
|
|
|
|
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;
|
|
}
|
|
|
|
typedef feature-owner {
|
|
description "configuration to set if the container is controlled
|
|
by kubernetes or locally";
|
|
type string {
|
|
pattern "kube|local";
|
|
}
|
|
}
|
|
|
|
container sonic-feature {
|
|
|
|
container FEATURE {
|
|
|
|
description "feature table in config_db.json";
|
|
|
|
list FEATURE_LIST {
|
|
|
|
key "name";
|
|
|
|
leaf name {
|
|
description "feature name in Feature table";
|
|
type string {
|
|
length 1..32;
|
|
}
|
|
}
|
|
|
|
leaf state {
|
|
description "state of the feature";
|
|
type feature-state;
|
|
default "enabled";
|
|
}
|
|
|
|
leaf auto_restart {
|
|
type feature-state;
|
|
default "enabled";
|
|
}
|
|
|
|
leaf has_timer {
|
|
description "This configuration identicates if there is
|
|
timer associated to this feature";
|
|
type stypes:boolean_type;
|
|
default "false";
|
|
}
|
|
|
|
leaf has_global_scope {
|
|
description "This configuration identicates there will only one service
|
|
spawned for the device";
|
|
type stypes:boolean_type;
|
|
default "false";
|
|
}
|
|
|
|
leaf has_per_asic_scope {
|
|
description "This configuration identicates there will only one service
|
|
spawned per asic";
|
|
type stypes:boolean_type;
|
|
default "false";
|
|
}
|
|
|
|
leaf high_mem_alert {
|
|
description "This configuration controls the trigger to generate
|
|
alert on high memory utilization";
|
|
type feature-state;
|
|
default "disabled";
|
|
}
|
|
|
|
leaf set_owner {
|
|
description " This configuration set the feature owner is
|
|
kubernetes or local";
|
|
type feature-owner;
|
|
default "local";
|
|
}
|
|
|
|
leaf check_up_status {
|
|
description "This configuration controls the system ready tool to check
|
|
the app ready/up status";
|
|
type stypes:boolean_type;
|
|
default "false";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|