blob: 3fdd3ddf23b08bf20675668cca36bf43315a0e35 [file] [log] [blame]
sonugupta-huawei99b187d2017-12-19 14:20:00 +05301 module actn-ietf-schedule {
2 yang-version 1.1;
3 namespace "urn:ietf:params:xml:ns:yang:actn-ietf-schedule";
4
5 prefix "sch";
6 import yrt-ietf-yang-types {
7 prefix "yang";
8 }
9
10 organization "TBD";
11 contact "TBD";
12 description
13 "The model allows time scheduling parameters to be specified.";
14
15 revision "2017-03-06" {
16 description "Initial revision";
17 reference "TBD";
18 }
19
20 /*
21 * Typedefs
22 */
23 typedef operation {
24 type enumeration {
25 enum configure {
26 description
27 "Create the configuration data.";
28 }
29 enum deconfigure {
30 description
31 "Remove the configuration data.";
32 }
33 enum set {
34 description
35 "Set the specified configuration data.";
36 }
37 enum reset {
38 description
39 "Revert the specified configuration data back to the
40 original value.";
41 }
42 }
43 description "Operation type.";
44 }
45 /*
46 * Groupings
47 */
48
49 grouping schedule-config-attributes {
50 description
51 "A group of attributes for a schedule.";
52
53 leaf inclusive-exclusive {
54 type enumeration {
55 enum inclusive {
56 description
57 "The schedule element is inclusive, i.e., the schedule
58 specifies the time at which the element is enabled.";
59 }
60 enum exclusive {
61 description
62 "The schedule element is exclusive. i.e., the schedule
63 specifies the time at which the element is disabled.";
64 }
65 }
66 default "inclusive";
67 description
68 "Whether the list item is inclusive or exclusive.";
69 }
70 leaf start {
71 type yang:date-and-time;
72 description "Start time.";
73 }
74 leaf schedule-duration {
75 type string {
76 pattern
77 'P(\d+Y)?(\d+M)?(\d+W)?(\d+D)?T(\d+H)?(\d+M)?(\d+S)?';
78 }
79 description "Schedule duration in ISO 8601 format.";
80 }
81 leaf repeat-interval {
82 type string {
83 pattern
84 'R\d*/P(\d+Y)?(\d+M)?(\d+W)?(\d+D)?T(\d+H)?(\d+M)?'
85 + '(\d+S)?';
86 }
87 description "Repeat interval in ISO 8601 format.";
88 }
89 } // schedule-config-attributes
90
91 grouping schedule-config-notification {
92 description
93 "A group of attributes for a schedule notification.";
94
95/****TODO: FIXME: cannot handle notification as child under a container??
96 notification execution {
97 description
98 "Notification event for an execution performed on a target
99 object.";
100 leaf operation {
101 type operation;
102 mandatory true;
103 description "Operation type.";
104 }
105 leaf datetime {
106 type yang:date-and-time;
107 description
108 "The date and time when the execution was performed.";
109 }
110 anydata results {
111 description
112 "This chunk of data contains the results of the execution
113 performed on the target object. The results are the same
114 or equivalent to the contents of a <rpc-reply> message,
115 Because of the nature of such a target execution, a
116 <rpc-reply> message is not used to return the execution
117 results. Instead, this notification is used to serve
118 the same purpose.";
119 }
120 }
121***TODO: FIXME***/
122 } // schedule-config-notification
123
124 grouping schedule-state-attributes {
125 description
126 "State attributes for a schedule.";
127 container future-executions {
128 description
129 "The state information of the nexte scheduled event.";
130 list execution {
131 key "start";
132 description
133 "List of scheduled future executions.";
134 leaf start {
135 type yang:date-and-time;
136 description "Start time.";
137 }
138 leaf duration {
139 type string {
140 pattern
141 'P(\d+Y)?(\d+M)?(\d+W)?(\d+D)?T(\d+H)?(\d+M)?(\d+S)?';
142 }
143 description "Schedule duration in ISO 8601 format.";
144 }
145 leaf operation {
146 type operation;
147 description "Operation type.";
148 }
149 } // event
150 } // future-events
151 } // schedule-state-attributes
152
153 grouping schedules {
154 description
155 "A list of schedules defining when a particular
156 configuration takes effect.";
157 container schedules {
158 description
159 "Container of a schedule list defining when a particular
160 configuration takes effect.";
161 list schedule {
162 key "schedule-id";
163 description "A list of schedule elements.";
164 leaf schedule-id {
165 type uint32;
166 description "Identifies the schedule element.";
167 }
168 uses schedule-config-attributes;
169 }
170 }
171 } // schedules
172
173 /*
174 * Configuration data and operational state nodes
175 */
176 container configuration-schedules {
177 description
178 "Serves as top-level container for a list of configuration
179 schedules.";
180 list target {
181 key "object";
182 description
183 "A list of targets that configuration schedules are
184 applied.";
185 leaf object {
186 type yang:xpath1.0;
187 description
188 "Xpath defining the data items of interest.";
189 }
190 leaf operation {
191 type operation;
192 default "configure";
193 description
194 "Operation type.";
195 }
196
197 anydata data-value {
198 description
199 "The data value applied to the leaf data node
200 specified by data-objects.
201 The format of the data value depends on the value of the
202 leaf operation defined above:
203 configure: data-value is the sub-tree added to the
204 target object;
205 deconfigure: data-value is the child to be deleted from
206 the target object;
207 set: the target object MULST be a leaf, and
208 data-value is the new value to be set to
209 the target object;
210 reset: data-value is ignored.";
211 }
212
213 uses schedules;
214 container state {
215 config false;
216 description
217 "Operational state data.";
218 uses schedule-state-attributes;
219 } // state
220
221 uses schedule-config-notification;
222 } // target
223 } // configuration-schedules
224 }