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