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