Internet-Draft | schedule YANG | October 2023 |
Ma, et al. | Expires 22 April 2024 | [Page] |
This document defines a common schedule YANG module which is designed to be applicable for scheduling information such as event, policy, services, or resources based on date and time.¶
This note is to be removed before publishing as an RFC.¶
Discussion of this document takes place on the Operations and Management Area Working Group Working Group mailing list (opsawg@ietf.org), which is archived at https://mailarchive.ietf.org/arch/browse/opsawg/.¶
Source for this draft and an issue tracker can be found at https://github.com/boucadair/policy-based-network-acl.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 22 April 2024.¶
Copyright (c) 2023 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
Several specifications include a provision for scheduling. Examples of such specifications are [I-D.ietf-opsawg-ucl-acl], [I-D.contreras-opsawg-scheduling-oam-tests], and [I-D.united-tvr-schedule-yang]. Both [I-D.ietf-opsawg-ucl-acl] and [I-D.contreras-opsawg-scheduling-oam-tests] use the "ietf-schedule" module initially specified in [I-D.ietf-opsawg-ucl-acl].¶
Given that the applicability of the "ietf-schedule" module is more general than scheduled policy and OAMs, this document defines "ietf-schedule" as a common schedule YANG module. The module includes a set of reusable groupings which are designed to be applicable for scheduling information such as event, policy, services or resources based on date and time.¶
Note to the RFC Editor: This section is to be removed prior to publication.¶
This document contains placeholder values that need to be replaced with finalized values at the time of publication. This note summarizes all of the substitutions that are needed. No other RFC Editor instructions are specified elsewhere in this document.¶
Please apply the following replacements:¶
XXXX --> the assigned RFC number for this draft¶
YYYY --> the assigned RFC number for [I-D.ietf-netmod-rfc6991-bis]¶
2023-01-19 --> the actual date of the publication of this document¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
The meanings of the symbols in tree diagrams are defined in [RFC8340].¶
Also, this document uses the YANG terminology defined in Section 3 of [RFC7950].¶
This module defines two groupings "period" and "recurrence", which conform to the definition of the "period of time" and "recurrence rule" formats defined in [RFC5545]. Other formats may be considered in future revisions.¶
Figure 1 provides an overview of the tree structure of the "ietf- schedule" module in terms of its groupings.¶
The "period-of-time" allows a time period to be represented using either a start ("period-start") and end date and time ("period-end"), or a start ("period-start") and a positive time duration ("period-duration").¶
The "recurrence" indicates the scheduling recurrence of an event. The repetition can be scoped by a specified end time or by a count of occurences, and the frequency identifies the type of recurrence rule. For example, a "daily" frequency value specifies repeating events based on an interval of a day or more. The interval represents at which intervals the recurrence rule repeats. For example, within a daily recurrence rule, an interval value of "8" means every eight days.¶
An array of the "bysecond" (or "byminut", "byhour") specifies a list of seconds within a minute (or minutes within an hour, hours of the day).¶
The parameter "byday" specifies a list of days of the week, with an optional direction which indicates the nth occurrence of a specific day within the "monthly" or "yearly" frequency. For example, within a "monthly" rule, the "weekday" with a value of "monday" and the "direction" with a value of "-1" represents the last Monday of the month.¶
An array of the "bymonthday" (or byyearday", "byyearweek", or "byyearmonth") specifies a list of days of the month (or days of the year, weeks of the year, or months of the year).¶
The "bysetpos" conveys a list of values that corresponds to the nth occurrence within the set of recurrence instances to be specified. For example, in a "monthly" recurrence rule, the "byday" data node specifies every Monday of the week, the "bysetpos" with value of "-1" represents the last Monday of the month. Not setting the "bysetpos" data node represents every Monday of the month.¶
The "wkst" data node specifies the day on which the week starts. This is significant when a "weekly" recurrence rule has an interval greater than 1, and a "byday" data node is specified. This is also significant when in a "yearly" rule and a "byyearweek" is specified. The default value is "monday".¶
The following subsections provide some examples to illustrate the use of the period and recurrence formats defined as YANG groupings. Only the message body is provided with JSON used for encoding [RFC7951].¶
The example of a period that starts at 08:00:00 UTC, on January 1, 2023 and ends at 18:00:00 UTC on December 31, 2025 is encoded as follows:¶
{ "period-of-time": { "period-start": "2023-01-01T08:00:00Z", "period-end": "2025-12-01T18:00:00Z" } }¶
An example of a period that starts at 08:00:00 UTC, on January 1, 2023 and lasts 15 days and 5 hours and 20 minutes is encoded as follows:¶
{ "period-of-time": { "period-start": "2023-01-01T08:00:00Z", "period-duration": "P15DT05:20:00" } }¶
Now, consider the example of a period that starts at 08:00:00 UTC, on January 1, 2023 and lasts 20 weeks:¶
{ "period-of-time": { "period-start": "2023-01-01T08:00:00Z", "period-duration": "P20W" } }¶
The following snippet can be used to indicate a daily recurrent in December:¶
{ "recurrence": { "freq": "daily", "byyearmonth": [12] } }¶
The following snippet can be used to indicate 10 occurrences that occur every last Saturday of the month:¶
{ "recurrence": { "freq": "monthly", "count": 10, "byday": [ { "direction": [-1], "weekday": "saturday" } ] } }¶
The following indicates the example of a recurrence that occurs on the last workday of the month until December 25, 2023:¶
{ "recurrence": { "freq": "monthly", "until": "2023-12-25", "byday": [ { "weekday": "monday" }, { "weekday": "tuesday" }, { "weekday": "wednesday" }, { "weekday": "thursday" }, { "weekday": "friday" } ], "bysetpos": [-1] } }¶
The following depicts the example of a recurrence that occurs every other week on Tuesday and Sunday, the week starts from Monday:¶
{ "recurrence": { "freq": "weekly", "interval": 2, "byday": [ { "weekday": "tuesday" }, { "weekday": "sunday" } ], "wkst": "monday" } }¶
This module imports types defined in [I-D.ietf-netmod-rfc6991-bis].¶
<CODE BEGINS> file "ietf-schedule@2023-01-19.yang" module ietf-schedule { yang-version 1.1; namespace "urn:ietf:params:xml:ns:yang:ietf-schedule"; prefix schedule; import ietf-yang-types { prefix yang; revision-date 2023-01-23; reference "RFC YYYY: Common YANG Data Types"; } organization "IETF OPSAWG Working Group"; contact "WG Web: <https://datatracker.ietf.org/wg/opsawg/> WG List: <mailto:opsawg@ietf.org>"; description "This YANG module defines two groupings for iCalendar (Internet Calendaring and Scheduling Core Object Specification) data types: period of time and recurrence rule, for representing and exchanging calendaring and scheduling information. The YANG module complies with Sections 3.3.9 and 3.3.10 of RFC 5545. Copyright (c) 2023 IETF Trust and the persons identified as authors of the code. All rights reserved. Redistribution and use in source and binary forms, with or without modification, is permitted pursuant to, and subject to the license terms contained in, the Revised BSD License set forth in Section 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info). This version of this YANG module is part of RFC XXXX (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself for full legal notices."; revision 2023-01-19 { description "Initial revision."; reference "RFC XXXX: A Policy-based Network Access Control"; } typedef weekday { type enumeration { enum sunday { value 0; description "Sunday of the week."; } enum monday { value 1; description "Monday of the week."; } enum tuesday { value 2; description "Tuesday of the week."; } enum wednesday { value 3; description "Wednesday of the week."; } enum thursday { value 4; description "Thursday of the week."; } enum friday { value 5; description "Friday of the week."; } enum saturday { value 6; description "Saturday of the week."; } } description "Seven days of the week."; } typedef duration { type string { pattern '((\+)?|\-)P((([0-9]+)D)?(T(0[0-9]|1[0-9]|2[0-3])' + ':[0-5][0-9]:[0-5][0-9]))|P([0-9]+)W'; } description "Duration of the time. The format can represent nominal durations (weeks designated by 'W' and days designated by 'D') and accurate durations (hours:minutes:seconds follows the designator 'T'). Note that this value type doesn't support the 'Y' and 'M' designators to specify durations in terms of years and months. Negative durations are typically used to schedule an alarm to trigger before an associated time."; reference "RFC 5545: Internet Calendaring and Scheduling Core Object Specification (iCalendar), Sections 3.3.6 and 3.8.6.3"; } grouping period { description "This grouping is defined for period of time property."; reference "RFC 5545: Internet Calendaring and Scheduling Core Object Specification (iCalendar), Section 3.3.9"; container period-of-time { description "This container is defined to identify period values that contain a precise period of time."; leaf period-start { type yang:date-and-time; description "Period start time."; } choice period-type { description "Indicates the type of the time period. Two types are supported."; case period-explicit { description "A period of time is identified by its start and its end. 'period-start' indicates the period start."; leaf period-end { type yang:date-and-time; description "Period end time."; } } case period-duration { description "A period of time is defined by a start and a positive duration of time."; leaf period-duration { type duration { pattern 'P((([0-9]+)D)?(T(0[0-9]|1[0-9]|2[0-3])' + ':[0-5][0-9]:[0-5][0-9]))|P([0-9]+)W'; } description "A positive duration of the time. This value is equivalent to the format of duration type except that the value cannot be negative."; } } } } } grouping recurrence { description "This grouping is defined to identify properties that contain a recurrence rule."; reference "RFC 5545: Internet Calendaring and Scheduling Core Object Specification (iCalendar), Section 3.3.10"; container recurrence { description "Recurrence rule definition."; leaf freq { type enumeration { enum secondly { value 1; description "Repeating events based on an interval of a second or more."; } enum minutely { value 2; description "Repeating events based on an interval of a minute or more."; } enum hourly { value 3; description "Repeating events based on an interval of an hour or more."; } enum daily { value 4; description "Repeating events based on an interval of a day or more."; } enum weekly { value 5; description "Repeating events based on an interval of a week or more."; } enum monthly { value 6; description "Repeating events based on an interval of a month or more."; } enum yearly { value 7; description "Repeating events based on an interval of a year or more."; } } mandatory true; description "This parameter is defined to identify the type of recurrence rule."; } choice recurrence-bound { description "Modes to bound the recurrence rule. If no choice is indicated, the recurrence rule is considered to repeat forever."; case until { description "This case defines a way that bounds the recurrence rule in an inclusive manner."; leaf until { type union { type yang:date-no-zone; type yang:date-and-time; } description "This parameter specifies a date-no-zone or date-time value to bounds the recurrence. The specified value becomes the last instance of the recurrence."; } } case count { description "This case defines the number of occurrences at which to range-bound the recurrence."; leaf count { type uint32; description "The positive number of occurrences at which to range-bound the recurrence."; } } } leaf interval { type uint32; default "1"; description "A positive integer representing at which intervals the recurrence rule repeats. The default value is '1', meaning every second for a secondly rule, every minute for a minutely rule, every hour for an hourly rule, every day for a daily rule, every week for a weekly rule, every month for a monthly rule, and every year for a yearly rule."; } leaf-list bysecond { type uint32 { range "0..60"; } description "A list of seconds within a minute."; } leaf-list byminute { type uint32 { range "0..59"; } description "A list of minutes within an hour."; } leaf-list byhour { type uint32 { range "0..23"; } description "Specify a list of hours of the day."; } list byday { key "weekday"; description "Specify a list of days of the week."; leaf-list direction { when '(enum-value(../../freq) = 6) or ' + '(enum-value(../../freq) = 7) and not(../../byyearweek)'; type int32 { range "-53..-1|1..53"; } description "When specified, it indicates the nth occurrence of a specific day within the MONTHLY or YEARLY 'RRULE'. For example, within a MONTHLY rule, +1 monday represents the first monday within the month, whereas -1 monday represents the last monday of the month."; } leaf weekday { type schedule:weekday; description "Corresponding to seven days of the week."; } } leaf-list bymonthday { type int32 { range "-31..-1|1..31"; } description "Specifies a list of days of the month."; } leaf-list byyearday { type int32 { range "-366..-1|1..366"; } description "Specifies a list of days of the year."; } leaf-list byyearweek { when 'enum-value(../freq)=7'; type int32 { range "-53..-1|1..53"; } description "Specifies a list of weeks of the year."; } leaf-list byyearmonth { type uint32 { range "1..12"; } description "Specifies a list of months of the year."; } leaf-list bysetpos { type int32 { range "-366..-1|1..366"; } description "Specifies a list of values that corresponds to the nth occurrence within the set of recurrence instances specified by the rule. It must only be used in conjunction with another by the rule part."; } leaf wkst { type schedule:weekday; default "monday"; description "Specifies the day on which the workweek starts."; } } } } <CODE ENDS>¶
The "ietf-schedule" YANG module specified in this document defines schema for data that is designed to be accessed via network management protocols such as NETCONF [RFC6241] or RESTCONF [RFC8040]. The lowest NETCONF layer is the secure transport layer, and the mandatory-to-implement secure transport is Secure Shell (SSH) [RFC6242]. The lowest RESTCONF layer is HTTPS, and the mandatory-to-implement secure transport is TLS [RFC8446].¶
The Network Configuration Access Control Model (NACM) [RFC8341] provides the means to restrict access for particular NETCONF or RESTCONF users to a preconfigured subset of all available NETCONF or RESTCONF protocol operations and content.¶
The "ietf-schedule" module defines a set of types and groupings. These nodes are intended to be reused by other YANG modules. The module by itself does not expose any data nodes that are writable, data nodes that contain read-only state, or RPCs. As such, there are no additional security issues related to the "ietf- schedule" module that need to be considered.¶
This document registers the following URI in the "IETF XML Registry" [RFC3688].¶
URI: urn:ietf:params:xml:ns:yang:ietf-schedule Registrant Contact: The IESG. XML: N/A, the requested URI is an XML namespace.¶
This document registers the following YANG module in the "YANG Module Names" registry [RFC6020].¶
name: ietf-schedule namespace: urn:ietf:params:xml:ns:yang:ietf-schedule prefix: schedule maintained by IANA: N reference: RFC XXXX¶
This work is derived from the [I-D.ietf-opsawg-ucl-acl]. There is a desire from the OPSAWG to see this model be separately defined for wide use in scheduling context.¶
Thanks to Adrian Farrel, Wei Pan, Tianran Zhou, and Joe Clarke for their valuable comments and inputs to this work.¶