Remove transportpce-routing-constraint model
[transportpce.git] / api / src / main / yang / service_path / transportpce-common-service-path-types@2022-01-18.yang
1 module transportpce-common-service-path-types {
2   namespace "http://org/transportpce/B-C-interface/service/types";
3   prefix transportpce-common-service-path-types;
4
5   import org-openroadm-routing-constraints {
6     prefix org-openroadm-routing-constraints;
7   }
8   import transportpce-pathDescription {
9     prefix transportpce-pathDescription;
10   }
11   import org-openroadm-otn-common-types {
12     prefix org-openroadm-otn-common-types;
13   }
14   import org-openroadm-resource-types {
15     prefix org-openroadm-resource-types;
16     revision-date 2018-11-30;
17   }
18   import org-openroadm-common-service-types {
19     prefix org-openroadm-common-service-types;
20     revision-date 2019-05-31;
21   }
22   import org-openroadm-service-format {
23     prefix org-openroadm-service-format;
24     revision-date 2019-05-31;
25   }
26
27   organization
28     "transportPCE";
29   contact
30     "transportPCE committers - ODL";
31   description
32     "YANG definitions of B & C interfaces (transportPCE). Adapted from service definition (openroadm)
33      Copyright ©  2017 Orange, Inc. and others.  All rights reserved.
34
35      openroadm copyright:
36       Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
37       AT&T Intellectual Property.  All other rights reserved.
38
39       Redistribution and use in source and binary forms, with or without modification,
40       are permitted provided that the following conditions are met:
41
42       * Redistributions of source code must retain the above copyright notice, this
43         list of conditions and the following disclaimer.
44       * Redistributions in binary form must reproduce the above copyright notice,
45         this list of conditions and the following disclaimer in the documentation and/or
46         other materials provided with the distribution.
47       * Neither the Members of the Open ROADM MSA Agreement nor the names of its
48         contributors may be used to endorse or promote products derived from this software
49         without specific prior written permission.
50
51       THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
52       AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
53       WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
54       IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
55       INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
56       NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
57       OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
58       WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
59       ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
60       POSSIBILITY OF SUCH DAMAGE";
61
62   revision 2022-01-18 {
63     description
64       "Add typedef pce-metric.
65        Replace transportpce-routing-constraints by org-openroadm-routing-constraints.";
66   }
67
68   revision 2020-01-28 {
69     description
70       "Version 1.7";
71     // General consolidation to handle OTN and ONAP MDONS use case
72   }
73   revision 2019-10-09 {
74     description
75       "Version 1.6.1";
76   }
77   revision 2017-10-16 {
78     description
79       "Version 1.6";
80   }
81   revision 2017-04-26 {
82     description
83       "Version 1.5";
84   }
85
86   typedef pce-metric {
87     type enumeration {
88       enum hop-count {
89         value 1;
90       }
91       enum propagation-delay {
92         value 2;
93       }
94       enum TE-metric {
95         value 3;
96       }
97       enum IGP-metric {
98         value 4;
99       }
100     }
101   }
102
103   typedef service-path-notification-types {
104     type enumeration {
105       enum path-computation-request {
106         value 1;
107       }
108       enum cancel-resource-reserve {
109         value 2;
110       }
111       enum service-implementation-request {
112         value 3;
113       }
114       enum service-delete {
115         value 4;
116       }
117     }
118   }
119
120   typedef rpc-status-ex {
121     type enumeration {
122       enum Successful {
123         value 1;
124       }
125       enum Failed {
126         value 2;
127       }
128       enum Pending {
129         value 3;
130       }
131     }
132     description
133       "extended status of RPC ";
134   }
135
136   grouping rpc-response-status-ex {
137     leaf status {
138       type rpc-status-ex;
139       mandatory true;
140       description
141         "Successful, Failed or Pending";
142     }
143     leaf status-message {
144       type string;
145       description
146         "Gives a more detailed reason for failure";
147     }
148   }
149
150   grouping response-parameters-sp {
151     container response-parameters {
152       uses org-openroadm-routing-constraints:routing-constraints;
153       container path-description {
154         uses transportpce-pathDescription:path-description;
155       }
156     }
157   }
158
159   grouping service-endpoint-sp {
160     leaf service-format {
161       type org-openroadm-service-format:service-format;
162       mandatory true;
163       description
164         "Format of the requested service: Ethernet, OTU, etc.";
165     }
166     leaf service-rate {
167       when "../service-format!='OMS'" {
168         description
169           "service rate not applicable when service format is roadmline";
170       }
171       type uint32;
172       mandatory true;
173       description
174         "Rate of the requested service in GBps";
175     }
176     leaf otu-service-rate {
177       when "../service-format='OTU'" {
178         description
179           "service rate not applicable when service format is OTU";
180       }
181       type identityref {
182         base org-openroadm-otn-common-types:otu-rate-identity;
183       }
184       mandatory false;
185       description
186         "OTU Rate of the requested service";
187     }
188     leaf odu-service-rate {
189       when "../service-format='ODU'" {
190         description
191           "service rate not applicable when service format is ODU";
192       }
193       type identityref {
194         base org-openroadm-otn-common-types:odu-rate-identity;
195       }
196       mandatory false;
197       description
198         "OTU Rate of the requested service";
199     }
200     leaf other-service-format-and-rate {
201       type string;
202       description
203         "This value encodes both the service format and the rate supported.
204          This field should not be specified when service format != other.";
205     }
206     leaf clli {
207       type string;
208       mandatory true;
209       description
210         "CLLI";
211     }
212     leaf node-id {
213       type string;
214     }
215     container tx-direction {
216       leaf logical-connection-point {
217         type string;
218         description
219           "PCE works on topology --> change from port (device) to node-id+logical-connection-point
220            (topology) assuming Portmapping will be used by both the Renderer
221            and the SH to make the conversion from device to topology";
222       }
223       uses org-openroadm-common-service-types:service-port;
224       //     uses service-lgx;
225       //     uses service-tail;
226     }
227     container rx-direction {
228       leaf logical-connection-point {
229         type string;
230         description
231           "PCE works on topology --> change from port (device) to node-id+logical-connection-point
232            (topology) assuming Portmapping will be used by both the Renderer
233            and the SH to make the conversion from device to topology";
234       }
235       uses org-openroadm-common-service-types:service-port;
236       //     uses service-lgx;
237       //     uses service-tail;
238     }
239   }
240
241   grouping service-handler-header {
242     container service-handler-header {
243       leaf request-id {
244         type string;
245         mandatory true;
246       }
247     }
248   }
249
250   grouping service-path {
251     leaf service-path-name {
252       type string;
253       mandatory true;
254       description
255         "Identifier for the service-path to be calculated by the PCE";
256     }
257     uses service-handler-header;
258     container service-a-end {
259       uses service-endpoint-sp;
260     }
261     container service-z-end {
262       uses service-endpoint-sp;
263     }
264     leaf pce-routing-metric {
265       type pce-metric;
266     }
267     uses org-openroadm-routing-constraints:routing-constraints;
268     leaf latency {
269       type uint32;
270       description
271         "Latency on service";
272     }
273     leaf-list fiber-span-srlgs {
274       type string;
275       description
276         "Shared risk link group identifiers";
277     }
278     list equipment-srgs {
279       key "srg-number";
280       uses org-openroadm-resource-types:srg-number;
281     }
282     leaf-list supporting-service-name {
283       type string;
284       description
285         "The service name that this runs over top. If connection-type is service, then this is the related
286          connection-type = infrastructure service, for example.";
287     }
288     container path-description {
289       uses transportpce-pathDescription:path-description;
290     }
291   }
292 }