Refactor folder structure.
[sim/o1-interface.git] / ntsimulator / yang / x-ran / xran-hardware.yang
1 module xran-hardware {
2   yang-version 1.1;
3   namespace "urn:xran:hardware:1.0";
4   prefix "xran-hw";
5
6   import ietf-hardware {
7     prefix hw;
8   }
9   import iana-hardware {
10     prefix ianahw;
11   }
12
13   organization "xRAN Forum";
14
15   contact
16     "www.xran.org";
17
18   description
19     "This module defines the YANG definitions for managng the xRAN Radio Unit
20      hardware.
21
22      Copyright 2018 the xRAN Forum.
23
24      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
25      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26      IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27      ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
28      LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29      CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30      SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31      INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32      CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34      POSSIBILITY OF SUCH DAMAGE.
35
36      Redistribution and use in source and binary forms, with or without
37      modification, are permitted provided that the following conditions are met:
38
39      * Redistributions of source code must retain the above copyright notice,
40      this list of conditions and the above disclaimer.
41      * Redistributions in binary form must reproduce the above copyright notice,
42      this list of conditions and the above disclaimer in the documentation
43      and/or other materials provided with the distribution.
44      * Neither the Members of the xRAN Forum nor the names of its
45      contributors may be used to endorse or promote products derived from
46      this software without specific prior written permission.";
47
48   revision "2018-07-20" {
49     description
50       "version 1.0.0 - First release of the xRAN YANG M-Plane models.
51
52       This version of the model supports v01.00 of the corrsponding xRAN
53       M-Plane Specification.";
54     reference "XRAN-FH.MP.0-v01.00";
55   }
56
57   feature ENERGYSAVING {
58     description
59       "Indicates that the Radio Unit supports energy saving state.";
60   }
61
62   // identity statements
63   identity XRAN-RADIO {
64     base ianahw:module;
65     description
66       "Module used as it represents a self-contained sub-system
67       used in /hw:/hardware/hw:component/hw:class";
68   }
69
70   // typedef statements
71   typedef energysaving-state {
72     type enumeration {
73       enum UNKNOWN {
74         description "The Radio Unit is unable to report energy saving state.";
75       }
76       enum SLEEPING {
77         description
78           "The Radio Unit is in a sleep state. The NETCONF management plane
79            connection is functioning. Other functions and hardware which are
80            not needed for management plane may be in energy saving mode.";
81       }
82       enum AWAKE {
83         description
84           "The Radio Unit is not in an energy saving state.";
85       }
86     }
87     description
88       "new typedef since ietf-hardware only covers pwer-state
89       for redundancy purposes and not power saving operations.";
90   }
91
92   typedef availability-type {
93     type enumeration {
94       enum UNKNOWN {
95         description "The Radio Unit is unable to report its availability state.";
96       }
97       enum NORMAL {
98         description
99           "The RU is functioning correctly.";
100       }
101       enum DEGRADED {
102         description
103           "The RU may be reporting a major alarm or may be reporting a critical
104            alarm that is only impacting one or more subcomponent, but where the
105            RU's implementation permit it to continue operation (server traffic)
106            in a degraded state.
107
108            Used for example, when the RU has M identical sub-components and
109            when a critical alarm is imapcting only N subcomponents, where N<M.";
110       }
111       enum FAULTY {
112         description
113           "The (sub-)components impacted by the critical alarm(s) impact the
114           ability of the RU to continue operation (serve traffic).";
115       }
116     }
117     description
118       "RU’s availability-state is derived by matching active faults
119        and their impact to module’s operation and enables an RU to indicate
120        that even though it may have one or more critical alarms, it can continue
121        to serve traffic.";
122   }
123
124
125
126   augment "/hw:hardware/hw:component" {
127     when "derived-from-or-self(hw:class, 'XRAN-RADIO')";
128     description "New xRAN parameters for xran hardware";
129     container label-content {
130       config false;
131       description
132         "Which set of attributes are printed on the Radio Unit's label";
133       leaf model-name {
134         type boolean;
135         description
136           "indicates whether model-name is included on the RU's label";
137       }
138       leaf serial-number {
139         type boolean;
140         description
141           "indicates whether serial number is included on the RU's label";
142       }
143       // add in other leafs according to manufacturer feedback on labels
144     }
145     leaf product-code {
146       type string;
147       config false;
148       description
149         "xRAN term that is distinct from model-name in ietf-hardware.";
150     }
151   }
152
153   augment "/hw:hardware/hw:component/hw:state"  {
154     when "derived-from-or-self(../hw:class, 'XRAN-RADIO')";
155     description
156       "new xRAN defined state";
157     leaf power-state {
158       if-feature "ENERGYSAVING";
159       type energysaving-state;
160       description
161         "The current power saving state for this component.
162         Note - hw:/hardware/compnent/state/standby-state defined in RFC 4268 is
163         used for redundancy purposes and not power saving operations.";
164     }
165     leaf availability-state {
166       type availability-type;
167       config false;
168       description
169         "RU’s availability-state is derived by matching active faults
170          and their impact to module’s operation and enables an RU to indicate
171          that even though it may have one or more critical alarms, it can continue
172          to serve traffic.";
173     }
174   }
175
176   augment "/hw:hardware-state-oper-enabled"  {
177     description "new availability state";
178     leaf availability-state {
179       type leafref {
180         path "/hw:hardware/hw:component/hw:state/xran-hw:availability-state";
181       }
182       description
183         "The availability-state of the RU.";
184     }
185   }
186
187   augment "/hw:hardware-state-oper-disabled"  {
188     description "new availability state";
189     leaf availability-state {
190       type leafref {
191         path "/hw:hardware/hw:component/hw:state/xran-hw:availability-state";
192       }
193       description
194         "The availability-state of the RU.";
195     }
196   }
197 }