Passa al contenuto principale

Appendix A. Examples of Scheduling Format Representation

Questa sezione conserva il testo RFC sul ietf-schedule YANG model, includendo recurrence groupings, iCalendar-like rules, schedule status groupings, DISMAN-SCHEDULE-MIB relationship, IANA registrations, YANG/XML examples e scheduled resource examples.

Testo RFC originale

Appendix A.  Examples of Scheduling Format Representation

This section provides some examples to illustrate the use of the
period and recurrence formats defined in Section 6. The following
modules are used for illustration purposes and make examples
verifiable:

module example-sch-usage-1 {
yang-version 1.1;
namespace "http://example.com/example-sch-usage-1";
prefix "ex-schu-1";

import ietf-schedule {
prefix "schedule";
}

organization
"Example, Inc.";

contact
"Support at example.com";

description
"Example of a module using 'generic-schedule-params' and
'schedule-status' groupings.";

revision "2026-02-20" {
description "Initial version.";
reference
"RFC 9922: A YANG Data Model for Scheduling";
}

container generic-schedule-params {
description
"A collection of generic scheduling parameters.";
uses schedule:generic-schedule-params;
}
container schedule-status {
description
"A collection of scheduling status.";
uses schedule:schedule-status;
}
}

module example-sch-usage-2 {
yang-version 1.1;
namespace "http://example.com/example-sch-usage-2";
prefix "ex-schu2";

import ietf-schedule {
prefix "schedule";
}

organization
"Example, Inc.";

contact
"Support at example.com";

description
"Example of a module using the 'period-of-time' grouping.";

revision "2026-02-20" {
description "Initial version.";
reference
"RFC 9922: A YANG Data Model for Scheduling";
}

container period-of-time {
description
"A container for a time period.";
uses schedule:period-of-time;
}
}

module example-sch-usage-3 {
yang-version 1.1;
namespace "http://example.com/example-sch-usage-3";
prefix "ex-schu-3";

import ietf-schedule {
prefix "schedule";
}

organization
"Example, Inc.";

contact
"Support at example.com";

description
"Example of a module using the 'recurrence-basic' grouping.";

revision "2026-02-20" {
description "Initial version.";
reference
"RFC 9922: A YANG Data Model for Scheduling";
}

container recurrence-basic {
description
"A container for a simple recurrence rule.";
uses schedule:recurrence-basic {
refine interval {
default 1;
}
}
}
}

module example-sch-usage-4 {
yang-version 1.1;
namespace "http://example.com/example-sch-usage-4";
prefix "ex-schu-4";

import ietf-schedule {
prefix "schedule";
}

organization
"Example, Inc.";

contact
"Support at example.com";

description
"Example of a module using the 'recurrence-utc' grouping.";

revision "2026-02-20" {
description "Initial version.";
reference
"RFC 9922: A YANG Data Model for Scheduling";
}

container recurrence-utc {
description
"A container for a simple recurrence rule in UTC format.";
uses schedule:recurrence-utc;
}
}

module example-sch-usage-5 {
yang-version 1.1;
namespace "http://example.com/example-sch-usage-5";
prefix "ex-schu-5";

import ietf-schedule {
prefix "schedule";
}

organization
"Example, Inc.";

contact
"Support at example.com";

description
"Example of a module using the 'recurrence-with-time-zone'
grouping.";

revision "2026-02-20" {
description "Initial version.";
reference
"RFC 9922: A YANG Data Model for Scheduling";
}

container recurrence-with-time-zone {
description
"A container for a simple recurrence rule with a time zone.";
uses schedule:recurrence-with-time-zone;
}
}

module example-sch-usage-6 {
yang-version 1.1;
namespace "http://example.com/example-sch-usage-6";
prefix "ex-schu-6";

import ietf-schedule {
prefix "schedule";
}

organization
"Example, Inc.";

contact
"Support at example.com";

description
"Example of a module using the 'recurrence-utc-with-periods'
grouping.";

revision "2026-02-20" {
description "Initial version.";
reference
"RFC 9922: A YANG Data Model for Scheduling";
}

container recurrence-utc-with-periods {
description
"A container for an aggregate set of repeating occurrences in
UTC format.";
uses schedule:recurrence-utc-with-periods;
}
}

module example-sch-usage-7 {
yang-version 1.1;
namespace "http://example.com/example-sch-usage-7";
prefix "ex-schu-8";

import ietf-schedule {
prefix "schedule";
}

organization
"Example, Inc.";

contact
"Support at example.com";

description
"Example of a module using the
'recurrence-time-zone-with-periods' grouping.";

revision "2026-02-20" {
description "Initial version.";
reference
"RFC 9922: A YANG Data Model for Scheduling";
}

container recurrence-time-zone-with-periods {
description
"A container for an aggregate set of repeating occurrences
with a time zone.";
uses schedule:recurrence-time-zone-with-periods;
}
}

module example-sch-usage-8 {
yang-version 1.1;
namespace "http://example.com/example-sch-usage-8";
prefix "ex-schu-8";

import ietf-schedule {
prefix "schedule";
}

organization
"Example, Inc.";

contact
"Support at example.com";

description
"Example of a module using 'icalendar-recurrence' grouping.";

revision "2026-02-20" {
description "Initial version.";
reference
"RFC 9922: A YANG Data Model for Scheduling";
}

container icalendar-recurrence {
description
"A container for a scheduled iCalendar recurrence.";
uses schedule:icalendar-recurrence {
refine workweek-start {
default monday;
}
}
}
}

For each example, only the message body is provided with JSON, which
is used for encoding per the guidance in [RFC7951].

A.1. The "generic-schedule-params" Grouping

Figure 10 illustrates the example of a requested schedule that needs
to start no earlier than 08:00 AM, January 1, 2025 and end no later
than 8:00 PM, January 31, 2025 (Beijing time). Schedule requests
that fail to meet the requirements are ignored by the system, as
indicated by "discard-action".

{
"example-sch-usage-1:generic-schedule-params": {
"time-zone-identifier": "China/Beijing",
"min-allowed-start": "2025-01-01T08:00:00",
"max-allowed-end": "2025-01-31T20:00:00",
"discard-action": "ietf-schedule:silently-discard"
}
}

Figure 10: Generic Parameters with 'max-allowed-end' for Schedule
Validation

To illustrate the difference between "max-allowed-end" and "validity"
parameters, Figure 11 shows the example of a requested schedule that
needs to start no earlier than 08:00 AM, January 1, 2025 (Beijing
time). Schedule requests that fail to meet the requirements are
ignored by the system, as indicated by "discard-action". The
requested schedule may end after 8:00 PM, January 31, 2025, but any
occurrences that are generated after that time would not be
considered as valid.

{
"example-sch-usage-1:generic-schedule-params": {
"time-zone-identifier": "China/Beijing",
"validity": "2025-01-31T20:00:00",
"min-allowed-start": "2025-01-01T08:00:00",
"discard-action": "ietf-schedule:silently-discard"
}
}

Figure 11: Generic Parameters with 'validity' for Schedule Validation

A.2. The "period-of-time" Grouping

Figure 12 shows an example of a period that starts at 08:00:00 UTC on
January 1, 2025 and ends at 18:00:00 UTC on December 31, 2027.

{
"example-sch-usage-2:period-of-time": {
"period-start": "2025-01-01T08:00:00Z",
"period-end": "2027-12-31T18:00:00Z"
}
}

Figure 12: Simple Start/End Schedule

An example of a period that starts at 08:00:00 UTC on January 1, 2025
and lasts 15 days and 5 hours and 20 minutes is encoded as shown in
Figure 13.

{
"example-sch-usage-2:period-of-time": {
"period-start": "2025-01-01T08:00:00Z",
"duration": "P15DT05:20:00"
}
}

Figure 13: Simple Schedule with Duration

An example of a period that starts at 2:00 AM in Los Angeles on
November 19, 2025 and lasts 20 weeks is depicted in Figure 14.

{
"example-sch-usage-2:period-of-time": {
"period-start": "2025-11-19T02:00:00",
"time-zone-identifier": "America/Los_Angeles",
"duration": "P20W"
}
}

Figure 14: Simple Schedule with Time Zone Indication

A.3. The "recurrence-basic" Grouping

Figure 15 indicates a recurrence of every 2 days, which starts
immediately and repeats forever:

{
"example-sch-usage-3:recurrence-basic": {
"recurrence-description": "forever recurrence rule",
"frequency": "ietf-schedule:daily",
"interval": 2
}
}

Figure 15: Simple Schedule with Recurrence

A.4. The "recurrence-utc" Grouping

Figure 16 indicates a recurrence from 8:00 AM to 9:00 AM every day,
from December 1 to December 31, 2025 in UTC:

{
"example-sch-usage-4:recurrence-utc": {
"recurrence-first": {
"start-time-utc": "2025-12-01T08:00:00Z",
"duration": 3600
},
"frequency": "ietf-schedule:daily",
"interval": 1,
"utc-until": "2025-12-31T23:59:59Z"
}
}

Figure 16: Simple Schedule with Recurrence in UTC

A.5. The "recurrence-with-time-zone" Grouping

Figure 17 indicates a recurrence of every 2 hours for 10 occurrences
that lasts 10 minutes and starts at 3 PM on December 1, 2025 in New
York:

{
"example-sch-usage-5:recurrence-with-time-zone": {
"recurrence-first": {
"start-time": "2025-12-01T15:00:00",
"duration": "PT00:10:00"
},
"time-zone-identifier": "America/New_York",
"frequency": "ietf-schedule:hourly",
"interval": 2,
"count": 10
}
}

Figure 17: Simple Schedule with Recurrence with Time Zone Indication

A.6. The "recurrence-utc-with-periods" Grouping

Figure 18 indicates a recurrence that occurs every two days starting
at 9:00 AM and 3:00 PM for a duration of 30 minutes and 40 minutes,
respectively, from 2025-06-01 to 2025-06-30 in UTC:

{
"example-sch-usage-6:recurrence-utc-with-periods": {
"recurrence-first": {
"start-time-utc": "2025-06-01T09:00:00Z"
},
"frequency": "ietf-schedule:daily",
"interval": 2,
"utc-until": "2025-06-30T23:59:59Z",
"period-timeticks": [
{
"period-start": 3240000,
"period-end": 3420000
},
{
"period-start": 5400000,
"period-end": 5640000
}
]
}
}

Figure 18: Example of Recurrence With Date Times

A.7. The "recurrence-time-zone-with-periods" Grouping

Figure 19 indicates a recurrence that occurs every 30 minutes and
lasts for 15 minutes from 9:00 AM to 5:00 PM and two extra
occurrences at 6:00 PM and 6:30 PM with each lasting for 20 minutes
on 2025-12-01 (New York):

{
"example-sch-usage-7:recurrence-time-zone-with-periods": {
"recurrence-first": {
"start-time": "2025-12-01T09:00:00",
"duration": "PT00:15:00"
},
"time-zone-identifier": "America/New_York",
"frequency": "ietf-schedule:minutely",
"interval": 30,
"until": "2025-12-01T17:00:00Z",
"period": [
{
"period-start": "2025-12-01T18:00:00",
"duration": "PT00:20:00"
},
{
"period-start": "2025-12-01T18:30:00",
"duration": "PT00:20:00"
}
]
}
}

Figure 19: Example of Advanced Recurrence Schedule

A.8. The "icalendar-recurrence" Grouping

Figure 20 indicates 10 occurrences at 8:00 AM (EST) every last
Saturday of the month starting in January 2024:

{
"example-sch-usage-8:icalendar-recurrence": {
"recurrence-first": {
"start-time": "2024-01-27T08:00:00"
},
"time-zone-identifier": "America/New_York",
"frequency": "ietf-schedule:monthly",
"count": 10,
"byday": [
{
"direction": [
-1
],
"weekday": "saturday"
}
]
}
}

Figure 20: Simple iCalendar Recurrence

Figure 21 is an example of a recurrence that occurs on the last
workday of the month until December 25, 2025, starting January 1,
2025:

{
"example-sch-usage-8:icalendar-recurrence": {
"recurrence-first": {
"start-time": "2025-01-01T00:00:00"
},
"frequency": "ietf-schedule:monthly",
"until": "2025-12-25T23:59:59",
"byday": [
{
"weekday": "monday"
},
{
"weekday": "tuesday"
},
{
"weekday": "wednesday"
},
{
"weekday": "thursday"
},
{
"weekday": "friday"
}
],
"bysetpos": [
-1
]
}
}

Figure 21: Example of Advanced iCalendar Recurrence

Figure 22 indicates a recurrence that occurs every 20 minutes from
9:00 AM to 4:40 PM (UTC), with the exclusion of the occurrence
starting at 10:20 AM on 2025-12-01:

{
"example-sch-usage-8:icalendar-recurrence": {
"recurrence-first": {
"start-time": "2025-12-01T09:00:00Z"
},
"until": "2025-12-01T16:40:00Z",
"frequency": "ietf-schedule:minutely",
"byminute": [
0,
20,
40
],
"byhour": [
9,
10,
11,
12,
13,
14,
15,
16
],
"exception-dates": [
"2025-12-01T10:20:00Z"
]
}
}

Figure 22: Example of Advanced iCalendar Recurrence with Exceptions

A.9. The "schedule-status" Grouping

Figure 23 indicates the scheduled recurrence status of Figure 22 at
the time of 12:15 PM on 2025-12-01 (UTC):

{
"example-sch-usage-1:schedule-status": {
"state": "ietf-schedule:enabled",
"version": 1,
"schedule-type": "ietf-schedule:recurrence",
"counter": 9,
"last-occurrence": "2025-12-01T12:00:00Z",
"upcoming-occurrence": "2025-12-01T12:20:00Z"
}
}

Figure 23: Example of a Schedule Status

At the time of 12:15 PM on 2025-12-01 (UTC), the recurring event
occurred at (note that the occurrence at 10:20 AM is excluded): 9:00,
9:20, 9:40, 10:00, 10:40, 11:00, 11:20, 11:40, and 12:00. The last
occurrence was at 12:00, and the upcoming one is at 12:20.