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