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