Remove transportpce-routing-constraint model
[transportpce.git] / api / src / main / yang / service_path / transportpce-pce@2022-01-18.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   revision 2022-01-18 {
57     description
58       "Add in path-computation-request input the pce-routing-metric.
59        Replace transportpce-routing-constraints by org-openroadm-routing-constraints";
60   }
61   revision 2021-07-01 {
62     description
63       "Version 1.8";
64   }
65   revision 2020-01-28 {
66     description
67       "Version 1.7";
68   }
69   revision 2019-06-24 {
70     description
71       "Version 1.6.1";
72   }
73   revision 2017-10-17 {
74     description
75       "Version 1.6";
76   }
77   revision 2017-04-26 {
78     description
79       "Version 1.5";
80   }
81
82   grouping stubpce-path-description {
83     leaf path-name {
84       type string;
85       mandatory true;
86       description
87         "Identifier for the pathDescription to be created in the ROADM
88          network, e.g., CLFI, CLCI, etc.";
89     }
90     uses transportpce-pathDescription:path-description;
91   }
92
93   grouping gnpy {
94     list gnpy-response {
95       key "path-dir";
96       config false;
97       description
98         "GNPy response";
99       leaf path-dir {
100         type string;
101         description
102           "A-to-Z or Z-to-A";
103       }
104       leaf feasibility {
105         type boolean;
106         description
107           "true : feasible path / False : non-feasible.";
108       }
109       choice response-type {
110         config false;
111         description
112           "response-type";
113         case no-path-case {
114           uses gnpypc:no-path-info;
115         }
116         case path-case {
117           description
118             "Path computation service.";
119           uses path-performance;
120         }
121       }
122     }
123   }
124
125   grouping path-performance {
126     description
127       "TE generic path properties grouping";
128     container path-properties {
129       config false;
130       description
131         "The TE path properties";
132       list path-metric {
133         key "metric-type";
134         description
135           "TE path metric type";
136         leaf metric-type {
137           type identityref {
138             base gnpypc:path-metric-type;
139           }
140         }
141         leaf accumulative-value {
142           type decimal64 {
143             fraction-digits 2;
144           }
145         }
146       }
147     }
148   }
149
150   rpc path-computation-request {
151     input {
152       leaf service-name {
153         type string;
154         mandatory true;
155         description
156           "Identifier for the service to be created in the ROADM network,
157            e.g., CLFI, CLCI, etc. This is reported against the service, but
158            may not get reflected in the service in the network.";
159       }
160       leaf resource-reserve {
161         type boolean;
162         mandatory true;
163         description
164           "indicates if resources (from local PCE topology) must be reserved
165            until further notice (cancel-resource-reserve or topology update)";
166       }
167       leaf pce-routing-metric {
168         type transportpce-common-service-path-types:pce-metric;
169       }
170       uses transportpce-common-service-path-types:service-handler-header;
171       container service-a-end {
172         uses transportpce-common-service-path-types:service-endpoint-sp;
173       }
174       container service-z-end {
175         uses transportpce-common-service-path-types:service-endpoint-sp;
176       }
177       uses org-openroadm-routing-constraints:routing-constraints;
178       uses org-openroadm-common-service-types:routing-metric;
179     }
180     output {
181       uses org-openroadm-common-service-types:configuration-response-common;
182       uses transportpce-common-service-path-types:response-parameters-sp;
183       uses gnpy;
184     }
185   }
186
187   rpc cancel-resource-reserve {
188     input {
189       leaf service-name {
190         type string;
191         mandatory true;
192       }
193       uses transportpce-common-service-path-types:service-handler-header;
194     }
195     output {
196       uses org-openroadm-common-service-types:configuration-response-common;
197     }
198   }
199
200   notification service-path-rpc-result {
201     description
202       "This Notification indicates result of  service RPC";
203     leaf notification-type {
204       type transportpce-common-service-path-types:service-path-notification-types;
205     }
206     container path-description {
207       uses transportpce-pathDescription:path-description;
208     }
209     uses transportpce-common-service-path-types:rpc-response-status-ex;
210     uses org-openroadm-common-service-types:service-notification-result;
211     uses org-openroadm-common-service-types:routing-metric;
212   }
213
214   container path-description-list {
215     description
216       "List of pathDescription. Can only be created, deleted, modified,
217        etc. using special RPCs.";
218     list pathDescriptions {
219       key "path-name";
220       uses stubpce-path-description;
221     }
222   }
223
224   container spectrum-assignment {
225     description
226       "Spectrum assignment management using index steps and flexgrid property";
227     leaf begin-index {
228       type uint16;
229       mandatory true;
230       description
231         "Begin index of spectrum assignment";
232     }
233     leaf stop-index {
234       type uint16;
235       mandatory true;
236       description
237         "End index of spectrum assignment";
238     }
239     leaf flex-grid {
240       type boolean;
241       mandatory true;
242       description
243         "Set it to true for flexgrid, false otherwise";
244     }
245   }
246 }