1 module odl-bgp-policy {
3 namespace "urn:opendaylight:params:xml:ns:yang:odl:bgp:default:policy";
4 prefix "odl-bgp-policy";
6 import yang-ext { prefix ext; revision-date 2013-07-09; }
7 import openconfig-network-instance { prefix netinst; }
8 import openconfig-bgp { prefix openconfig-bgp; }
9 import bgp-rib { prefix rib; revision-date 2017-12-07; }
10 import openconfig-routing-policy { prefix rpol; }
11 import openconfig-bgp-policy { prefix bgppol; }
12 import ietf-inet-types { prefix inet; revision-date 2013-07-15; }
13 import bgp-types { prefix bgp-t; revision-date 2013-09-19; }
15 organization "AT&T Services, Inc.";
16 contact "Claudio D. Gasparini <claudio.gasparini@pantheon.tech.com>";
19 "This module contains odl bgp policy model
20 to be used under openconfig policy model definitions.
22 Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
24 This program and the accompanying materials are made available
25 under the terms of the Eclipse Public License v1.0 which
26 accompanies this distribution, and is available at
27 http://www.eclipse.org/legal/epl-v10.html";
29 revision "2018-01-09" {
31 "ODL BGP policy models";
34 grouping match-role-condition-grouping {
37 path "/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/role-sets/role-set/role-set-name";
38 require-instance true;
40 description "References a defined neighbor roles set";
42 uses rpol:match-set-options-restricted-group;
45 grouping match-role-set-condition-grouping {
46 container match-role-set {
48 "Match a list of referenced role-set according to the logic
49 defined in the match-set-options leaf";
52 uses match-role-condition-grouping;
56 uses match-role-condition-grouping;
61 grouping bgp-neighbor {
64 path "/rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/rpol:neighbor-set/rpol:neighbor-set-name";
65 require-instance true;
67 description "References a defined neighbor set";
69 uses rpol:match-set-options-restricted-group;
72 grouping match-bgp-neighbor-grouping {
73 container match-bgp-neighbor-set {
75 "The presence of this container indicates that the routes
76 should match the neighbour address of set referenced";
79 "Match a referenced neighbor set according to the logic
80 defined in the match-set-options-leaf";
82 container from-neighbor {
86 container to-neighbor {
92 grouping match-originator-id-set-condition-grouping {
94 "Match a list of referenced originator-id-set according to the logic
95 defined in the match-set-options leaf";
97 container match-originator-id-set-condition {
98 leaf originator-id-set {
100 path "/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/originator-id-sets/originator-id-set/originator-id-set-name";
101 require-instance true;
103 description "References a defined Originator Id set";
105 uses rpol:match-set-options-restricted-group;
109 grouping match-cluster-id-set-condition-grouping {
111 "Match a list of referenced cluster-id-set according to the logic
112 defined in the match-set-options leaf";
113 container match-cluster-id-set-condition {
114 leaf cluster-id-set {
116 path "/rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets/cluster-id-sets/cluster-id-set/cluster-id-set-name";
117 require-instance true;
119 description "References a defined cluster Id set";
121 uses rpol:match-set-options-group;
126 description "Data definition for a list of Odl Bgp roles which
127 are matched as part of a policy";
131 description "List of the defined role sets";
136 "name / label of the role set -- this is used to
137 reference the set in match conditions";
143 "List of role expressions that are part of the set";
148 grouping originator-id-set {
149 description "Data definition for a list of Originators Ids which
150 are matched as part of a policy";
152 list originator-id-set {
153 key originator-id-set-name;
154 description "List of the defined Originators Ids sets";
156 leaf originator-id-set-name {
159 "name / label of the set -- this is used to
160 reference the set in match conditions";
163 leaf-list originator-id {
164 type inet:ipv4-address;
166 "List of role expressions that are part of the set";
170 presence "Local originator Id";
171 description "Validates also Local Originator Id";
176 grouping cluster-id-set {
177 description "Data definition for a list of Cluster Ids which
178 are matched as part of a policy";
180 list cluster-id-set {
181 key cluster-id-set-name;
182 description "List of the defined cluster Ids sets";
184 leaf cluster-id-set-name {
187 "name / label of the set -- this is used to
188 reference the set in match conditions";
191 leaf-list cluster-id {
192 type bgp-t:cluster-identifier;
194 "List of role expressions that are part of the set";
198 presence "Local cluster Id";
199 description "Validates also cluster Originator Id";
204 augment /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets {
205 ext:augment-identifier bgp-cluster-id-sets;
206 container cluster-id-sets {
207 description "Enclosing container for defined cluster-id sets for matching";
212 augment /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets {
213 ext:augment-identifier bgp-role-sets;
214 container role-sets {
215 description "Enclosing container for defined role sets for matching";
220 augment /rpol:routing-policy/rpol:defined-sets/bgppol:bgp-defined-sets {
221 ext:augment-identifier bgp-originator-id-sets;
222 container originator-id-sets {
223 description "Enclosing container for defined role sets for matching";
224 uses originator-id-set;
228 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
229 ext:augment-identifier match-bgp-neighbor-condition;
230 uses match-bgp-neighbor-grouping;
233 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
234 ext:augment-identifier match-role-set-condition;
235 uses match-role-set-condition-grouping;
238 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
239 ext:augment-identifier match-originator-id-set-condition;
240 uses match-originator-id-set-condition-grouping;
243 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:conditions/bgppol:bgp-conditions {
244 ext:augment-identifier match-cluster-id-set-condition;
245 uses match-cluster-id-set-condition-grouping;
248 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:actions/bgp-pol:bgp-actions {
249 ext:augment-identifier reflect-attributes-actions;
250 container reflect-attributes-actions {
251 presence "Modify attributes so they are updated as per RFC4456 route reflection";
255 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:actions/bgp-pol:bgp-actions {
256 ext:augment-identifier non-transitive-attributes-filter;
257 container non-transitive-attributes-filter {
258 presence "Filters attributes, removing non transitive attributes";
262 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:actions/bgp-pol:bgp-actions {
263 ext:augment-identifier set-cluster-id-prepend;
264 container set-cluster-id-prepend {
266 presence "node is present in the config data to use the Cluster Id prepend action";
267 description "action to prepend local Cluster Id to the Cluster Id List";
271 augment /rpol:routing-policy/rpol:policy-definitions/rpol:policy-definition/rpol:statements/rpol:statement/rpol:actions/bgp-pol:bgp-actions {
272 ext:augment-identifier set-originator-id-prepend;
273 container set-originator-id-prepend {
274 presence "node is present in the config data to use the Originator Id prepend action";
275 description "action to prepend Originator Id if non Originator Id is present. If no Originator Id"
276 + "is defined, local Originator Id is used.";
278 type inet:ipv4-address;
279 description "Originator Id";