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