Merge "Update tox documentation link in tox-guide"
[transportpce.git] / api / src / main / yang / service_path / transportpce-pce@2022-08-08.yang
1 module transportpce-pce {
2   namespace "http://org/opendaylight/transportpce/pce";
3   prefix org-opendaylight-transportpce-pce;
4
5   import org-openroadm-routing-constraints {
6     prefix org-openroadm-routing-constraints;
7   }
8   import org-openroadm-common-service-types {
9     prefix org-openroadm-common-service-types;
10   }
11   import transportpce-common-service-path-types {
12     prefix transportpce-common-service-path-types;
13   }
14   import transportpce-pathDescription {
15     prefix transportpce-pathDescription;
16   }
17   import gnpy-path-computation-simplified {
18     prefix gnpypc;
19   }
20
21   organization
22     "transportPCE";
23   contact
24     "transportPCE committers - ODL";
25   description
26     "YANG definitions of B interface (transportPCE). Adapted from service definition (openroadm)
27      Copyright © 2017 Orange, Inc. and others.  All rights reserved.
28
29      openroadm copyright:
30       Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
31       AT&T Intellectual Property.  All other rights reserved.
32
33       Redistribution and use in source and binary forms, with or without modification,
34       are permitted provided that the following conditions are met:
35
36       * Redistributions of source code must retain the above copyright notice, this
37         list of conditions and the following disclaimer.
38       * Redistributions in binary form must reproduce the above copyright notice,
39         this list of conditions and the following disclaimer in the documentation and/or
40         other materials provided with the distribution.
41       * Neither the Members of the Open ROADM MSA Agreement nor the names of its
42         contributors may be used to endorse or promote products derived from this software
43         without specific prior written permission.
44
45       THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
46       AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
47       WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
48       IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
49       INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
50       NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
51       OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
52       WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
53       ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
54       POSSIBILITY OF SUCH DAMAGE";
55
56
57   revision 2022-08-08 {
58     description
59       "Implement the RPC path-computation-reroute-request (only for reroute purposes) that computes a service path of
60       an existing service in order to reroute it";
61   }
62   revision 2022-06-15 {
63     description
64       "change fraction digits from 2 to 6 for accumulative-value leaf, from 2 to 6 to be compliant with Gnpy";
65   }
66   revision 2022-01-18 {
67     description
68       "Add in path-computation-request input the pce-routing-metric.
69        Replace transportpce-routing-constraints by org-openroadm-routing-constraints";
70   }
71   revision 2021-07-01 {
72     description
73       "Version 1.8";
74   }
75   revision 2020-01-28 {
76     description
77       "Version 1.7";
78   }
79   revision 2019-06-24 {
80     description
81       "Version 1.6.1";
82   }
83   revision 2017-10-17 {
84     description
85       "Version 1.6";
86   }
87   revision 2017-04-26 {
88     description
89       "Version 1.5";
90   }
91
92   grouping stubpce-path-description {
93     leaf path-name {
94       type string;
95       mandatory true;
96       description
97         "Identifier for the pathDescription to be created in the ROADM
98          network, e.g., CLFI, CLCI, etc.";
99     }
100     uses transportpce-pathDescription:path-description;
101   }
102
103   grouping gnpy {
104     list gnpy-response {
105       key "path-dir";
106       config false;
107       description
108         "GNPy response";
109       leaf path-dir {
110         type string;
111         description
112           "A-to-Z or Z-to-A";
113       }
114       leaf feasibility {
115         type boolean;
116         description
117           "true : feasible path / False : non-feasible.";
118       }
119       choice response-type {
120         config false;
121         description
122           "response-type";
123         case no-path-case {
124           uses gnpypc:no-path-info;
125         }
126         case path-case {
127           description
128             "Path computation service.";
129           uses path-performance;
130         }
131       }
132     }
133   }
134
135   grouping path-performance {
136     description
137       "TE generic path properties grouping";
138     container path-properties {
139       config false;
140       description
141         "The TE path properties";
142       list path-metric {
143         key "metric-type";
144         description
145           "TE path metric type";
146         leaf metric-type {
147           type identityref {
148             base gnpypc:path-metric-type;
149           }
150         }
151         leaf accumulative-value {
152           type decimal64 {
153             fraction-digits 6;
154           }
155         }
156       }
157     }
158   }
159
160   rpc path-computation-request {
161     input {
162       leaf service-name {
163         type string;
164         mandatory true;
165         description
166           "Identifier for the service to be created in the ROADM network,
167            e.g., CLFI, CLCI, etc. This is reported against the service, but
168            may not get reflected in the service in the network.";
169       }
170       leaf resource-reserve {
171         type boolean;
172         mandatory true;
173         description
174           "indicates if resources (from local PCE topology) must be reserved
175            until further notice (cancel-resource-reserve or topology update)";
176       }
177       leaf pce-routing-metric {
178         type transportpce-common-service-path-types:pce-metric;
179       }
180       uses transportpce-common-service-path-types:service-handler-header;
181       container service-a-end {
182         uses transportpce-common-service-path-types:service-endpoint-sp;
183       }
184       container service-z-end {
185         uses transportpce-common-service-path-types:service-endpoint-sp;
186       }
187       uses org-openroadm-routing-constraints:routing-constraints;
188       uses org-openroadm-common-service-types:routing-metric;
189     }
190     output {
191       uses org-openroadm-common-service-types:configuration-response-common;
192       uses transportpce-common-service-path-types:response-parameters-sp;
193       uses gnpy;
194     }
195   }
196
197   rpc path-computation-reroute-request {
198     input {
199       container endpoints {
200         description
201           "Indicates the endpoints termination-point of the service to reroute";
202         leaf a-end-tp {
203           mandatory true;
204           type string;
205         }
206         leaf z-end-tp {
207           mandatory true;
208           type string;
209         }
210       }
211       leaf pce-routing-metric {
212         type transportpce-common-service-path-types:pce-metric;
213       }
214       uses transportpce-common-service-path-types:service-handler-header;
215       container service-a-end {
216         uses transportpce-common-service-path-types:service-endpoint-sp;
217       }
218       container service-z-end {
219         uses transportpce-common-service-path-types:service-endpoint-sp;
220       }
221       uses org-openroadm-routing-constraints:routing-constraints;
222       uses org-openroadm-common-service-types:routing-metric;
223     }
224     output {
225        uses org-openroadm-common-service-types:configuration-response-common;
226     }
227   }
228
229   rpc cancel-resource-reserve {
230     input {
231       leaf service-name {
232         type string;
233         mandatory true;
234       }
235       uses transportpce-common-service-path-types:service-handler-header;
236     }
237     output {
238       uses org-openroadm-common-service-types:configuration-response-common;
239     }
240   }
241
242   notification service-path-rpc-result {
243     description
244       "This Notification indicates result of  service RPC";
245     leaf notification-type {
246       type transportpce-common-service-path-types:service-path-notification-types;
247     }
248     container path-description {
249       uses transportpce-pathDescription:path-description;
250     }
251     uses transportpce-common-service-path-types:rpc-response-status-ex;
252     uses org-openroadm-common-service-types:service-notification-result;
253     uses org-openroadm-common-service-types:routing-metric;
254   }
255
256   container path-description-list {
257     description
258       "List of pathDescription. Can only be created, deleted, modified,
259        etc. using special RPCs.";
260     list pathDescriptions {
261       key "path-name";
262       uses stubpce-path-description;
263     }
264   }
265
266   container spectrum-assignment {
267     description
268       "Spectrum assignment management using index steps and flexgrid property";
269     leaf begin-index {
270       type uint16;
271       mandatory true;
272       description
273         "Begin index of spectrum assignment";
274     }
275     leaf stop-index {
276       type uint16;
277       mandatory true;
278       description
279         "End index of spectrum assignment";
280     }
281     leaf flex-grid {
282       type boolean;
283       mandatory true;
284       description
285         "Set it to true for flexgrid, false otherwise";
286     }
287   }
288 }