aa068cd5317735db48d50f6ae2ab5c6273557a79
[transportpce.git] / api / src / main / yang / nbi-notifications@2020-11-30.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 2020-11-30 {
28     description
29       "Initial revision of NBI notifications";
30   }
31
32   grouping notification-service {
33     leaf message {
34       type string;
35       mandatory true;
36       description
37         "Message for the specified service";
38     }
39     leaf service-name {
40       type string;
41       mandatory true;
42       description
43         "Identifier for the service to be created in the ROADM network, e.g., CLFI, CLCI, etc.
44         This is reported against the service, but may not get reflected in the service in the network.";
45     }
46     leaf common-id {
47       type string;
48       description
49         "To be used by the ROADM controller to identify the routing constraints
50         received from planning application (PED).";
51     }
52     leaf connection-type {
53       type org-openroadm-common-service-types:connection-type;
54       mandatory true;
55     }
56     container service-a-end {
57       uses org-openroadm-common-service-types:service-endpoint;
58     }
59     container service-z-end {
60       uses org-openroadm-common-service-types:service-endpoint;
61     }
62     leaf response-failed {
63       type string;
64       description
65         "Response of the error if the service request encountered an anomaly";
66     }
67     leaf operational-state {
68       type org-openroadm-common-state-types:state;
69       config false;
70       description
71         "Operational State: Actual state of service";
72     }
73   }
74
75   container notification-service {
76     description
77       "Model used to send a notification from a service request";
78     uses notification-service;
79   }
80
81   rpc get-notifications-service {
82     description "Get the notifications service send by ServiceHandler by filtering through connection type";
83     input {
84       leaf connection-type {
85         type org-openroadm-common-service-types:connection-type;
86         mandatory true;
87         description
88           "Type connection of the service ";
89       }
90       leaf id-consumer {
91         type string;
92         mandatory true;
93         description
94           "Unique ID for the consumer";
95       }
96       leaf group-id {
97         type string;
98         mandatory true;
99         description
100           "ID Group for the consumer";
101       }
102     }
103     output {
104       list notification-service {
105         uses notification-service;
106       }
107     }
108   }
109
110   notification publish-notification-service {
111     description "Publish the notifications service for topic";
112     leaf topic {
113       type string;
114       mandatory true;
115       description
116         "Topic where to send the notification service";
117      }
118      uses notification-service;
119   }
120 }