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