4bed2f803ff2ce422943ae979fd7f080d4978902
[transportpce.git] / api / src / main / yang / nbi-notifications@2021-08-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     revision-date 2019-05-31;
9   }
10   import org-openroadm-common-service-types {
11     prefix org-openroadm-common-service-types;
12     revision-date 2019-05-31;
13   }
14   import org-openroadm-common-state-types {
15     prefix org-openroadm-common-state-types;
16     revision-date 2018-11-30;
17   }
18
19   organization
20     "transportPCE";
21   contact
22     "transportPCE committers - ODL";
23   description
24     "YANG definitions for using REST API in NBI notifications module. Copyright
25      (c) 2020 ORANGE and others. All rights reserved.";
26
27   revision 2021-08-13 {
28     description
29       "Rename the groupings, containers and RPCs";
30   }
31
32   revision 2021-06-28 {
33     description
34       "Implement new models, RPC for service alarms";
35   }
36
37   revision 2020-11-30 {
38     description
39       "Initial revision of NBI notifications";
40   }
41
42   grouping notification-process-service {
43     leaf message {
44       type string;
45       mandatory true;
46       description
47         "Message for the specified service";
48     }
49     leaf service-name {
50       type string;
51       mandatory true;
52       description
53         "Identifier for the service to be created in the ROADM network, e.g., CLFI, CLCI, etc.
54         This is reported against the service, but may not get reflected in the service in the network.";
55     }
56     leaf common-id {
57       type string;
58       description
59         "To be used by the ROADM controller to identify the routing constraints
60         received from planning application (PED).";
61     }
62     leaf connection-type {
63       type org-openroadm-common-service-types:connection-type;
64       mandatory true;
65     }
66     container service-a-end {
67       uses org-openroadm-common-service-types:service-endpoint;
68     }
69     container service-z-end {
70       uses org-openroadm-common-service-types:service-endpoint;
71     }
72     leaf response-failed {
73       type string;
74       description
75         "Response of the error if the service request encountered an anomaly";
76     }
77     leaf operational-state {
78       type org-openroadm-common-state-types:state;
79       config false;
80       description
81         "Operational State: Actual state of service";
82     }
83   }
84
85   grouping notification-alarm-service {
86     leaf message {
87       type string;
88       mandatory true;
89       description
90         "Message for the specified service";
91     }
92     leaf service-name {
93       type string;
94       mandatory true;
95       description
96         "Identifier for the service to be created in the ROADM network, e.g., CLFI, CLCI, etc.
97         This is reported against the service, but may not get reflected in the service in the network.";
98     }
99     leaf connection-type {
100       type org-openroadm-common-service-types:connection-type;
101       mandatory true;
102     }
103     leaf operational-state {
104       type org-openroadm-common-state-types:state;
105       config false;
106       description
107         "Operational State: Actual state of service";
108     }
109   }
110
111   container notification-process-service {
112     description
113       "Model used to send a notification from a service request";
114     uses notification-process-service;
115   }
116
117   container notification-alarm-service {
118     description
119       "Model used to send a notification from the service listener";
120     uses notification-alarm-service;
121     }
122
123   rpc get-notifications-process-service {
124     description "Get the notifications service sent by ServiceHandler through filtering connection type";
125     input {
126       leaf connection-type {
127         type org-openroadm-common-service-types:connection-type;
128         mandatory true;
129         description
130           "Type connection of the service ";
131       }
132       leaf id-consumer {
133         type string;
134         mandatory true;
135         description
136           "Unique ID for the consumer";
137       }
138       leaf group-id {
139         type string;
140         mandatory true;
141         description
142           "ID Group for the consumer";
143       }
144     }
145     output {
146       list notifications-process-service {
147         uses notification-process-service;
148       }
149     }
150   }
151
152   rpc get-notifications-alarm-service {
153     description "Get the notifications alarm service sent by ServiceListener through filtering connection type";
154     input {
155       leaf connection-type {
156         type org-openroadm-common-service-types:connection-type;
157         mandatory true;
158         description
159           "Type connection of the service";
160       }
161       leaf id-consumer {
162         type string;
163         mandatory true;
164         description
165           "Unique ID for the consumer";
166       }
167       leaf group-id {
168         type string;
169         mandatory true;
170         description
171           "ID Group for the consumer";
172       }
173     }
174     output {
175       list notifications-alarm-service {
176         uses notification-alarm-service;
177       }
178     }
179   }
180
181   notification publish-notification-process-service {
182     description "Publish the notifications service through a publisher";
183     leaf publisher-name {
184       type string;
185       mandatory true;
186       description
187         "Name of the publisher";
188      }
189      uses notification-process-service;
190   }
191
192   notification publish-notification-alarm-service {
193     description "Publish the notifications service alarm through a publisher";
194     leaf publisher-name {
195       type string;
196       mandatory true;
197       description
198         "Name of the publisher";
199      }
200      uses notification-alarm-service;
201   }
202 }