Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

one-shot + finished support #21

Merged
merged 2 commits into from
Jun 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions yang/ietf-schedule.yang
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,14 @@ module ietf-schedule {
"Base identity for schedule type.";
}

identity one-shot {
base schedule-type;
description
"Indicates a one-shot schedule. That's a schedule that
will trigger an action and then the schedule will disable
itself.";
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference between one-shot and period? One-shot starts at a specific instant time without indicating the duration/end?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no periodicity/recurrence at all in a one-shot schedule. We need to this type to ease mapping with the MIB in RFC 3231

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I don't know the existence of RFC 3231 before, thanks for the info. While I found RFC 3231 defines three types of schedules that cannot be directly mapped to ours according to the naming rules:

  1. Periodic schedules, defined by specifying the number of seconds between two initiations, I understand this as a recurrence rule like every 4 seconds to trigger the action. This is very different from the period-of-time grouping we have defined, which describes a specific duration of time; but instead kind of a recurrence definition.
  2. Calendar Schedules, trigger scheduled actions at specified days of the week and days of the month. similar to our recurrence related definition, no issues.
  3. One-shot Schedules, automatically disable itself once an action has been invoked, this is actually the one I feel like similar to period-of-time.

IMO it is confusing to have both this one-shot identity and the period (different from periodic) as schedule-types, though the only difference might be, by specifying one-shot, the users are not allowed to provide the duration/end time of the trigger. but it is not mandatory to specify duration/period-end in the period-of-time grouping.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main difference I see between a one-shot and period of time is that the end time is not required to be configured but determined by the action. The end will be a read-only while this can be configured for a period.

Copy link
Collaborator

@QiufangMa QiufangMa Jun 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with that, could the difference be stated in the description? e.g.,
description for one-shot identity:
"Indicates a one-shot schedule. That's a schedule that
will trigger an action without the duration/end time being
specified and then the schedule will disable itself.";

description for period identity:
"Indicates a period-based schedule consisting either a
start and end or a start and positive duration of time.";

Just want to make sure there is no overlap between two identities.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. Done.


identity period {
base schedule-type;
description
Expand All @@ -223,6 +231,13 @@ module ietf-schedule {
"Indicates a recurrence with an enabled state.";
}

identity finished {
base schedule-state;
description
"Indicates a recurrence with a finished state.
The finished state indicates that the schedule has ended.";
}

identity disabled {
base schedule-state;
description
Expand Down Expand Up @@ -263,8 +278,8 @@ module ietf-schedule {

grouping generic-schedule-params {
description
"Includes a set of generic parameters that are
followed by the entity that supports schedules.
"Includes a set of generic parameters that are followed by
the entity that supports schedules.
Such parameters are used as guards to prevent, e.g., stale
configuration.";
Expand Down
Loading