7788cb1423468c2009aba16f56f6044a000eebcd
[scp/oam/modeling.git] / data-model / yang / published / xran / 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   deviation /hw:hardware/hw:component/hw:name {
125     description
126       "Deviations for oryginal ietf-hardware/component/name to check if its pattern
127       and length mathes xRAN limitation
128
129       A name that is unique across the RU that identifies the RU instance.
130       This name may be used in fault management to refer to a fault source or
131       affected object corresponding to the generic RU.";
132
133       deviate add {
134       must "re-match(current(),'[a-zA-Z0-9]{1,255}')" {
135         error-message "Name must match pattern and length.";
136           }
137     }
138   }
139
140   augment "/hw:hardware/hw:component" {
141     when "derived-from-or-self(hw:class, 'XRAN-RADIO')";
142     description "New xRAN parameters for xran hardware";
143     container label-content {
144       config false;
145       description
146         "Which set of attributes are printed on the Radio Unit's label";
147       leaf model-name {
148         type boolean;
149         description
150           "indicates whether model-name is included on the RU's label";
151       }
152       leaf serial-number {
153         type boolean;
154         description
155           "indicates whether serial number is included on the RU's label";
156       }
157       // add in other leafs according to manufacturer feedback on labels
158     }
159     leaf product-code {
160       type string;
161       config false;
162       description
163         "xRAN term that is distinct from model-name in ietf-hardware.";
164     }
165   }
166
167   augment "/hw:hardware/hw:component/hw:state"  {
168     when "derived-from-or-self(../hw:class, 'XRAN-RADIO')";
169     description
170       "new xRAN defined state";
171     leaf power-state {
172       if-feature "ENERGYSAVING";
173       type energysaving-state;
174       description
175         "The current power saving state for this component.
176         Note - hw:/hardware/compnent/state/standby-state defined in RFC 4268 is
177         used for redundancy purposes and not power saving operations.";
178     }
179     leaf availability-state {
180       type availability-type;
181       config false;
182       description
183         "RU’s availability-state is derived by matching active faults
184          and their impact to module’s operation and enables an RU to indicate
185          that even though it may have one or more critical alarms, it can continue
186          to serve traffic.";
187     }
188   }
189
190   augment "/hw:hardware-state-oper-enabled"  {
191     description "new availability state";
192     leaf availability-state {
193       type leafref {
194         path "/hw:hardware/hw:component/hw:state/xran-hw:availability-state";
195       }
196       description
197         "The availability-state of the RU.";
198     }
199   }
200
201   augment "/hw:hardware-state-oper-disabled"  {
202     description "new availability state";
203     leaf availability-state {
204       type leafref {
205         path "/hw:hardware/hw:component/hw:state/xran-hw:availability-state";
206       }
207       description
208         "The availability-state of the RU.";
209     }
210   }
211 }