110671792a01444e18ef60c99d09eac1830fa113
[sim/o1-interface.git] / ntsimulator / deploy / o-ran-du / yang / o-ran-sc-du-hello-world.yang
1 module o-ran-sc-du-hello-world {
2   yang-version 1.1;
3   namespace "urn:o-ran-sc:yang:o-ran-sc-du-hello-world";
4   prefix duhw;
5
6   organization
7     "O-RAN Software Community";
8   contact
9     "www.o-ran-sc.org";
10   description
11     "This module contains the O-RAN Software Community Distributed Unit
12      API description. This schema was created to support the
13      O-RAN-SC D-Release RSAC use case.
14      This standalone model is the absolute minimum and therefore
15      called 'hello-world'.
16
17      Copyright 2021 the O-RAN Software Community.
18
19      Licensed under the Apache License, Version 2.0 (the 'License');
20      you may not use this file except in compliance with the License.
21      You may obtain a copy of the License at
22
23      http://www.apache.org/licenses/LICENSE-2.0
24
25      Unless required by applicable law or agreed to in writing, software
26      distributed under the License is distributed on an 'AS IS' BASIS,
27      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28      See the License for the specific language governing permissions and
29      limitations under the License.";
30
31   revision 2021-04-08 {
32     description
33       "Updates based on the RSAC call 2021-04-08.";
34     reference
35       "https://wiki.o-ran-sc.org/pages/viewpage.action?pageId=20878423";
36   }
37   revision 2021-03-06 {
38     description
39       "initial revision";
40     reference
41       "https://wiki.o-ran-sc.org/pages/viewpage.action?pageId=20878423";
42   }
43
44   // TypeDefinitions
45
46   typedef connection-status {
47     type enumeration {
48       enum disconnected {
49         value 0;
50         description
51           "The connection to the remote network function is not established.";
52       }
53       enum connecting {
54         value 1;
55         description
56           "The system is about to connect to the remote network function.";
57       }
58       enum connected {
59         value 2;
60         description
61           "The system is connected to the remote network function.";
62       }
63       enum disconnecting {
64         value 3;
65         description
66           "The system is about to disconnect from the remote network
67            function.";
68       }
69       enum unable-to-connect {
70         value 4;
71         description
72           "This value is reported, when the system tried several times
73            to connect and finally gave up.";
74       }
75     }
76     description
77       "A non extensible enumeration representing a connection status.";
78   }
79
80   typedef o-ru-reference {
81     type leafref {
82       path "/network-function/du-to-ru-connection/name";
83     }
84     description
85       "A reference to a remote network function representing an O-RU.";
86   }
87
88   // Abstract object classes - groupings
89
90   grouping connection-grp {
91     description
92       "An abstract object class representing a connection or link to an
93        external component.";
94     leaf name {
95       type string;
96       description
97         "It is proposed to use the network unique identifier of the remote
98          network function.
99          Note: After discussion the string was not restricted by a 'length'
100          statement of a 'pattern' statement. Please avoid leading and ending
101          spaces and consecutive spaces and any character outside of UTF-8-";
102     }
103     leaf operational-state {
104       type enumeration {
105         enum DISABLED {
106           description
107             "The resource is not functional.";
108         }
109         enum ENABLED {
110           description
111             "The resource is functional.";
112         }
113       }
114       config false;
115       description
116         "Operational state of a connection. Indicates
117          whether the resource is functional (ENABLED) or not (DISABLED).";
118       reference
119         "3GPP TS 28.625 and ITU-T X.731";
120     }
121     leaf administrative-state {
122       type enumeration {
123         enum LOCKED {
124           description
125             "LOCKED refers to a situation which is NOT considered as
126              ‘normal operation'. Therefore, the O-DU will shut down the
127              connection to the related O-RU, when the value is set to LOCKED.";
128         }
129         enum UNLOCKED {
130           description
131             "UNLOCKED refers to a situation which is considered as
132              'normal operation'. Therefore, the O-DU will establish the
133              connection to the related O-RU, when the value is set to UNLOCKED.";
134         }
135         enum SHUTTING_DOWN {
136           description
137             "This value should not be used. At least the system
138              behavior is not defined.";
139         }
140       }
141       default "LOCKED";
142       description
143         "Administrative state of a connection.";
144       reference
145         "3GPP TS 28.625 and ITU-T X.731";
146     }
147     leaf cell-state {
148       type enumeration {
149         enum IDLE {
150           description
151             "Indicates whether the O-RU is not in use.";
152         }
153         enum INACTIVE {
154           description
155             "Indicates whether the O-RU is in use but not
156              configured to carry traffic.";
157         }
158         enum ACTIVE {
159           description
160             "Indicates whether the O-RU is in use and
161              configured to carry traffic.";
162         }
163       }
164       config false;
165       description
166         "Cell state of the O-RU instance.";
167       reference
168         "3GPP TS 28.625";
169     }
170     leaf status {
171       type connection-status;
172       default "disconnected";
173       config false;
174       description
175         "The value represents the connection status. ";
176     }
177   }
178
179   grouping network-function-grp {
180     description
181       "An abstract object class grouping the O-RAN-SC-DU parameters with
182        focus on RSAC D-release Closed-Loop use case.";
183     list du-to-ru-connection {
184       key "name";
185       description
186         "A list of connection objects to O-RAN-SC radio units.";
187       uses connection-grp;
188     }
189   }
190
191   grouping rpc-output {
192     description
193       "A generic RPC output syntax.";
194     leaf response-status {
195       type enumeration {
196         enum ok {
197           value 200;
198           description
199             "The system has successfully performed that request.";
200         }
201         enum accepted {
202           value 202;
203           description
204             "The system has received and accepted the request. It continues
205              processing the request. The final status of the processing
206              procedures are reported by a notification service. This response
207              status is typically for long running transactions.";
208         }
209         enum internal-server-error {
210           value 500;
211           description
212             "The request cannot be performed.";
213         }
214       }
215       mandatory true;
216       description
217         "The response status related to the corresponding request.
218          Its values are inspired by HTTP response status codes.";
219       reference
220         "RFC 7231 – Response Status Codes - Section 6.3.4";
221     }
222     leaf message {
223       type string;
224       description
225         "A human readable text complementary to the response status. ";
226     }
227   }
228
229   // Data nodes
230
231   container network-function {
232     description
233       "The root container for the configuration and operational data.
234        The object implements the 'network-function-grp'";
235     uses network-function-grp;
236   }
237
238   // Remote procedure calls - actions on root level
239
240   rpc connect {
241     status deprecated;
242     description
243       "An action to establish the connection to a remote network function.";
244     input {
245       leaf remote-network-function {
246         type o-ru-reference;
247         mandatory true;
248         description
249           "An reference to a remote network function - an O-RU - to which
250            a connection should be established.";
251       }
252     }
253     output {
254       uses rpc-output;
255     }
256   }
257
258   rpc disconnect {
259     status deprecated;
260     description
261       "An action to destroy the connection to a remote network function.";
262     input {
263       leaf remote-network-function {
264         type o-ru-reference;
265         mandatory true;
266         description
267           "An reference to a remote network function - an O-RU - to which
268            the connection should be destroyed.";
269       }
270     }
271     output {
272       uses rpc-output;
273     }
274   }
275 }