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