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