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