Fix licensing issues
[nonrtric.git] / sdnc-a1-controller / northbound / nonrt-ric-api / model / src / main / yang / NONRT-RIC-API.yang
1 //-\r
2 // ============LICENSE_START=======================================================\r
3 //  Copyright (C) 2019 Nordix Foundation.\r
4 // ================================================================================\r
5 // Licensed under the Apache License, Version 2.0 (the "License");\r
6 // you may not use this file except in compliance with the License.\r
7 // You may obtain a copy of the License at\r
8 //\r
9 //      http://www.apache.org/licenses/LICENSE-2.0\r
10 //\r
11 // Unless required by applicable law or agreed to in writing, software\r
12 // distributed under the License is distributed on an "AS IS" BASIS,\r
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
14 // See the License for the specific language governing permissions and\r
15 // limitations under the License.\r
16 //\r
17 // SPDX-License-Identifier: Apache-2.0\r
18 // ============LICENSE_END=========================================================\r
19 //\r
20 module A1-ADAPTER-API {\r
21 \r
22     namespace "org:onap:sdnc:northbound:a1-adapter";\r
23 \r
24     prefix a1-adapter-api;\r
25 \r
26     import ietf-inet-types { prefix "inet"; revision-date "2013-07-15"; }\r
27 \r
28     import ietf-yang-types { prefix yang; }\r
29 \r
30     revision "2019-10-02" {\r
31         description\r
32         "A1 adapter";\r
33     }\r
34 \r
35     //Flattend interface using RPC\r
36 \r
37     //Get an array of near-rt-ric IDs,\r
38     //Each item in the returned array will be regarded as one near-rt-ric-id.\r
39     rpc getNearRT-RICs {\r
40         output {\r
41             leaf-list near-rt-ric-id-list {\r
42                 type string;\r
43             }\r
44             leaf code {\r
45                 type string;\r
46             }\r
47         }\r
48     }\r
49 \r
50     //Get health status for a Near-RT-RIC. true - health ok, false - health is not ok.\r
51     rpc getHealthCheck {\r
52          input {\r
53             leaf near-rt-ric-id {\r
54                 type string;\r
55             }\r
56         }\r
57 \r
58         output {\r
59             leaf health-status {\r
60                 type boolean;\r
61             }\r
62             leaf code {\r
63                 type string;\r
64             }\r
65         }\r
66     }\r
67 \r
68     //Get an array of integer policy type ids\r
69     //Each item in the returned array will be regarded as one policy-type-id.\r
70     rpc getPolicyTypes {\r
71         input {\r
72             leaf near-rt-ric-id {\r
73                 type string;\r
74             }\r
75         }\r
76 \r
77         output {\r
78             leaf-list policy-type-id-list {\r
79                 type uint32;\r
80             }\r
81             leaf code {\r
82                 type string;\r
83             }\r
84         }\r
85     }\r
86 \r
87     //Create a policy type\r
88     rpc createPolicyType {\r
89         input {\r
90             leaf near-rt-ric-id {\r
91                 type string;\r
92             }\r
93             leaf policy-type-id {\r
94                 type uint32;\r
95             }\r
96             leaf description {\r
97                 type string;\r
98             }\r
99             leaf name {\r
100                 type string;\r
101             }\r
102             leaf policy-type {\r
103                 type string;\r
104             }\r
105         }\r
106        output {\r
107             leaf code {\r
108                 type string;\r
109             }\r
110         }\r
111     }\r
112 \r
113     //Get a policy type\r
114     rpc getPolicyType {\r
115         input {\r
116             leaf near-rt-ric-id {\r
117                 type string;\r
118             }\r
119             leaf policy-type-id {\r
120                 type uint32;\r
121             }\r
122         }\r
123         output {\r
124             leaf description {\r
125                 type string;\r
126             }\r
127             leaf name {\r
128                 type string;\r
129             }\r
130             leaf policy-type {\r
131                 type string;\r
132             }\r
133             leaf code {\r
134                 type string;\r
135             }\r
136         }\r
137     }\r
138 \r
139     //Delete a policy type\r
140     rpc deletePolicyType {\r
141         input {\r
142             leaf near-rt-ric-id {\r
143                 type string;\r
144             }\r
145             leaf policy-type-id {\r
146                 type uint32;\r
147             }\r
148         }\r
149         output {\r
150             leaf code {\r
151                 type string;\r
152             }\r
153         }\r
154     }\r
155 \r
156     //Get an array of string policy instance ids\r
157     //Each item in the returned array will be regarded as one policy-instance-id.\r
158     rpc getPolicyInstances {\r
159         input {\r
160             leaf near-rt-ric-id {\r
161                 type string;\r
162             }\r
163             leaf policy-type-id {\r
164                 type uint32;\r
165             }\r
166         }\r
167 \r
168         output {\r
169             leaf-list policy-instance-id-list {\r
170                 type string;\r
171             }\r
172             leaf code {\r
173                 type string;\r
174             }\r
175         }\r
176     }\r
177 \r
178     //Create a policy instance\r
179     rpc createPolicyInstance {\r
180         input {\r
181             leaf near-rt-ric-id {\r
182                 type string;\r
183             }\r
184             leaf policy-type-id {\r
185                 type uint32;\r
186             }\r
187             leaf policy-instance-id {\r
188                 type string;\r
189             }\r
190             leaf policy-instance {\r
191                 type string;\r
192             }\r
193         }\r
194         output {\r
195             leaf code {\r
196                 type string;\r
197             }\r
198         }\r
199     }\r
200 \r
201     ///Get a policy instance\r
202     rpc getPolicyInstance {\r
203         input {\r
204             leaf near-rt-ric-id {\r
205                 type string;\r
206             }\r
207             leaf policy-type-id {\r
208                 type uint32;\r
209             }\r
210             leaf policy-instance-id {\r
211                 type string;\r
212             }\r
213         }\r
214         output {\r
215             leaf policy-instance {\r
216                 type string;\r
217             }\r
218             leaf code {\r
219                 type string;\r
220             }\r
221         }\r
222     }\r
223 \r
224     //Delete a policy instance\r
225     rpc deletePolicyInstance {\r
226         input {\r
227             leaf near-rt-ric-id {\r
228                 type string;\r
229             }\r
230             leaf policy-type-id {\r
231                 type uint32;\r
232             }\r
233             leaf policy-instance-id {\r
234                 type string;\r
235             }\r
236         }\r
237         output {\r
238             leaf code {\r
239                 type string;\r
240             }\r
241         }\r
242     }\r
243 \r
244     //Get the status for a policy instance\r
245     rpc getStatus {\r
246         input {\r
247             leaf near-rt-ric-id {\r
248                 type string;\r
249             }\r
250             leaf policy-type-id {\r
251                 type uint32;\r
252             }\r
253             leaf policy-instance-id {\r
254                 type string;\r
255             }\r
256         }\r
257         output {\r
258             leaf status {\r
259                 type string;\r
260             }\r
261             leaf code {\r
262                 type string;\r
263             }\r
264         }\r
265     }\r
266 }