Upgrade Network model from 2.1 to 4.1
[transportpce.git] / ordmodels / common / src / main / yang / org-openroadm-pm@2018-10-19.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 2018-10-19;
12   }
13   import org-openroadm-resource {
14     prefix org-openroadm-resource;
15     revision-date 2018-10-19;
16   }
17   import org-openroadm-resource-types {
18     prefix org-openroadm-resource-types;
19     revision-date 2018-10-19;
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 2018-10-19 {
60     description
61       "Version 2.2.1";
62   }
63   revision 2017-12-15 {
64     description
65       "Version 2.2";
66   }
67   revision 2017-09-29 {
68     description
69       "Version 2.1";
70   }
71   revision 2017-07-28 {
72     description
73       "Version 2.0.1 - added revision-date to imports";
74   }
75   revision 2017-06-26 {
76     description
77       "Version 2.0";
78   }
79   revision 2016-10-14 {
80     description
81       "Version 1.2";
82   }
83
84   grouping current-pm-group {
85     description
86       "PM Data with current values - both realtime (granularity=notApplicable)
87        and binned (granularity=15 minute, 24h))";
88     leaf pm-resource-instance {
89       type instance-identifier;
90       config false;
91       mandatory true;
92       description
93         "Retrieves all PM associate with the resource instance";
94     }
95     leaf pm-resource-type {
96       type org-openroadm-resource-types:resource-type-enum;
97       config false;
98       mandatory true;
99       description
100         "The supported pm-resource-type associated with the given resource instance.";
101     }
102     leaf pm-resource-type-extension {
103       type string;
104       config false;
105       description
106         "The resource type extension when the type is not defined in the resource-type-enum.";
107     }
108     leaf retrieval-time {
109       type yang:date-and-time;
110       config false;
111       mandatory true;
112       description
113         "Represents the time when the data is being read, not the bin start or end time.";
114     }
115     list current-pm {
116       key "type extension location direction";
117       config false;
118       uses current-pm-val-group;
119     }
120   }
121
122   grouping current-pm-val-group {
123     uses org-openroadm-pm-types:pm-names;
124     leaf location {
125       type org-openroadm-common-types:location;
126     }
127     leaf direction {
128       type org-openroadm-common-types:direction;
129     }
130     list measurement {
131       key "granularity";
132       leaf granularity {
133         type org-openroadm-pm-types:pm-granularity;
134       }
135       uses org-openroadm-pm-types:pm-measurement;
136     }
137   }
138
139   grouping historical-pm-group {
140     description
141       "PM Data with historical values - binned (granularity=15 minute, 24h))";
142     leaf pm-resource-instance {
143       type instance-identifier;
144       config false;
145       mandatory true;
146       description
147         "Retrieves all PM associate with the resource instance";
148     }
149     leaf pm-resource-type {
150       type org-openroadm-resource-types:resource-type-enum;
151       config false;
152       mandatory true;
153     }
154     leaf pm-resource-type-extension {
155       type string;
156       config false;
157       description
158         "The resource type extension when the type is not defined in the resource-type-enum.";
159     }
160     list historical-pm {
161       key "type extension location direction";
162       uses historical-pm-val-group;
163     }
164   }
165
166   grouping historical-pm-val-group {
167     description
168       "PM Data with historical values";
169     uses org-openroadm-pm-types:pm-names;
170     leaf location {
171       type org-openroadm-common-types:location;
172     }
173     leaf direction {
174       type org-openroadm-common-types:direction;
175     }
176     list measurement {
177       key "granularity bin-number";
178       leaf granularity {
179         type org-openroadm-pm-types:pm-granularity;
180         mandatory true;
181       }
182       leaf bin-number {
183         type uint16 {
184           range "1..max";
185         }
186         config false;
187         mandatory true;
188       }
189       uses org-openroadm-pm-types:pm-measurement;
190       leaf completion-time {
191         type yang:date-and-time;
192         config false;
193         mandatory true;
194         description
195           "The time at the end of the period; For example if bin starts at
196            01:15:00 and ends at 01:29:59, the completion-time is 01:29:59";
197       }
198     }
199   }
200
201   grouping collect-history-pm-group {
202     leaf pm-filename {
203       type string {
204         length "10..255";
205       }
206       description
207         "The file name to write the historical PM data.
208          The controller should be able to use this name to retrieve the file via ftp/sftp.
209          The file name should be unique for each RPC request since a new RPC request
210          could be initiated while the file transfer of the previous file is still in progress.
211
212          The file content should be written in xml format based on the historical-pm-list
213          yang definition and the file should be gzip compressed.";
214     }
215     uses org-openroadm-common-types:rpc-response-status;
216   }
217
218   rpc clear-pm {
219     description
220       "Command to initialize PM data";
221     input {
222       uses org-openroadm-resource:resource;
223       leaf pm-type {
224         type enumeration {
225           enum "current" {
226             value 1;
227           }
228           enum "all" {
229             value 2;
230           }
231         }
232         default "current";
233       }
234       leaf granularity {
235         type org-openroadm-pm-types:pm-granularity;
236         default "15min";
237       }
238     }
239     output {
240       uses org-openroadm-common-types:rpc-response-status;
241     }
242   }
243   rpc collect-historical-pm-file {
244     description
245       "Command to query historical PM data.
246        The device should be able to process an rpc request for 15min data
247        and a separate request for 24hour data in parallel.";
248     input {
249       leaf from-bin-number {
250         type uint16 {
251           range "1..max";
252         }
253         default "1";
254         description
255           "The start bin-number of the range";
256       }
257       leaf to-bin-number {
258         type uint16 {
259           range "1..max";
260         }
261         default "1";
262         description
263           "The end bin-number of the range";
264       }
265       leaf granularity {
266         type org-openroadm-pm-types:pm-granularity;
267         default "15min";
268         description
269           "The granularity of the retrieve, default to 15 minitues PM";
270       }
271     }
272     output {
273       uses collect-history-pm-group;
274     }
275   }
276   notification historical-pm-collect-result {
277     description
278       "This Notification is sent when the pm collection is succesful or failed.";
279     uses collect-history-pm-group;
280   }
281   container current-pm-list {
282     config false;
283     description
284       "List of current PMs.";
285     list current-pm-entry {
286       key "pm-resource-type pm-resource-type-extension pm-resource-instance";
287       uses current-pm-group;
288     }
289   }
290   container historical-pm-list {
291     config false;
292     description
293       "List of historical PM";
294     list historical-pm-entry {
295       key "pm-resource-type pm-resource-type-extension pm-resource-instance";
296       uses historical-pm-group;
297     }
298   }
299 }