Merge "fix oauth code"
[ccsdk/features.git] / sdnr / northbound / a1Adapter / model / src / main / yang / A1-ADAPTER-API.yang
1 module A1-ADAPTER-API {
2
3     namespace "org:onap:ccsdk";
4
5     prefix a1-adapter-api;
6
7     revision "2019-12-12" {
8         description
9         "Added standard output payload for all RPC's";
10     }
11
12     revision "2019-10-02" {
13         description
14         "A1 adapter for Frankfurt";
15     }
16
17     grouping a1-adapter-response {
18       leaf response-code {
19         type string;
20       }
21       leaf response-message {
22         type string;
23       }
24       description
25         "Response payload for A1 Adapter RPC's";
26     }
27
28     grouping a1-policy-instance-property {
29
30       description
31         "Properties as specified in the create_schema field of policy type in PUT payload";
32
33       leaf property-name {
34         type string {
35           length "1..64";
36         }
37         description
38           "Individual property name";
39       }
40       leaf property-value {
41         type string {
42           length "1..64";
43         }
44         description
45           "Value of the property";
46       }
47     }
48
49
50     grouping a1-policy-type-create-schema-property-statement {
51
52       leaf policy-statement {
53         type string {
54           length "1..64";
55         }
56         description
57           "Individual policy statement name";
58       }
59       leaf policy-statement-value {
60         type string {
61           length "1..64";
62         }
63         description
64           "Value of the policy statement";
65       }
66     }
67
68
69 ///Flattend interface using RPC
70
71     //Get a comma separated list of near-rt rics, e.g. domain-name1:port1,domainname2:port2
72     //Each item in the returned list will be regarded as one near-rt-ric-id.
73     rpc getNearRT-RICs {
74         // OpenDaylight Fluorine version of restconf cannot handle RPCs with no input
75         input {
76           leaf dummy {
77             type string;
78           }
79         }
80
81         output {
82             uses a1-adapter-response;
83             leaf-list near-rt-ric-id-list {
84                 type string;
85             }
86         }
87     }
88
89     //Get health status for a Near-RT-RIC. true - health ok, false - health is not ok.
90     rpc getHealthCheck {
91          input {
92             leaf near-rt-ric-id {
93                 type string;
94             }
95         }
96
97         output {
98             uses a1-adapter-response;
99             leaf health-status {
100                 type boolean;
101             }
102         }
103     }
104
105     //Get a comma separated list of integer policy type ids
106     //Each item in the returned list will be regarded as one policy-type-id.
107     rpc getPolicyTypes {
108         input {
109             leaf near-rt-ric-id {
110                 type string;
111             }
112         }
113         output {
114             uses a1-adapter-response;
115             leaf-list policy-type-id-list {
116                 type uint32;
117             }
118         }
119     }
120
121     //Create a policy type
122     rpc createPolicyType {
123         input {
124             leaf near-rt-ric-id {
125                 type string;
126             }
127             leaf policy-type-id {
128                 type uint32;
129             }
130             leaf description {
131                 type string;
132             }
133             leaf name {
134                 type string;
135             }
136             leaf policy-type {
137                 type string;
138             }
139             list properties {
140                 key "property-name";
141                 leaf property-name {
142                   type string {
143                     length "1..64";
144                   }
145                   description
146                     "Individual property name";
147                 }
148                 list policy-statements {
149                   key "policy-statement";
150                   uses a1-policy-type-create-schema-property-statement;
151                 }
152             }
153           }
154        output {
155             uses a1-adapter-response;
156             leaf status {
157                 type string;
158             }
159             leaf code {
160                 type string;
161             }
162         }
163     }
164
165     //Get a policy type
166     rpc getPolicyType {
167         input {
168             leaf near-rt-ric-id {
169                 type string;
170             }
171             leaf policy-type-id {
172                 type uint32;
173             }
174         }
175         output {
176             uses a1-adapter-response;
177             leaf description {
178                 type string;
179             }
180             leaf name {
181                 type string;
182             }
183             leaf policy-type {
184                 type string;
185             }
186         }
187     }
188
189     //Delete a policy type
190     rpc deletePolicyType {
191         input {
192             leaf near-rt-ric-id {
193                 type string;
194             }
195             leaf policy-type-id {
196                 type uint32;
197             }
198         }
199         output {
200             uses a1-adapter-response;
201             }
202     }
203
204     //Get a comma separeated list of string policy instance ids
205     //Each item in the returned list will be regarded as one policy-instance-id.
206     rpc getPolicyInstances {
207         input {
208             leaf near-rt-ric-id {
209                 type string;
210             }
211             leaf policy-type-id {
212                 type uint32;
213             }
214         }
215
216         output {
217             uses a1-adapter-response;
218             leaf-list policy-instance-id-list {
219                 type string;
220             }
221         }
222     }
223
224     //Create a policy instance
225     rpc createPolicyInstance {
226         input {
227             leaf near-rt-ric-id {
228                 type string;
229             }
230             leaf policy-type-id {
231                 type uint32;
232             }
233             leaf policy-instance-id {
234                 type string;
235             }
236             leaf policy-instance {
237                 type string;
238             }
239             list properties {
240                 key "property-name";
241                 uses a1-policy-instance-property;
242             }
243         }
244         output {
245         uses a1-adapter-response;
246           }
247     }
248
249     ///Get a policy instance
250     rpc getPolicyInstance {
251         input {
252             leaf near-rt-ric-id {
253                 type string;
254             }
255             leaf policy-type-id {
256                 type uint32;
257             }
258             leaf policy-instance-id {
259                 type string;
260             }
261         }
262         output {
263             uses a1-adapter-response;
264             leaf policy-instance {
265                 type string;
266             }
267         }
268     }
269
270     //Delete a policy instance
271     rpc deletePolicyInstance {
272         input {
273             leaf near-rt-ric-id {
274                 type string;
275             }
276             leaf policy-type-id {
277                 type uint32;
278             }
279             leaf policy-instance-id {
280                 type string;
281             }
282         }
283         output {
284            uses a1-adapter-response;
285         }
286     }
287
288     //Get the status for a policy instance
289     rpc getStatus {
290         input {
291             leaf near-rt-ric-id {
292                 type string;
293             }
294             leaf policy-type-id {
295                 type uint32;
296             }
297             leaf policy-instance-id {
298                 type string;
299             }
300         }
301         output {
302             uses a1-adapter-response;
303             leaf status {
304                 type string;
305             }
306         }
307     }
308
309     //Policy feedback Notification to provide policy enforcement update
310     rpc notifyPolicyEnforcementUpdate {
311         input {
312             leaf near-rt-ric-id {
313                 type string;
314             }
315             leaf policy-type-id {
316                 type uint32;
317             }
318             leaf policy-instance-id {
319                 type string;
320             }
321             leaf policy_enforcement_status {
322                 type string;
323                 description
324                   "Policy enforcement status - IN_EFFECT or NON_IN_EFFECT";
325             }
326             leaf policy_enforcement_reason {
327                 type string;
328                 description
329                   "Indicates the reason why policy is no longer being enforced";
330             }
331         }
332         output {
333             uses a1-adapter-response;
334         }
335     }
336
337
338
339
340 }