Sync Common folder
[transportpce.git] / ordmodels / common / src / main / yang / org-openroadm-pm@2016-10-14.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   }
8   import org-openroadm-resource {
9     prefix org-openroadm-resource;
10     revision-date 2016-10-14;
11   }
12   import org-openroadm-layerRate {
13     prefix org-openroadm-layerRate;
14     revision-date 2016-10-14;
15   }
16   import org-openroadm-pm-types {
17     prefix org-openroadm-pm-types;
18     revision-date 2016-10-14;
19   }
20
21   organization "Open ROADM MSA";
22   contact
23     "OpenROADM.org";
24   description
25     "YANG definitions of performance management.
26        
27       Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
28       AT&T Intellectual Property.  All other rights reserved.
29       
30       Redistribution and use in source and binary forms, with or without modification, 
31       are permitted provided that the following conditions are met:
32       
33       * Redistributions of source code must retain the above copyright notice, this 
34         list of conditions and the following disclaimer.
35       * Redistributions in binary form must reproduce the above copyright notice, 
36         this list of conditions and the following disclaimer in the documentation and/or 
37         other materials provided with the distribution.
38       * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
39         contributors may be used to endorse or promote products derived from this software 
40         without specific prior written permission.
41       
42       THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
43       AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
44       WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
45       IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
46       INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
47       NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
48       OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
49       WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
50       ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
51       POSSIBILITY OF SUCH DAMAGE";
52
53   revision 2016-10-14 {
54     description
55       "Version 1.2";
56   }
57
58   grouping current-pm {
59     description
60       "PM Data with current values - both realtime (granularity=notApplicable) and binned (granularity=15 minute, 24h))";
61     leaf id {
62       type string;
63       mandatory true;
64       config false;
65     }
66     container resource {
67       uses org-openroadm-resource:resource;
68     }
69     container layerRate {
70       uses org-openroadm-layerRate:layer-rate;
71     }
72     list measurements {
73       container measurement {
74         uses org-openroadm-pm-types:pm-measurement;
75       }
76     }
77     leaf retrievalTime {
78       type yang:date-and-time;
79       mandatory true;
80       config false;
81     }
82     leaf granularity {
83       type org-openroadm-pm-types:pm-granularity;
84     }
85   }
86
87   container currentPmlist {
88     description
89       "List of current PMs.";
90     list currentPm {
91       key "id";
92       uses current-pm;
93     }
94     config false;
95   }
96
97   grouping historical-pm {
98     description
99       "PM Data with historical values - binned (granularity=15 minute, 24h))";
100     leaf id {
101       type string;
102       mandatory true;
103       config false;
104     }
105     container resource {
106       uses org-openroadm-resource:resource;
107     }
108     container layerRate {
109       uses org-openroadm-layerRate:layer-rate;
110     }
111     list binned-pm {
112       key "bin-number";
113       uses bin-pm;
114     }
115     leaf granularity {
116       type org-openroadm-pm-types:pm-granularity;
117     }
118   }
119
120   grouping bin-pm {
121     description
122       "PM Data with historical values";
123     leaf bin-number {
124       type uint16 {
125         range "1..max";
126       }
127       mandatory true;
128       config false;
129     }
130     list measurements {
131       container measurement {
132         uses org-openroadm-pm-types:pm-measurement;
133       }
134     }
135     leaf completionTime {
136       type yang:date-and-time;
137       mandatory true;
138       config false;
139     }
140   }
141
142   container historicalPmlist {
143     description
144       "List of historical PM";
145     list historicalPm {
146       key "id";
147       uses historical-pm;
148     }
149     config false;
150   }
151   rpc clear-pm {
152     description "Command to initialize PM data";
153     input {
154       uses org-openroadm-resource:resource;
155       leaf pm-type {
156         default "current";
157         type enumeration {
158           enum "current" {
159             value 1;
160           }
161           enum "all" {
162             value 2;
163           }
164         }
165       }
166       leaf granularity {
167         default "15min";
168         type org-openroadm-pm-types:pm-granularity;
169       }
170     }
171     output {
172       leaf status {
173         type enumeration {
174           enum "Successful" {
175             value 1;
176           }
177           enum "Failed" {
178             value 2;
179           }
180         }
181         mandatory true;
182         description
183           "Successful or Failed";
184       }
185       leaf status-message {
186         type string;
187         description
188           "Gives a more detailed reason for success / failure";
189       }
190     }
191   }
192 }