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