Refactor transportpce-routing-constraint model
[transportpce.git] / api / src / main / yang / service_path / transportpce-routing-constraints@2022-01-18.yang
1 module transportpce-routing-constraints {
2   namespace "http://org/transportpce/B-C-interface/routing/constraints";
3   prefix transportpce-routing-constraints;
4
5   organization
6     "transportPCE";
7   contact
8     "transportPCE committers - ODL";
9   description
10     "YANG definitions of B interface (transportPCE). Adapted from service definition (openroadm)
11      Copyright ©  2017 Orange, Inc. and others.  All rights reserved.
12      openroadm copyright:
13       Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
14       AT&T Intellectual Property.  All other rights reserved.
15
16       Redistribution and use in source and binary forms, with or without modification,
17       are permitted provided that the following conditions are met:
18
19       * Redistributions of source code must retain the above copyright notice, this
20         list of conditions and the following disclaimer.
21       * Redistributions in binary form must reproduce the above copyright notice,
22         this list of conditions and the following disclaimer in the documentation and/or
23         other materials provided with the distribution.
24       * Neither the Members of the Open ROADM MSA Agreement nor the names of its
25         contributors may be used to endorse or promote products derived from this software
26         without specific prior written permission.
27
28       THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
29       AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
30       WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
31       IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
32       INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
33       NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
34       OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
35       WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36       ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37       POSSIBILITY OF SUCH DAMAGE";
38
39   revision 2022-01-18 {
40     description
41       "Remove pce-metric from routing-constraint-sp";
42   }
43   revision 2017-10-17 {
44     description
45       "Version 1.6";
46   }
47   revision 2017-04-26 {
48     description
49       "Version 1.5";
50   }
51
52   grouping common-constraints-sp {
53     leaf-list SRLG {
54       type string;
55     }
56     leaf-list clli {
57       type string;
58     }
59     leaf-list node-id {
60       type string;
61     }
62   }
63
64   grouping ordered-constraints-sp {
65     description
66       "";
67     container hop-type {
68       choice hop-type {
69         case SRLG {
70           leaf SRLG {
71             type string;
72             //to be clarified with topology model
73           }
74         }
75         case clli {
76           leaf clli {
77             type string;
78             //to be clarified with topology model
79           }
80         }
81         case node {
82           leaf node-id {
83             type string;
84             // to be clarified with topology model
85           }
86         }
87       }
88     }
89   }
90
91   grouping diversity-existing-service-contraints-sp {
92     leaf-list existing-service {
93       type string;
94       description
95         "Diverse from existing services identified by facility CLFI";
96     }
97     container existing-service-applicability {
98       leaf clli {
99         type boolean;
100       }
101       leaf node {
102         type boolean;
103       }
104       leaf srlg {
105         type boolean;
106       }
107     }
108   }
109
110   grouping routing-constraints-sp {
111     container hard-constraints {
112       uses constraints-sp;
113     }
114     container soft-constraints {
115       uses constraints-sp;
116     }
117     leaf locally-protected-links {
118       type boolean;
119       description
120         "indicates whether it must use locally protected links or not";
121     }
122   }
123
124   grouping constraints-sp {
125     leaf-list customer-code {
126       type string;
127     }
128     choice co-routing-or-general {
129       case general {
130         container diversity {
131           uses diversity-existing-service-contraints-sp;
132         }
133         container exclude_ {
134           uses common-constraints-sp;
135           leaf-list supporting-service-name {
136             type string;
137             description
138               "Supporting service(s) to exclude from this route.";
139           }
140           leaf affinity {
141             type uint32;
142           }
143         }
144         container include_ {
145           list ordered-hops {
146             key "hop-number";
147             leaf hop-number {
148               type uint16;
149               description
150                 "designates the id of the hop: node-id, SRLG-id, site-id";
151             }
152             uses ordered-constraints-sp;
153           }
154         }
155         container latency {
156           description
157             "Maximum latency allowed";
158           leaf max-latency {
159             type uint32;
160             units "ms";
161           }
162         }
163       }
164       case co-routing {
165         container co-routing {
166           leaf-list existing-service {
167             type string;
168             description
169               "Diverse from existing services identified by facility CLFI";
170           }
171         }
172       }
173     }
174   }
175 }