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