Skip to content
Ask AI

time-range

AsterNOS YANG Model for Aster NOS Time Range.

Define a period of time, which is in absolute or cyclic type.

module: asternos-time-range
+--rw time-ranges
+--rw time-range* [name]
+--rw name string
+--rw (absolute-cyclic)?
+--:(absolute-range)
| +--rw start-date-time? yang:date-and-time
| +--rw end-date-time? yang:date-and-time
+--:(cyclic-range)
+--rw days-in-week? bits
+--rw start? time-hhmm
+--rw end? time-hhmm
PathAccess
/time-rangesRead-Write
/time-ranges/time-rangeRead-Write
/time-ranges/time-range/nameRead-Write
/time-ranges/time-range/absolute-cyclicRead-Write
/time-ranges/time-range/absolute-cyclic/absolute-rangeRead-Write
/time-ranges/time-range/absolute-cyclic/absolute-range/start-date-timeRead-Write
/time-ranges/time-range/absolute-cyclic/absolute-range/end-date-timeRead-Write
/time-ranges/time-range/absolute-cyclic/cyclic-rangeRead-Write
/time-ranges/time-range/absolute-cyclic/cyclic-range/days-in-weekRead-Write
/time-ranges/time-range/absolute-cyclic/cyclic-range/startRead-Write
/time-ranges/time-range/absolute-cyclic/cyclic-range/endRead-Write

Path

/time-ranges

Node Type

container

Access

Read-Write

Path

/time-ranges/time-range

Node Type

list

Description

The time-range instances.

Access

Read-Write

Path

/time-ranges/time-range/name

Node Type

leaf

Description

The name of time range instance.

Access

Read-Write

Data Type

Path

/time-ranges/time-range/absolute-cyclic

Node Type

choice

Description

There are two kinds of tima range: the absolute time range and cyclic time range.

Once days-in-week is used, it treated as the cyclic-range.

Access

Read-Write

/time-ranges/time-range/absolute-cyclic/absolute-range

Section titled “/time-ranges/time-range/absolute-cyclic/absolute-range”

Path

/time-ranges/time-range/absolute-cyclic/absolute-range

Node Type

choice-case

Description

The absolute time.

The end time must be later than the start time.

Access

Read-Write

/time-ranges/time-range/absolute-cyclic/absolute-range/start-date-time

Section titled “/time-ranges/time-range/absolute-cyclic/absolute-range/start-date-time”

Path

/time-ranges/time-range/absolute-cyclic/absolute-range/start-date-time

Node Type

leaf

Description

The start date and time.

The format can be two types:

1.2023-10-05T14:48:30.123+08:00, it means 14:48:30.123 on October 5, 2023, East 8th District time.

2.2023-10-05T14:48:00Z, it means 14:48:00 on October 5, 2023, UTC time.

Limitation: second, microsecond and timezone is not supported.

Access

Read-Write

Data Type

Constraints

The date-and-time type is a profile of the ISO 8601 standard for representation of dates and times using the

Gregorian calendar. The profile is defined by the date-time production in Section 5.6 of RFC 3339.

The date-and-time type is compatible with the dateTime XML schema type with the following notable exceptions:

(a) The date-and-time type does not allow negative years.

(b) The date-and-time time-offset -00:00 indicates an unknown time zone (see RFC 3339) while -00:00 and +00:00 and Z all represent the same time zone in dateTime.

(c) The canonical format (see below) of data-and-time values differs from the canonical format used by the dateTime XML schema type, which requires all times to be in UTC using the time-offset ‘Z’.

This type is not equivalent to the DateAndTime textual convention of the SMIv2 since RFC 3339 uses a different separator between full-date and full-time and provides higher resolution of time-secfrac.

The canonical format for date-and-time values with a known time zone uses a numeric time zone offset that is calculated using the device’s configured known offset to UTC time. A change of the device’s offset to UTC time will cause date-and-time values to change accordingly. Such changes might happen periodically in case a server follows automatically daylight saving time (DST) time zone offset changes. The canonical format for date-and-time values with an unknown time zone (usually referring to the notion of local time) uses the time-offset

-00:00.

/time-ranges/time-range/absolute-cyclic/absolute-range/end-date-time

Section titled “/time-ranges/time-range/absolute-cyclic/absolute-range/end-date-time”

Path

/time-ranges/time-range/absolute-cyclic/absolute-range/end-date-time

Node Type

leaf

Description

The end date and time, same as the description in start-date-time

Access

Read-Write

Data Type

Constraints

The date-and-time type is a profile of the ISO 8601 standard for representation of dates and times using the

Gregorian calendar. The profile is defined by the date-time production in Section 5.6 of RFC 3339.

The date-and-time type is compatible with the dateTime XML schema type with the following notable exceptions:

(a) The date-and-time type does not allow negative years.

(b) The date-and-time time-offset -00:00 indicates an unknown time zone (see RFC 3339) while -00:00 and +00:00 and Z all represent the same time zone in dateTime.

(c) The canonical format (see below) of data-and-time values differs from the canonical format used by the dateTime XML schema type, which requires all times to be in UTC using the time-offset ‘Z’.

This type is not equivalent to the DateAndTime textual convention of the SMIv2 since RFC 3339 uses a different separator between full-date and full-time and provides higher resolution of time-secfrac.

The canonical format for date-and-time values with a known time zone uses a numeric time zone offset that is calculated using the device’s configured known offset to UTC time. A change of the device’s offset to UTC time will cause date-and-time values to change accordingly. Such changes might happen periodically in case a server follows automatically daylight saving time (DST) time zone offset changes. The canonical format for date-and-time values with an unknown time zone (usually referring to the notion of local time) uses the time-offset

-00:00.

/time-ranges/time-range/absolute-cyclic/cyclic-range

Section titled “/time-ranges/time-range/absolute-cyclic/cyclic-range”

Path

/time-ranges/time-range/absolute-cyclic/cyclic-range

Node Type

choice-case

Description

The cyclic time range for days in every week.

Access

Read-Write

/time-ranges/time-range/absolute-cyclic/cyclic-range/days-in-week

Section titled “/time-ranges/time-range/absolute-cyclic/cyclic-range/days-in-week”

Path

/time-ranges/time-range/absolute-cyclic/cyclic-range/days-in-week

Node Type

leaf

Description

A set of days-in-week flags, multiple inputs should be separated by spaces

Access

Read-Write

Data Type

Constraints

Bit type with defined bits: [sunday,monday,tuesday,wednesday,thursday,friday,saturday]

/time-ranges/time-range/absolute-cyclic/cyclic-range/start

Section titled “/time-ranges/time-range/absolute-cyclic/cyclic-range/start”

Path

/time-ranges/time-range/absolute-cyclic/cyclic-range/start

Node Type

leaf

Description

The start time of a day.

Access

Read-Write

Data Type

Constraints

Multiple constraints:

  • String with length: 3 to 5
  • Time string with format ‘hh:mm’. ‘hh’ is hour, ‘mm’ is minute. Its range is from 00:00 to 23:59.

/time-ranges/time-range/absolute-cyclic/cyclic-range/end

Section titled “/time-ranges/time-range/absolute-cyclic/cyclic-range/end”

Path

/time-ranges/time-range/absolute-cyclic/cyclic-range/end

Node Type

leaf

Description

The end time of a day.

Access

Read-Write

Data Type

Constraints

Multiple constraints:

  • String with length: 3 to 5
  • Time string with format ‘hh:mm’. ‘hh’ is hour, ‘mm’ is minute. Its range is from 00:00 to 23:59.