Migration to TAPI 2.4 Step2
[transportpce.git] / api / src / main / yang / nbi-notifications@2023-07-28.yang
1 module nbi-notifications {
2   yang-version 1.1;
3   namespace "nbi-notifications";
4   prefix nbinotifications;
5
6   import org-openroadm-service {
7     prefix oor-service;
8   }
9   import org-openroadm-common-service-types {
10     prefix org-openroadm-common-service-types;
11   }
12   import org-openroadm-common-state-types {
13     prefix org-openroadm-common-state-types;
14   }
15   import org-openroadm-resource {
16     prefix org-openroadm-resource;
17   }
18   import tapi-common {
19     prefix tapi-common;
20     revision-date 2022-11-21;
21    }
22   import tapi-notification {
23     prefix tapi-notification;
24     revision-date 2022-11-21;
25   }
26   import tapi-fm {
27     prefix tapi-fm;
28     revision-date 2022-11-21;
29   }
30
31   organization
32     "transportPCE";
33   contact
34     "transportPCE committers - ODL";
35   description
36     "YANG definitions for using REST API in NBI notifications module. Copyright
37      (c) 2020 ORANGE and others. All rights reserved.";
38
39   revision "2023-07-28" {
40     description
41       "Migration towards TAPI 2.4";
42   }
43
44   revision 2023-07-26 {
45       description
46         "Adding service-rpc-result data details to the publish-notification-process-service";
47   }
48
49   revision 2021-10-13 {
50     description
51       "Implement new models, RPC for TAPI service notification";
52   }
53
54   revision 2023-07-26 {
55       description
56         "Adding service-rpc-result data details to the publish-notification-process-service";
57   }
58
59   revision 2021-08-13 {
60     description
61       "Rename the groupings, containers and RPCs";
62   }
63
64   revision 2021-06-28 {
65     description
66       "Implement new models, RPC for service alarms";
67   }
68
69   revision 2020-11-30 {
70     description
71       "Initial revision of NBI notifications";
72   }
73
74   grouping notification-process-service {
75     leaf message {
76       type string;
77       mandatory true;
78       description
79         "Message for the specified service";
80     }
81     leaf service-name {
82       type string;
83       mandatory true;
84       description
85         "Identifier for the service to be created in the ROADM network, e.g., CLFI, CLCI, etc.
86         This is reported against the service, but may not get reflected in the service in the network.";
87     }
88     leaf common-id {
89       type string;
90       description
91         "To be used by the ROADM controller to identify the routing constraints
92         received from planning application (PED).";
93     }
94     leaf connection-type {
95       type org-openroadm-common-service-types:connection-type;
96       mandatory true;
97     }
98     container service-a-end {
99       uses org-openroadm-common-service-types:service-endpoint;
100     }
101     container service-z-end {
102       uses org-openroadm-common-service-types:service-endpoint;
103     }
104     leaf response-failed {
105       type string;
106       description
107         "Response of the error if the service request encountered an anomaly";
108     }
109     leaf operational-state {
110       type org-openroadm-common-state-types:state;
111       config false;
112       description
113         "Operational State: Actual state of service";
114     }
115     leaf is-temp-service {
116       type boolean;
117       default "false";
118       description
119         "Used to indicate if the it is a temp-service or not";
120     }
121     container aToZ {
122       when "../is-temp-service = 'true'" {
123         description
124             "a-to-z is only used for temp-service-cerate";
125         }
126         uses org-openroadm-resource:common-och-otsi-attributes;
127         uses org-openroadm-resource:path-computation-outputs;
128     }
129     container zToA {
130       when "../is-temp-service = 'true'" {
131         description
132               "a-to-z is only used for temp-service-cerate";
133         }
134       uses org-openroadm-resource:common-och-otsi-attributes;
135       uses org-openroadm-resource:path-computation-outputs;
136     }
137   }
138   grouping notification-alarm-service {
139     leaf message {
140       type string;
141       mandatory true;
142       description
143         "Message for the specified service";
144     }
145     leaf service-name {
146       type string;
147       mandatory true;
148       description
149         "Identifier for the service to be created in the ROADM network, e.g., CLFI, CLCI, etc.
150         This is reported against the service, but may not get reflected in the service in the network.";
151     }
152     leaf connection-type {
153       type org-openroadm-common-service-types:connection-type;
154       mandatory true;
155     }
156     leaf operational-state {
157       type org-openroadm-common-state-types:state;
158       config false;
159       description
160         "Operational State: Actual state of service";
161     }
162   }
163
164   grouping alarm-tca-info {
165     container alarm-info {
166       uses tapi-fm:alarm-info;
167       description "none";
168     }
169     container tca-info {
170       uses tapi-fm:tca-info;
171       description "none";
172     }
173   }
174
175   grouping notification-tapi-service {
176       leaf notification-type {
177         type tapi-notification:notification-type;
178         description "none";
179       }
180       leaf target-object-type {
181         type tapi-common:object-type;
182         description "none";
183       }
184       leaf target-object-identifier {
185         type tapi-common:uuid;
186         description "none";
187       }
188       list target-object-name {
189         key 'value-name';
190         min-elements 1;
191         uses tapi-common:name-and-value;
192         description "none";
193       }
194       leaf event-time-stamp {
195         type tapi-common:date-and-time;
196         description "none";
197       }
198       leaf sequence-number {
199         type uint64;
200         config false;
201         description "A monotonous increasing sequence number associated with the notification.
202             The exact semantics of how this sequence number is assigned (per channel or subscription or source or system) is left undefined.";
203       }
204       leaf source-indicator {
205         type tapi-notification:source-indicator;
206         description "none";
207       }
208       leaf layer-protocol-name {
209         type tapi-common:layer-protocol-name;
210         description "none";
211       }
212       leaf layer-protocol-qualifier {
213         type tapi-common:layer-protocol-qualifier;
214         config false;
215         description "none";
216         }
217       list changed-attributes {
218         key 'value-name';
219         uses tapi-notification:name-and-value-change;
220         description "none";
221       }
222       list additional-info {
223         key 'value-name';
224         uses tapi-common:name-and-value;
225         description "none";
226       }
227       leaf additional-text {
228         type string;
229         description "none";
230       }
231       uses alarm-tca-info;
232       uses tapi-common:global-class;
233       description "none";
234     }
235
236   container notification-process-service {
237     description
238       "Model used to send a notification from a service request";
239     uses notification-process-service;
240   }
241
242   container notification-alarm-service {
243     description
244       "Model used to send a notification from the service listener";
245     uses notification-alarm-service;
246     }
247
248   container notification-tapi-service {
249       description
250         "Model used to send a tapi notification";
251       uses notification-tapi-service;
252     }
253
254   rpc get-notifications-process-service {
255     description "Get the notifications service sent by ServiceHandler through filtering connection type";
256     input {
257       leaf connection-type {
258         type org-openroadm-common-service-types:connection-type;
259         mandatory true;
260         description
261           "Type connection of the service ";
262       }
263       leaf id-consumer {
264         type string;
265         mandatory true;
266         description
267           "Unique ID for the consumer";
268       }
269       leaf group-id {
270         type string;
271         mandatory true;
272         description
273           "ID Group for the consumer";
274       }
275     }
276     output {
277       list notifications-process-service {
278         uses notification-process-service;
279       }
280     }
281   }
282
283   rpc get-notifications-alarm-service {
284     description "Get the notifications alarm service sent by ServiceListener through filtering connection type";
285     input {
286       leaf connection-type {
287         type org-openroadm-common-service-types:connection-type;
288         mandatory true;
289         description
290           "Type connection of the service";
291       }
292       leaf id-consumer {
293         type string;
294         mandatory true;
295         description
296           "Unique ID for the consumer";
297       }
298       leaf group-id {
299         type string;
300         mandatory true;
301         description
302           "ID Group for the consumer";
303       }
304     }
305     output {
306       list notifications-alarm-service {
307         uses notification-alarm-service;
308       }
309     }
310   }
311
312   notification publish-notification-process-service {
313     description "Publish the notifications service through a publisher";
314     leaf publisher-name {
315       type string;
316       mandatory true;
317       description
318         "Name of the publisher";
319      }
320      uses notification-process-service;
321   }
322
323   notification publish-notification-alarm-service {
324     description "Publish the notifications service alarm through a publisher";
325     leaf publisher-name {
326       type string;
327       mandatory true;
328       description
329         "Name of the publisher";
330      }
331      uses notification-alarm-service;
332   }
333
334   notification publish-tapi-notification-service {
335     description "Publish the TAPI notifications service for topic";
336     leaf topic {
337       type string;
338       mandatory true;
339       description
340         "Topic where to send the notification service";
341     }
342     uses alarm-tca-info;
343     uses tapi-notification:notification;
344   }
345 }