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