[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:
Yevhen Fastiuk 2023-06-07 20:39:24 +03:00 committed by GitHub
parent 6139c525d2
commit 8a6d45227e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 53 additions and 3 deletions

View File

@ -4,7 +4,8 @@
"buffer_model": {% if default_buffer_model == "dynamic" %}"dynamic"{% else %}"traditional"{% endif %},
{%- if include_p4rt == "y" %}"synchronous_mode":"enable",{% 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": {

View File

@ -927,7 +927,8 @@ instance is supported in SONiC.
"bgp_adv_lo_prefix_as_128" : "true",
"buffer_model": "traditional",
"yang_config_validation": "disable",
"rack_mgmt_map": "dummy_value"
"rack_mgmt_map": "dummy_value",
"timezome": "Europe/Kiev"
}
}
}

View File

@ -360,7 +360,8 @@
"dhcp_server": "disabled",
"bgp_adv_lo_prefix_as_128": "true",
"yang_config_validation": "disable",
"rack_mgmt_map": "dummy_value"
"rack_mgmt_map": "dummy_value",
"timezone": "Europe/Kiev"
}
},
"VLAN": {

View File

@ -142,5 +142,12 @@
"DEVICE_METADATA_INVALID_RACK_MGMT_MAP": {
"desc": "Verifying invalid rack_mgmt_map configuration.",
"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"
}
}

View File

@ -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": {
"sonic-device_metadata:sonic-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": ""
}
}
}
}
}

View File

@ -225,6 +225,15 @@ module sonic-device_metadata {
}
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 */
}

View File

@ -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" %}
/* Required for CVL */
container operation {