Support of WG4 OpenFronthaul Management-Plane VES
[scp/oam/modeling.git] / data-model / yang / published / o-ran / ru-fh / o-ran-hardware@2020-04-17.yang
1 module o-ran-hardware {
2   yang-version 1.1;
3   namespace "urn:o-ran:hardware:1.0";
4   prefix "o-ran-hw";
5
6   import ietf-hardware {
7     prefix hw;
8   }
9   import iana-hardware {
10     prefix ianahw;
11   }
12
13   organization "O-RAN Alliance";
14
15   contact
16     "www.o-ran.org";
17
18   description
19     "This module defines the YANG definitions for managng the O-RAN hardware.
20
21      Copyright 2020 the O-RAN Alliance.
22
23      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
24      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25      IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26      ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27      LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28      CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29      SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30      INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31      CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33      POSSIBILITY OF SUCH DAMAGE.
34
35      Redistribution and use in source and binary forms, with or without
36      modification, are permitted provided that the following conditions are met:
37
38      * Redistributions of source code must retain the above copyright notice,
39      this list of conditions and the above disclaimer.
40      * Redistributions in binary form must reproduce the above copyright notice,
41      this list of conditions and the above disclaimer in the documentation
42      and/or other materials provided with the distribution.
43      * Neither the Members of the O-RAN Alliance nor the names of its
44      contributors may be used to endorse or promote products derived from
45      this software without specific prior written permission.";
46
47   revision "2020-04-17" {
48     description
49       "version 3.0.0
50
51       1) added new leaf to indicate whether O-RU supports dying gasp
52       2) added new identities for PA and FPGA";
53
54     reference "ORAN-WG4.M.0-v03.00";
55    }
56
57    revision "2019-07-03" {
58     description
59       "version 1.1.0
60
61       1) added new identities to accommodate cross working group use of
62       o-ran-hardware and assoicated set of augmentations that are backwards
63       compatible to version 1.0.0";
64
65     reference "ORAN-WG4.M.0-v01.00";
66    }
67
68   revision "2019-02-04" {
69    description
70      "version 1.0.0
71
72      1) imported model from xRAN
73      2) changed namespace and reference from xran to o-ran";
74
75    reference "ORAN-WG4.M.0-v01.00";
76   }
77
78   feature ENERGYSAVING {
79     description
80       "Indicates that the Radio Unit supports energy saving state.";
81   }
82
83   // identity statements
84   identity O-RAN-RADIO {
85     base ianahw:module;
86     description
87       "Module used as it represents a self-contained sub-system
88       used in /hw:/hardware/hw:component/hw:class to represent
89       an O-RAN RU";
90   }
91
92   identity O-RAN-HW-COMPONENT {
93     base ianahw:module;
94     description
95       "Module used as it represents a self-contained sub-system
96       used in /hw:/hardware/hw:component/hw:class to represent
97       any O-RAN hardware component";
98   }
99
100   identity O-DU-COMPONENT {
101     base O-RAN-HW-COMPONENT;
102     description
103       "Used in /hw:/hardware/hw:component/hw:class to represent
104       any O-RAN defined O-DU hardware component";
105   }
106
107   identity O-RU-COMPONENT {
108     base O-RAN-HW-COMPONENT;
109     description
110       "Used in /hw:/hardware/hw:component/hw:class to represent
111       any O-RAN defined O-RU hardware component, including a stand-alone
112       O-RU or an O-RU component integrated into a multi-module system.";
113   }
114
115   identity O-RU-POWER-AMPLIFIER {
116     base O-RU-COMPONENT;
117     description
118       "Used in /hw:/hardware/hw:component/hw:class to represent
119       an O-RU's power amplifier, and may be used for reporting
120       measurements on a per class basis";
121   }
122
123     identity O-RU-FPGA {
124     base O-RU-COMPONENT;
125     description
126       "Used in /hw:/hardware/hw:component/hw:class to represent
127       an FPGA in an O-RU, and may be used for reporting
128       measurements on a per class basis";
129   }
130
131   // typedef statements
132   typedef energysaving-state {
133     type enumeration {
134       enum UNKNOWN {
135         description "The Radio Unit is unable to report energy saving state.";
136       }
137       enum SLEEPING {
138         description
139           "The Radio Unit is in a sleep state. The NETCONF management plane
140            connection is functioning. Other functions and hardware which are
141            not needed for management plane may be in energy saving mode.";
142       }
143       enum AWAKE {
144         description
145           "The Radio Unit is not in an energy saving state.";
146       }
147     }
148     description
149       "new typedef since ietf-hardware only covers pwer-state
150       for redundancy purposes and not power saving operations.";
151   }
152
153   typedef availability-type {
154     type enumeration {
155       enum UNKNOWN {
156         description "The Radio Unit is unable to report its availability state.";
157       }
158       enum NORMAL {
159         description
160           "The equipment is functioning correctly.";
161       }
162       enum DEGRADED {
163         description
164           "The equipment may be reporting a major alarm or may be reporting a critical
165            alarm that is only impacting one or more subcomponent, but where the
166            equipment's implementation permit it to continue operation (server traffic)
167            in a degraded state.
168
169            Used for example, when the equipment has M identical sub-components and
170            when a critical alarm is imapcting only N subcomponents, where N<M.";
171       }
172       enum FAULTY {
173         description
174           "The (sub-)components impacted by the critical alarm(s) impact the
175           ability of the equipment to continue operation (serve traffic).";
176       }
177     }
178     description
179       "Equipment's availability-state is derived by matching active faults
180        and their impact to module's operation and enables an equipment to indicate
181        that even though it may have one or more critical alarms, it can continue
182        to serve traffic.";
183   }
184
185   // common WG4 and croos-WG augmentations using O-RAN-RADIO identity
186
187   augment "/hw:hardware/hw:component" {
188     when "(derived-from-or-self(hw:class, 'o-ran-hw:O-RAN-RADIO')) or
189     (derived-from-or-self(hw:class, 'o-ran-hw:O-RAN-HW-COMPONENT'))";
190     description "New O-RAN parameters for o-ran hardware";
191
192     container label-content {
193       config false;
194       description
195         "Which set of attributes are printed on the Radio Unit's label";
196       leaf model-name {
197         type boolean;
198         description
199           "indicates whether model-name is included on the equipment's label";
200       }
201       leaf serial-number {
202         type boolean;
203         description
204           "indicates whether serial number is included on the equipment's label";
205       }
206     }
207     leaf product-code {
208       type string;
209       config false;
210       mandatory true;
211       description
212         "O-RAN term that is distinct from model-name in ietf-hardware.";
213     }
214     leaf energy-saving-enabled {
215       if-feature "ENERGYSAVING";
216       type boolean;
217       config true;
218       default false;
219       description
220         "This parameter can enable O-RAN unit to be switched to energy
221          saving mode.
222          TRUE indicates to switch the energy saving mode.
223          FALSE indicates to cancel the energy saving mode.
224          At the energy saving mode, all power of whole O-RAN unit becomes
225          lowest level whereas M-plane is still available";
226     }
227     leaf dying-gasp-support {
228       type boolean;
229       config false;
230       default false;
231       description
232         "indicates whether the O-RU supports the dying gasp
233         capability";
234     }
235
236   }
237
238   augment "/hw:hardware/hw:component" {
239     when "(derived-from-or-self(hw:class, 'o-ran-hw:O-RAN-RADIO')) or
240     (derived-from-or-self(hw:class, 'ianahw:port')) or
241     (derived-from-or-self(hw:class, 'o-ran-hw:O-RAN-HW-COMPONENT'))";
242     description "New O-RAN parameters for o-ran naming";
243     leaf o-ran-name {
244       type leafref {
245         path "/hw:hardware/hw:component/hw:name";
246       }
247       must "re-match(current(),'[a-zA-Z0-9][a-zA-Z0-9\\.\\-_]{0,253}[a-zA-Z0-9]')" {
248         error-message "Name must match pattern and length.";
249       }
250       mandatory true;
251       description
252         "O-RAN name needed to bind and match with the name of hw element,
253         to be compliant with O-RAN naming convention.";
254     }
255   }
256
257   augment "/hw:hardware/hw:component/hw:state"  {
258     when "(derived-from-or-self(../hw:class, 'o-ran-hw:O-RAN-RADIO')) or
259     (derived-from-or-self(../hw:class, 'o-ran-hw:O-RAN-HW-COMPONENT'))";
260     description
261       "new O-RAN defined state";
262     leaf power-state {
263       if-feature "ENERGYSAVING";
264       type energysaving-state;
265       config false;
266       description
267         "The current power saving state for this component.
268         Note - hw:/hardware/compnent/state/standby-state defined in RFC 4268 is
269         used for redundancy purposes and not power saving operations.";
270     }
271     leaf availability-state {
272       type availability-type;
273       config false;
274       description
275         "Equipment's availability-state is derived by matching active faults
276          and their impact to module's operation and enables an equipment to indicate
277          that even though it may have one or more critical alarms, it can continue
278          to serve traffic.";
279     }
280   }
281
282
283 // augmentations to Notifications
284
285   augment "/hw:hardware-state-oper-enabled"  {
286     description "new availability state";
287     leaf availability-state {
288       type leafref {
289         path "/hw:hardware/hw:component/hw:state/o-ran-hw:availability-state";
290       }
291       description
292         "The availability-state of the O-RU.";
293     }
294   }
295
296   augment "/hw:hardware-state-oper-disabled"  {
297     description "new availability state";
298     leaf availability-state {
299       type leafref {
300         path "/hw:hardware/hw:component/hw:state/o-ran-hw:availability-state";
301       }
302       description
303         "The availability-state of the O-RU.";
304     }
305   }
306 }