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