[Clock] Add timezone config YANG model (#14651)
* Add the ability to configure timezone Signed-off-by: Yevhen Fastiuk <yfastiuk@nvidia.com> * Add YANG model for timezone Signed-off-by: Yevhen Fastiuk <yfastiuk@nvidia.com> * Add timezone reference Signed-off-by: Yevhen Fastiuk <yfastiuk@nvidia.com> --------- Signed-off-by: Yevhen Fastiuk <yfastiuk@nvidia.com>
This commit is contained in:
parent
6139c525d2
commit
8a6d45227e
@ -4,7 +4,8 @@
|
|||||||
"buffer_model": {% if default_buffer_model == "dynamic" %}"dynamic"{% else %}"traditional"{% endif %},
|
"buffer_model": {% if default_buffer_model == "dynamic" %}"dynamic"{% else %}"traditional"{% endif %},
|
||||||
{%- if include_p4rt == "y" %}"synchronous_mode":"enable",{% endif %}
|
{%- if include_p4rt == "y" %}"synchronous_mode":"enable",{% endif %}
|
||||||
"default_bgp_status": {% if shutdown_bgp_on_start == "y" %}"down"{% else %}"up"{% endif %},
|
"default_bgp_status": {% if shutdown_bgp_on_start == "y" %}"down"{% else %}"up"{% endif %},
|
||||||
"default_pfcwd_status": {% if enable_pfcwd_on_start == "y" %}"enable"{% else %}"disable"{% endif %}
|
"default_pfcwd_status": {% if enable_pfcwd_on_start == "y" %}"enable"{% else %}"disable"{% endif %},
|
||||||
|
"timezone": "UTC"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"CRM": {
|
"CRM": {
|
||||||
|
@ -927,7 +927,8 @@ instance is supported in SONiC.
|
|||||||
"bgp_adv_lo_prefix_as_128" : "true",
|
"bgp_adv_lo_prefix_as_128" : "true",
|
||||||
"buffer_model": "traditional",
|
"buffer_model": "traditional",
|
||||||
"yang_config_validation": "disable",
|
"yang_config_validation": "disable",
|
||||||
"rack_mgmt_map": "dummy_value"
|
"rack_mgmt_map": "dummy_value",
|
||||||
|
"timezome": "Europe/Kiev"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -360,7 +360,8 @@
|
|||||||
"dhcp_server": "disabled",
|
"dhcp_server": "disabled",
|
||||||
"bgp_adv_lo_prefix_as_128": "true",
|
"bgp_adv_lo_prefix_as_128": "true",
|
||||||
"yang_config_validation": "disable",
|
"yang_config_validation": "disable",
|
||||||
"rack_mgmt_map": "dummy_value"
|
"rack_mgmt_map": "dummy_value",
|
||||||
|
"timezone": "Europe/Kiev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"VLAN": {
|
"VLAN": {
|
||||||
|
@ -142,5 +142,12 @@
|
|||||||
"DEVICE_METADATA_INVALID_RACK_MGMT_MAP": {
|
"DEVICE_METADATA_INVALID_RACK_MGMT_MAP": {
|
||||||
"desc": "Verifying invalid rack_mgmt_map configuration.",
|
"desc": "Verifying invalid rack_mgmt_map configuration.",
|
||||||
"eStr": "Invalid length for the rack mgmt map."
|
"eStr": "Invalid length for the rack mgmt map."
|
||||||
|
},
|
||||||
|
"DEVICE_METADATA_VALID_TIMEZONE": {
|
||||||
|
"desc": "Verifying valid timezone value"
|
||||||
|
},
|
||||||
|
"DEVICE_METADATA_INVALID_TIMEZONE": {
|
||||||
|
"desc": "Verifying invalid timezone value",
|
||||||
|
"eStrKey": "Range"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -372,6 +372,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"DEVICE_METADATA_VALID_TIMEZONE": {
|
||||||
|
"sonic-device_metadata:sonic-device_metadata": {
|
||||||
|
"sonic-device_metadata:DEVICE_METADATA": {
|
||||||
|
"sonic-device_metadata:localhost": {
|
||||||
|
"timezone": "UTC"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"DEVICE_METADATA_INVALID_RACK_MGMT_MAP": {
|
"DEVICE_METADATA_INVALID_RACK_MGMT_MAP": {
|
||||||
"sonic-device_metadata:sonic-device_metadata": {
|
"sonic-device_metadata:sonic-device_metadata": {
|
||||||
"sonic-device_metadata:DEVICE_METADATA": {
|
"sonic-device_metadata:DEVICE_METADATA": {
|
||||||
@ -380,5 +389,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"DEVICE_METADATA_INVALID_TIMEZONE": {
|
||||||
|
"sonic-device_metadata:sonic-device_metadata": {
|
||||||
|
"sonic-device_metadata:DEVICE_METADATA": {
|
||||||
|
"sonic-device_metadata:localhost": {
|
||||||
|
"timezone": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -225,6 +225,15 @@ module sonic-device_metadata {
|
|||||||
}
|
}
|
||||||
description "Information of rack mgmt map.";
|
description "Information of rack mgmt map.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
leaf timezone {
|
||||||
|
type stypes:timezone-name-type {
|
||||||
|
length 1..255;
|
||||||
|
}
|
||||||
|
default "UTC";
|
||||||
|
description "The TZ database name to use for the system, such as 'Europe/Stockholm'.";
|
||||||
|
reference "IANA Time Zone Database http://www.iana.org/time-zones";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* end of container localhost */
|
/* end of container localhost */
|
||||||
}
|
}
|
||||||
|
@ -334,6 +334,19 @@ module sonic-types {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typedef timezone-name-type {
|
||||||
|
type string;
|
||||||
|
description
|
||||||
|
"A time zone name as used by the Time Zone Database,
|
||||||
|
sometimes referred to as the 'Olson Database'.
|
||||||
|
|
||||||
|
The exact set of valid values is an implementation-specific
|
||||||
|
matter. Client discovery of the exact set of time zone names
|
||||||
|
for a particular server is out of scope.";
|
||||||
|
reference
|
||||||
|
"BCP 175: Procedures for Maintaining the Time Zone Database";
|
||||||
|
}
|
||||||
|
|
||||||
{% if yang_model_type == "cvl" %}
|
{% if yang_model_type == "cvl" %}
|
||||||
/* Required for CVL */
|
/* Required for CVL */
|
||||||
container operation {
|
container operation {
|
||||||
|
Reference in New Issue
Block a user