77115f59b4f9d5f196e173e5566a2fcdbc08e120
[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-03-06 {
32     description
33       "initial revision";
34     reference
35       "https://wiki.o-ran-sc.org/pages/viewpage.action?pageId=20878423";
36   }
37
38   // TypeDefinitions
39
40   typedef connection-status {
41     type enumeration {
42       enum disconnected {
43         value 0;
44         description
45           "The connection to the remote network function is not established.";
46       }
47       enum connecting {
48         value 1;
49         description
50           "The system is about to connect to the remote network function.";
51       }
52       enum connected {
53         value 2;
54         description
55           "The system is connected to the remote network function.";
56       }
57       enum disconnecting {
58         value 3;
59         description
60           "The system is about to disconnect from the remote network
61            function.";
62       }
63       enum unable-to-connect {
64         value 4;
65         description
66           "This value is reported, when the system tried several times
67            to connect and finally gave up.";
68       }
69     }
70     description
71       "A non extensible enumeration representing a connection status.";
72   }
73
74   typedef o-ru-reference {
75     type leafref {
76       path "/network-function/du-to-ru-connection/name";
77     }
78     description
79       "A reference to a remote network function representing an O-RU.";
80   }
81
82   // Abstract object classes - groupings
83
84   grouping connection-grp {
85     description
86       "An abstract object class representing a connection or link to an
87        external component.";
88     leaf name {
89       type string;
90       description
91         "It is proposed to use the network unique identifier of the remote
92          network function.
93          Note: After discussion the string was not restricted by a 'length' 
94          statement of a 'pattern' statement. Please avoid leading and ending
95          spaces and consecutive spaces and any character outside of UTF-8-";
96     }
97     leaf status {
98       type connection-status;
99       default "disconnected";
100       config false;
101       description
102         "The value represents the connection status. ";
103     }
104   }
105
106   grouping network-function-grp {
107     description
108       "An abstract object class grouping the O-RAN-SC-DU parameters with
109        focus on RSAC D-release Closed-Loop use case.";
110     list du-to-ru-connection {
111       key "name";
112       description
113         "A list of connection objects to O-RAN-SC radio units.";
114       uses connection-grp;
115     }
116   }
117
118   grouping rpc-output {
119     description
120       "A generic RPC output syntax.";
121     leaf response-status {
122       type enumeration {
123         enum ok {
124           value 200;
125           description
126             "The system has successfully performed that request.";
127         }
128         enum accepted {
129           value 202;
130           description
131             "The system has received and accepted the request. It continues
132              processing the request. The final status of the processing
133              procedures are reported by a notification service. This response
134              status is typically for long running transactions.";
135         }
136         enum internal-server-error {
137           value 500;
138           description
139             "The request cannot be performed.";
140         }
141       }
142       mandatory true;
143       description
144         "The response status related to the corresponding request.
145          Its values are inspired by HTTP response status codes.";
146       reference
147         "RFC 7231 – Response Status Codes - Section 6.3.4";
148     }
149     leaf message {
150       type string;
151       description
152         "A human readable text complementary to the response status. ";
153     }
154   }
155
156   // Data nodes
157
158   container network-function {
159     description
160       "The root container for the configuration and operational data.
161        The object implements the 'network-function-grp'";
162     uses network-function-grp;
163   }
164
165   // Remote procedure calls - actions on root level
166
167   rpc connect {
168     description
169       "An action to establish the connection to a remote network function.";
170     input {
171       leaf remote-network-function {
172         type o-ru-reference;
173         mandatory true;
174         description
175           "An reference to a remote network function - an O-RU - to which
176            a connection should be established.";
177       }
178     }
179     output {
180       uses rpc-output;
181     }
182   }
183
184   rpc disconnect {
185     description
186       "An action to destroy the connection to a remote network function.";
187     input {
188       leaf remote-network-function {
189         type o-ru-reference;
190         mandatory true;
191         description
192           "An reference to a remote network function - an O-RU - to which
193            the connection should be destroyed.";
194       }
195     }
196     output {
197       uses rpc-output;
198     }
199   }
200 }