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