Path Computation Algorithms
[bgpcep.git] / algo / algo-api / src / main / yang / path-computation.yang
1 module path-computation {
2     yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:path:computation";
4     prefix "algo";
5
6     import network-concepts { prefix netc; revision-date 2013-11-25; }
7     import ietf-inet-types { prefix inet; revision-date 2013-07-15; }
8     import graph { prefix gr; revision-date 2019-11-25; }
9
10     organization "Orange";
11     contact "Olivier Dugeon <olivier.dugeon@orange.com>";
12
13     description
14         "This module contains the model of Computed Path
15          used in various Path Computation algorithms.
16
17         Copyright (c)2020 Orange. All rights reserved.
18
19         This program and the accompanying materials are made available
20         under the terms of the Eclipse Public License v1.0 which
21         accompanies this distribution, and is available at
22         http://www.eclipse.org/legal/epl-v10.html";
23
24     revision "2020-01-20" {
25         description
26              "Initial revision.";
27         reference "";
28     }
29
30     typedef computation-status {
31         description
32             "Status of the Path Computation Algorithm regaring current
33              computed path";
34         type enumeration {
35             enum idle {
36                 description "Path Computeation Algorithm has not yet started";
37                 value 0;
38             }
39             enum in-progress {
40                 description
41                     "Path Computation has started but no path has been found";
42                 value 1;
43             }
44             enum active {
45                 description
46                     "A valid path has been found,
47                      but it is perhaps not the best one";
48                 value 2;
49             }
50             enum completed {
51                 description
52                     "Path Computation Algorithm has completed
53                      and a valid computed path found";
54                 value 3;
55             }
56             enum failed {
57                 value 4;
58             }
59         }
60     }
61
62     typedef algorithm-type {
63         description "Various type of Path Computation Algorithms";
64         type enumeration {
65             enum spf {
66                 value 0;
67             }
68             enum cspf {
69                 value 1;
70             }
71             enum samcra {
72                 value 2;
73             }
74         }
75         default "spf";
76     }
77
78     grouping path-constraints {
79         description "Set of Constraints for Path Computation";
80         leaf metric {
81             description "Maximum end to end IGP metric";
82             type uint32;
83         }
84         leaf te-metric {
85             description "Maximum end to end Traffic Engineering metric";
86             type uint32;
87         }
88         leaf delay {
89             description "Maximum end to end delay";
90             units "micro-seconds";
91             type gr:delay;
92         }
93         leaf jitter {
94             description "Maximum delay variation for selected edges";
95             units "micro-seconds";
96             type gr:delay;
97         }
98         leaf loss {
99             description "Maximum loss for selected edges";
100             units "0.000003%";
101             type gr:loss;
102         }
103         leaf admin-group {
104             description "Admin group to select edges";
105             type uint32;
106         }
107         leaf address-family {
108             description "Address family of the computed path";
109             type enumeration {
110                 enum ipv4 {
111                     value 0;
112                 }
113                 enum ipv6 {
114                     value 1;
115                 }
116                 enum sr-ipv4 {
117                     value 2;
118                 }
119                 enum sr-ipv6 {
120                     value 3;
121                 }
122             }
123             default "ipv4";
124         }
125         leaf class-type {
126             description "Class Type for bandwidth constraints";
127             type uint8 {
128                 range "0..7";
129             }
130         }
131         leaf bandwidth {
132             description "Requested bandwidth for the computed path";
133             units "bytes/second";
134             type gr:decimal-bandwidth;
135         }
136     }
137
138     grouping path-descriptions {
139         description
140             "Computed Path description as a list of IPv4, IPv6 or MPLS Label";
141         list path-description {
142             leaf ipv4 {
143                 when "path-constraints/address-family = 0";
144                 type inet:ipv4-address;
145             }
146             leaf ipv6 {
147                 when "path-constraints/address-family = 1";
148                 type inet:ipv6-address;
149             }
150             leaf label {
151                 when "path-constraints/address-family = 2 or path-constraints/address-family = 3";
152                 type netc:mpls-label;
153             }
154         }
155     }
156
157     container constrained-path {
158         description "Computed Path as result of Path Computation Algorithms";
159         uses path-constraints;
160         leaf source {
161             type uint64;
162         }
163         leaf destination {
164             type uint64;
165         }
166         uses path-descriptions;
167         leaf status {
168             type computation-status;
169         }
170     }
171
172     rpc get-constrained-path {
173         input {
174             leaf graph-name {
175                 type string;
176                 mandatory true;
177             }
178             leaf source {
179                 type uint64;
180             }
181             leaf destination {
182                 type uint64;
183             }
184             container constraints {
185                 uses path-constraints;
186             }
187             leaf algorithm {
188                 type algorithm-type;
189             }
190         }
191         output {
192             uses path-descriptions;
193             leaf status {
194                 type computation-status;
195             }
196             leaf computed-metric {
197                 type uint32;
198             }
199             leaf computed-te-metric {
200                 type uint32;
201             }
202             leaf computed-delay {
203                 type gr:delay;
204             }
205         }
206     }
207 }
208