44b932827dc56c06985d740432a372bcc1f2cf1f
[transportpce.git] / ordmodels / common / src / main / yang / org-openroadm-pm@2020-05-29.yang
1 module org-openroadm-pm {
2   namespace "http://org/openroadm/pm";
3   prefix org-openroadm-pm;
4
5   import ietf-yang-types {
6     prefix yang;
7     revision-date 2013-07-15;
8   }
9   import org-openroadm-common-types {
10     prefix org-openroadm-common-types;
11     revision-date 2020-05-29;
12   }
13   import org-openroadm-common-alarm-pm-types {
14     prefix org-openroadm-common-alarm-pm-types;
15     revision-date 2019-11-29;
16   }
17   import org-openroadm-resource {
18     prefix org-openroadm-resource;
19     revision-date 2020-05-29;
20   }
21   import org-openroadm-resource-types {
22     prefix org-openroadm-resource-types;
23     revision-date 2019-11-29;
24   }
25   import org-openroadm-pm-types {
26     prefix org-openroadm-pm-types;
27     revision-date 2020-03-27;
28   }
29
30   organization
31     "Open ROADM MSA";
32   contact
33     "OpenROADM.org";
34   description
35     "YANG definitions of performance management.
36
37       Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
38       All other rights reserved.
39
40       Redistribution and use in source and binary forms, with or without modification,
41       are permitted provided that the following conditions are met:
42
43       * Redistributions of source code must retain the above copyright notice, this
44         list of conditions and the following disclaimer.
45       * Redistributions in binary form must reproduce the above copyright notice,
46         this list of conditions and the following disclaimer in the documentation and/or
47         other materials provided with the distribution.
48       * Neither the Members of the Open ROADM MSA Agreement nor the names of its
49         contributors may be used to endorse or promote products derived from this software
50         without specific prior written permission.
51
52       THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
53       AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
54       WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
55       IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
56       INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
57       NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
58       OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
59       WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
60       ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
61       POSSIBILITY OF SUCH DAMAGE";
62
63   revision 2020-05-29 {
64     description
65       "Version 7.1.0";
66   }
67   revision 2020-03-27 {
68     description
69       "Version 7.0.0";
70   }
71   revision 2019-11-29 {
72     description
73       "Version 6.1.0";
74   }
75   revision 2019-09-27 {
76     description
77       "Version 6.0.0";
78   }
79   revision 2019-05-31 {
80     description
81       "Version 5.1.0";
82   }
83   revision 2019-03-29 {
84     description
85       "Version 5.0.0";
86   }
87   revision 2018-11-30 {
88     description
89       "Version 4.1.0";
90   }
91   revision 2018-09-28 {
92     description
93       "Version 4.0.0";
94   }
95   revision 2018-05-30 {
96     description
97       "Version 3.1.0";
98   }
99   revision 2018-03-30 {
100     description
101       "Version 3.0.0";
102   }
103   revision 2017-12-15 {
104     description
105       "Version 2.2";
106   }
107   revision 2017-09-29 {
108     description
109       "Version 2.1";
110   }
111   revision 2017-07-28 {
112     description
113       "Version 2.0.1 - added revision-date to imports";
114   }
115   revision 2017-06-26 {
116     description
117       "Version 2.0";
118   }
119   revision 2016-10-14 {
120     description
121       "Version 1.2";
122   }
123
124   feature historical-pm-retrieval {
125     description
126       "The device supports the ability to directly retrieve the historical
127        PM data from the YANG model.";
128   }
129
130   grouping current-pm-group {
131     description
132       "PM Data with current values - both realtime (granularity=notApplicable)
133        and binned (granularity=15 minute, 24h))";
134     leaf pm-resource-instance {
135       type instance-identifier;
136       config false;
137       mandatory true;
138       description
139         "Retrieves all PM associate with the resource instance";
140     }
141     leaf pm-resource-type {
142       type org-openroadm-resource-types:resource-type-enum;
143       config false;
144       mandatory true;
145       description
146         "The supported pm-resource-type associated with the given resource instance.";
147     }
148     leaf pm-resource-type-extension {
149       type string;
150       config false;
151       description
152         "The resource type extension when the type is not defined in the resource-type-enum.";
153     }
154     leaf start-time {
155       type yang:date-and-time;
156       config false;
157       mandatory true;
158       description
159         "Represents the start time of the bin (15m, 24h granularity) or the start of data collection (notApplicable/untimed granularity).";
160     }
161     leaf retrieval-time {
162       type yang:date-and-time;
163       config false;
164       mandatory true;
165       description
166         "Represents the time when the data is being read, not the bin start or end time.";
167     }
168     list current-pm {
169       key "type extension location direction";
170       config false;
171       uses current-pm-val-group;
172     }
173   }
174
175   grouping current-pm-val-group {
176     uses org-openroadm-pm-types:pm-names;
177     leaf location {
178       type org-openroadm-common-alarm-pm-types:location;
179     }
180     leaf direction {
181       type org-openroadm-common-alarm-pm-types:direction;
182     }
183     list measurement {
184       key "granularity";
185       leaf granularity {
186         type org-openroadm-pm-types:pm-granularity;
187       }
188       uses org-openroadm-pm-types:pm-measurement;
189     }
190   }
191
192   grouping historical-pm-group {
193     description
194       "PM Data with historical values - binned (granularity=15 minute, 24h))";
195     leaf pm-resource-instance {
196       type instance-identifier;
197       config false;
198       mandatory true;
199       description
200         "Retrieves all PM associate with the resource instance";
201     }
202     leaf pm-resource-type {
203       type org-openroadm-resource-types:resource-type-enum;
204       config false;
205       mandatory true;
206     }
207     leaf pm-resource-type-extension {
208       type string;
209       config false;
210       description
211         "The resource type extension when the type is not defined in the resource-type-enum.";
212     }
213     list historical-pm {
214       key "type extension location direction";
215       uses historical-pm-val-group;
216     }
217   }
218
219   grouping historical-pm-val-group {
220     description
221       "PM Data with historical values";
222     uses org-openroadm-pm-types:pm-names;
223     leaf location {
224       type org-openroadm-common-alarm-pm-types:location;
225     }
226     leaf direction {
227       type org-openroadm-common-alarm-pm-types:direction;
228     }
229     list measurement {
230       key "granularity bin-number";
231       leaf granularity {
232         type org-openroadm-pm-types:pm-granularity;
233         mandatory true;
234       }
235       leaf bin-number {
236         type uint16 {
237           range "1..max";
238         }
239         config false;
240         mandatory true;
241       }
242       uses org-openroadm-pm-types:pm-measurement;
243       leaf completion-time {
244         type yang:date-and-time;
245         config false;
246         mandatory true;
247         description
248           "The time at the end of the period; For example if bin starts at
249            01:15:00 and ends at 01:29:59, the completion-time is 01:29:59";
250       }
251     }
252   }
253
254   grouping collect-history-pm-group {
255     leaf pm-filename {
256       type string {
257         length "10..255";
258       }
259       mandatory true;
260       description
261         "The file name to write the historical PM data.
262          The controller should be able to use this name to retrieve the file via ftp/sftp.
263          The file name should be unique for each RPC request since a new RPC request
264          could be initiated while the file transfer of the previous file is still in progress.
265
266          The file content should be written in xml format based on the historical-pm-list
267          yang definition and the file should be gzip compressed.";
268     }
269     uses org-openroadm-common-types:rpc-response-status;
270   }
271
272   rpc clear-pm {
273     description
274       "Command to initialize PM data";
275     input {
276       uses org-openroadm-resource:resource;
277       leaf pm-type {
278         type enumeration {
279           enum current {
280             value 1;
281           }
282           enum all {
283             value 2;
284           }
285         }
286         default "current";
287       }
288       leaf granularity {
289         type org-openroadm-pm-types:pm-granularity;
290         default "15min";
291       }
292     }
293     output {
294       uses org-openroadm-common-types:rpc-response-status;
295     }
296   }
297
298   rpc collect-historical-pm-file {
299     description
300       "Command to query historical PM data.
301        The device should be able to process an rpc request for 15min data
302        and a separate request for 24hour data in parallel.";
303     input {
304       leaf from-bin-number {
305         type uint16 {
306           range "1..max";
307         }
308         default "1";
309         description
310           "The start bin-number of the range";
311       }
312       leaf to-bin-number {
313         type uint16 {
314           range "1..max";
315         }
316         default "1";
317         description
318           "The end bin-number of the range";
319       }
320       leaf granularity {
321         type org-openroadm-pm-types:pm-granularity;
322         default "15min";
323         description
324           "The granularity of the retrieve, default to 15 minutes PM";
325       }
326     }
327     output {
328       uses collect-history-pm-group;
329     }
330   }
331
332   notification historical-pm-collect-result {
333     description
334       "This Notification is sent when the pm collection is successful or failed.";
335     uses collect-history-pm-group;
336   }
337
338   container current-pm-list {
339     config false;
340     description
341       "List of current PMs.";
342     list current-pm-entry {
343       key "pm-resource-type pm-resource-type-extension pm-resource-instance";
344       description
345         "List of current PM entries";
346       uses current-pm-group;
347     }
348   }
349   container historical-pm-list {
350     if-feature "historical-pm-retrieval";
351     config false;
352     description
353       "List of historical PM";
354     list historical-pm-entry {
355       key "pm-resource-type pm-resource-type-extension pm-resource-instance";
356       description
357         "List of historical PM entries";
358       uses historical-pm-group;
359     }
360   }
361 }