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