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