Skip to content

Commit

Permalink
udpate examples to use the dummy module
Browse files Browse the repository at this point in the history
  • Loading branch information
boucadair authored Oct 9, 2024
1 parent 935098d commit 3765c0c
Showing 1 changed file with 165 additions and 104 deletions.
269 changes: 165 additions & 104 deletions draft-ietf-netmod-schedule-yang.md
Original file line number Diff line number Diff line change
Expand Up @@ -551,10 +551,12 @@ This section uses the template described in {{Section 3.7 of ?I-D.ietf-netmod-rf
# Examples of Format Representation {#usage}

This section provides some examples to illustrate the use of the
period and recurrence formats defined in {{sec-schedule}}.
period and recurrence formats defined in {{sec-schedule}}. The following
module used for illustration purposes:

Note that a "grouping" does not define any data nodes in the schema tree;
the examples illustrated are thus for the ease of understanding.
~~~~
{::include-fold ./yang/example-sch-usage}
~~~~

For each example, only the message body is provided with
JSON used for encoding per the guidance in {{?RFC7951}}.
Expand All @@ -568,10 +570,12 @@ This section uses the template described in {{Section 3.7 of ?I-D.ietf-netmod-rf

~~~~
{
"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"
"example-sch-usage: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"
}
}
~~~~
{: #ex-0 title="Generic Parameters for Schedule Validation"}
Expand All @@ -583,8 +587,10 @@ This section uses the template described in {{Section 3.7 of ?I-D.ietf-netmod-rf

~~~~
{
"period-start": "2025-01-01T08:00:00Z",
"period-end": "2027-12-31T18:00:00Z"
"example-sch-usage:period-of-time": {
"period-start": "2025-01-01T08:00:00Z",
"period-end": "2027-12-31T18:00:00Z"
}
}
~~~~
{: #ex-1 title="Simple Start/End Schedule"}
Expand All @@ -594,8 +600,10 @@ This section uses the template described in {{Section 3.7 of ?I-D.ietf-netmod-rf

~~~~
{
"period-start": "2025-01-01T08:00:00Z",
"duration": "P15DT05:20:00"
"example-sch-usage:period-of-time": {
"period-start": "2025-01-01T08:00:00Z",
"duration": "P15DT05:20:00"
}
}
~~~~
{: #ex-2 title="Simple Schedule with Duration"}
Expand All @@ -605,9 +613,11 @@ This section uses the template described in {{Section 3.7 of ?I-D.ietf-netmod-rf

~~~~
{
"period-start": "2025-11-19T02:00:00",
"time-zone-identifier": "America/Los_Angeles",
"duration": "P20W"
"example-sch-usage:period-of-time": {
"period-start": "2025-11-19T02:00:00",
"time-zone-identifier": "America/Los_Angeles",
"duration": "P20W"
}
}
~~~~
{: #ex-3 title="Simple Schedule with Time Zone Indication"}
Expand All @@ -618,9 +628,11 @@ This section uses the template described in {{Section 3.7 of ?I-D.ietf-netmod-rf

~~~~
{
"recurrence-description": "forever recurrence rule",
"frequency": "ietf-schedule:daily",
"interval": 2,
"example-sch-usage:recurrence-basic": {
"recurrence-description": "forever recurrence rule",
"frequency": "ietf-schedule:daily",
"interval": 2
}
}
~~~~
{: #ex-4 title="Simple Schedule with Recurrence"}
Expand All @@ -632,13 +644,15 @@ This section uses the template described in {{Section 3.7 of ?I-D.ietf-netmod-rf

~~~~
{
"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"
"example-sch-usage: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"
}
}
~~~~
{: #ex-5 title="Simple Schedule with Recurrence in UTC"}
Expand All @@ -650,14 +664,16 @@ This section uses the template described in {{Section 3.7 of ?I-D.ietf-netmod-rf

~~~~
{
"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
"example-sch-usage: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
}
}
~~~~
{: #ex-6 title="Simple Schedule with Recurrence with Time Zone Indication"}
Expand All @@ -670,22 +686,24 @@ This section uses the template described in {{Section 3.7 of ?I-D.ietf-netmod-rf

~~~~
{
"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"
}
]
"example-sch-usage:recurrence-utc-with-date-times": {
"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"
}
]
}
}
~~~~
{: #ex-7 title="Example of Recurrence With Date Times"}
Expand All @@ -698,24 +716,26 @@ This section uses the template described in {{Section 3.7 of ?I-D.ietf-netmod-rf

~~~~
{
"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"
"example-sch-usage:recurrence-time-zone-with-date-times": {
"recurrence-first": {
"start-time": "2025-12-01T09:00:00",
"duration": "PT00:15:00",
"time-zone-identifier": "America/New_York"
},
{
"period-start": "2025-12-01T18:30:00",
"duration": "PT00:20:00"
}
]
"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"
}
]
}
}
~~~~
{: #ex-8 title="Example of Advanced Recurrence Schedule"}
Expand All @@ -727,18 +747,22 @@ This section uses the template described in {{Section 3.7 of ?I-D.ietf-netmod-rf

~~~~
{
"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"
}
]
"example-sch-usage: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"
}
]
}
}
~~~~
{: #ex-9 title="Simple iCalendar Recurrence"}
Expand All @@ -748,19 +772,33 @@ This section uses the template described in {{Section 3.7 of ?I-D.ietf-netmod-rf

~~~~
{
"recurrence-first": {
"start-time": "2025-01-01"
},
"frequency": "ietf-schedule:monthly",
"until": "2025-12-25",
"byday": [
{ "weekday": "monday"},
{ "weekday": "tuesday"},
{ "weekday": "wednesday"},
{ "weekday": "thursday"},
{ "weekday": "friday"}
],
"bysetpos": [-1]
"example-sch-usage:icalendar-recurrence": {
"recurrence-first": {
"start-time": "2025-01-01"
},
"frequency": "ietf-schedule:monthly",
"until": "2025-12-25",
"byday": [
{
"weekday": "monday"
},
{
"weekday": "tuesday"
},
{
"weekday": "wednesday"
},
{
"weekday": "thursday"
},
{
"weekday": "friday"
}
],
"bysetpos": [
-1
]
}
}
~~~~
{: #ex-10 title="Example of Advanced iCalendar Recurrence"}
Expand All @@ -771,14 +809,31 @@ This section uses the template described in {{Section 3.7 of ?I-D.ietf-netmod-rf

~~~~
{
"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"]
"example-sch-usage: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"
]
}
}
~~~~
{: #ex-11 title="Example of Advanced iCalendar Recurrence with Exceptions"}
Expand All @@ -790,12 +845,18 @@ This section uses the template described in {{Section 3.7 of ?I-D.ietf-netmod-rf

~~~~
{
"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"]
"example-sch-usage: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"
]
}
}
~~~~
{: #ex-12 title="Example of a Schedule Status"}
Expand Down

0 comments on commit 3765c0c

Please sign in to comment.