Add blueprint XML for bgp-parser-spi
[bgpcep.git] / bgp / rib-impl / src / main / yang / odl-bgp-rib-impl-cfg.yang
1 // vi: set smarttab et sw=4 tabstop=4:
2 module odl-bgp-rib-impl-cfg {
3     yang-version 1;
4     namespace "urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl";
5     prefix "bgprib-impl";
6
7     import bgp-multiprotocol { prefix bgp-mp; revision-date 2013-09-19; }
8     import bgp-rib { prefix rib; revision-date 2013-09-25; }
9     import bgp-rib-impl { prefix bgp-rib-impl; revision-date 2016-06-06; }
10     import bgp-types { prefix bgp-t; revision-date 2013-09-19; }
11     import odl-bgp-rib-cfg { prefix bgprib; revision-date 2013-07-01; }
12     import odl-bgp-parser-spi-cfg { prefix bgpspi; revision-date 2013-11-15; }
13     import odl-bgp-rib-spi-cfg { prefix ribspi; revision-date 2013-11-15; }
14     import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
15     import ietf-yang-types { prefix yang; revision-date 2013-07-15; }
16     import opendaylight-md-sal-binding {prefix mdsb; revision-date 2013-10-28; }
17     import opendaylight-md-sal-dom {prefix sal; revision-date 2013-10-28; }
18     import netty { prefix netty; revision-date 2013-11-19; }
19     import config { prefix config; revision-date 2013-04-05; }
20     import odl-tcpmd5-cfg { prefix tcpmd5; revision-date 2014-04-27; }
21     import odl-tcpmd5-netty-cfg { prefix tcpmd5n; revision-date 2014-04-27; }
22     import rpc-context { prefix rpcx; revision-date 2013-06-17; }
23     import odl-bgp-openconfig-spi-cfg { prefix bgp-oc-spi; revision-date 2015-09-25; }
24     import odl-bgp-path-selection-mode { prefix bps; revision-date 2016-03-01;}
25     import bgp-peer { prefix peer; revision-date 2016-06-06; }
26     import bgp-stats-peer { prefix peer-stats; revision-date 2016-06-06; }
27     import bgp-stats-rib-impl { prefix rib-impl-stats; revision-date 2016-06-06; }
28
29     organization "Cisco Systems, Inc.";
30
31     contact "Robert Varga <rovarga@cisco.com>";
32
33     description
34         "This module contains the base YANG definitions for
35          BGP listener implementation.
36
37         Copyright (c)2013 Cisco Systems, Inc. All rights reserved.;
38
39         This program and the accompanying materials are made available
40         under the terms of the Eclipse Public License v1.0 which
41         accompanies this distribution, and is available at
42         http://www.eclipse.org/legal/epl-v10.html";
43
44     revision "2016-03-30" {
45         description
46             "Updated to simplify reconnection strategy.";
47     }
48     revision "2013-04-09" {
49         description
50             "Initial revision";
51     }
52
53     identity bgp-dispatcher {
54         description
55             "Service representing a BGP Dispatcher.";
56
57         base "config:service-type";
58         config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.BGPDispatcher";
59     }
60
61     identity bgp-dispatcher-impl {
62         base config:module-type;
63         config:provided-service bgp-dispatcher;
64         config:java-name-prefix BGPDispatcherImpl;
65     }
66
67     augment "/config:modules/config:module/config:configuration" {
68         case bgp-dispatcher-impl {
69             when "/config:modules/config:module/config:type = 'bgp-dispatcher-impl'";
70
71             container bgp-extensions {
72                 uses config:service-ref {
73                     refine type {
74                         mandatory true;
75                         config:required-identity bgpspi:consumer-extensions;
76                     }
77                 }
78             }
79
80             container boss-group {
81                 uses config:service-ref {
82                     refine type {
83                         mandatory true;
84                         config:required-identity netty:netty-threadgroup;
85                     }
86                 }
87             }
88
89             container worker-group {
90                 uses config:service-ref {
91                     refine type {
92                         mandatory true;
93                         config:required-identity netty:netty-threadgroup;
94                     }
95                 }
96             }
97
98             container md5-channel-factory {
99                 uses config:service-ref {
100                     refine type {
101                         mandatory false;
102                         config:required-identity tcpmd5n:md5-channel-factory;
103                     }
104                 }
105             }
106
107             container md5-server-channel-factory {
108                 uses config:service-ref {
109                     refine type {
110                         mandatory false;
111                         config:required-identity tcpmd5n:md5-server-channel-factory;
112                     }
113                 }
114             }
115         }
116     }
117
118     identity base-bgp-rib {
119         base config:module-type;
120         config:provided-service ribspi:extension;
121         config:java-name-prefix BaseBGPRIB;
122     }
123
124     augment "/config:modules/config:module/config:configuration" {
125         case base-bgp-rib {
126             when "/config:modules/config:module/config:type = 'base-bgp-rib'";
127         }
128     }
129
130     identity rib-instance {
131         description
132             "Service representing a RIB instance";
133
134         base "config:service-type";
135         config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.RIB";
136     }
137
138     identity bgp-peer-registry {
139         description
140             "Registry of BGP peers. Every new BGP in/out connection looks for peers to handle bgp messages in this registry";
141
142         base "config:service-type";
143         config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.BGPPeerRegistry";
144     }
145
146     identity strict-bgp-peer-registry {
147         description
148             "Registry of BGP peers that allows only one connection per 2 peers. Uses IP address for Peer identification and BGP Ids to resolve duplicate connections";
149
150         config:provided-service bgp-peer-registry;
151         base config:module-type;
152         config:java-name-prefix StrictBgpPeerRegistry;
153     }
154
155     augment "/config:modules/config:module/config:configuration" {
156         case strict-bgp-peer-registry {
157             when "/config:modules/config:module/config:type = 'strict-bgp-peer-registry'";
158         }
159     }
160
161     identity bgp-peer {
162         description
163             "BGP peer instance.";
164
165         base config:module-type;
166         config:java-name-prefix BGPPeer;
167     }
168
169     identity bgp-peer-acceptor {
170         description
171             "BGP peer acceptor that handles incoming bgp connections. Uses BGP peer registry to accept or decline incoming connections";
172
173         base config:module-type;
174         config:java-name-prefix BGPPeerAcceptor;
175     }
176
177     augment "/config:modules/config:module/config:configuration" {
178         case bgp-peer-acceptor {
179             when "/config:modules/config:module/config:type = 'bgp-peer-acceptor'";
180
181             leaf binding-address {
182                 description "IP address to bind to";
183                 type inet:ip-address;
184                 default "0.0.0.0";
185             }
186
187             leaf binding-port {
188                 description "Port to bind to";
189                 type inet:port-number;
190                 default "179";
191             }
192
193             container accepting-bgp-dispatcher {
194                 uses config:service-ref {
195                     refine type {
196                         mandatory true;
197                         config:required-identity bgp-dispatcher;
198                     }
199                 }
200             }
201
202             container accepting-peer-registry {
203                 uses config:service-ref {
204                     refine type {
205                         mandatory true;
206                         config:required-identity bgp-peer-registry;
207                     }
208                 }
209             }
210         }
211     }
212
213     identity bgp-application-peer {
214         description
215             "Application peer handler which handles translation from custom RIB into local RIB";
216
217         base config:module-type;
218         config:java-name-prefix BGPApplicationPeer;
219     }
220
221     augment "/config:modules/config:module/config:configuration" {
222         case bgp-application-peer {
223             when "/config:modules/config:module/config:type = 'bgp-application-peer'";
224
225             container data-broker {
226                 uses config:service-ref {
227                     refine type {
228                         mandatory true;
229                         config:required-identity sal:dom-async-data-broker;
230                     }
231                 }
232             }
233
234             container target-rib {
235                 uses config:service-ref {
236                     refine type {
237                         mandatory true;
238                         config:required-identity rib-instance;
239                     }
240                 }
241             }
242
243             container bgp-peer-registry {
244                 description "BGP peer registry where current instance of BGP peer will be registered.";
245                 uses config:service-ref {
246                     refine type {
247                         // FIXME backwards compatibility. If not configured, GLOBAL instance is used
248                         mandatory false;
249                         config:required-identity bgp-peer-registry;
250                     }
251                 }
252             }
253
254             leaf application-rib-id {
255                 type rib:application-rib-id;
256                 mandatory true;
257             }
258
259             leaf bgp-peer-id {
260                 type bgp-t:bgp-id;
261                 mandatory true;
262             }
263         }
264     }
265
266     identity bgp-table-type {
267         description
268             "Service representing a AFI/SAFI pair";
269
270         base "config:service-type";
271         config:java-class "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.BgpTableType";
272     }
273
274     identity add-path {
275         base "config:service-type";
276         config:java-class "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.mp.capabilities.add.path.capability.AddressFamilies";
277     }
278
279     identity add-path-impl {
280         config:provided-service add-path;
281         base config:module-type;
282         config:java-name-prefix AddPathImpl;
283     }
284
285     identity bgp-table-type-impl {
286         description
287             "Simple provider for bgp-table-type.";
288
289         config:provided-service bgp-table-type;
290         base config:module-type;
291         config:java-name-prefix BGPTableTypeImpl;
292     }
293
294     augment "/config:modules/config:module/config:configuration" {
295         case bgp-table-type-impl {
296             when "/config:modules/config:module/config:type = 'bgp-table-type-impl'";
297
298             uses bgp-mp:bgp-table-type;
299         }
300     }
301
302     augment "/config:modules/config:module/config:configuration" {
303         case add-path-impl {
304             when "/config:modules/config:module/config:type = 'add-path-impl'";
305             container address-family {
306                 uses config:service-ref {
307                     refine type {
308                         mandatory true;
309                         config:required-identity bgp-table-type;
310                     }
311                 }
312             }
313             leaf send-receive {
314                 type bgp-mp:send-receive;
315                 mandatory true;
316             }
317         }
318     }
319
320     augment "/config:modules/config:module/config:configuration" {
321         case bgp-peer {
322             when "/config:modules/config:module/config:type = 'bgp-peer'";
323
324             uses peer:bgp-peer-config;
325
326             list advertized-table {
327                 key "type name";
328                 uses config:service-ref {
329                     refine type {
330                         mandatory true;
331                         config:required-identity bgp-table-type;
332                     }
333                 }
334             }
335
336             list add-path {
337                 key "type name";
338                 uses config:service-ref {
339                     refine type {
340                         config:required-identity add-path;
341                     }
342                 }
343             }
344
345             container rpc-registry {
346                 uses config:service-ref {
347                     refine type {
348                         mandatory false;
349                         config:required-identity mdsb:binding-rpc-registry;
350                     }
351                 }
352             }
353
354             container rib {
355                 uses config:service-ref {
356                     refine type {
357                         mandatory true;
358                         config:required-identity rib-instance;
359                     }
360                 }
361             }
362
363             container peer-registry {
364                 description "BGP peer registry where current instance of BGP peer will be registered.";
365                 uses config:service-ref {
366                     refine type {
367                         // FIXME backwards compatibility. If not configured, GLOBAL instance is used
368                         mandatory false;
369                         config:required-identity bgp-peer-registry;
370                     }
371                 }
372             }
373         }
374     }
375
376     identity peer-rpc;
377
378     augment "/config:modules/config:module/config:state" {
379         case bgp-peer {
380             when "/config:modules/config:module/config:type = 'bgp-peer'";
381
382             rpcx:rpc-context-instance "peer-rpc";
383             uses peer-stats:bgp-peer-stats;
384         }
385
386         case rib-impl {
387             when "/config:modules/config:module/config:type = 'rib-impl'";
388
389             uses rib-impl-stats:bgp-render-stats;
390         }
391     }
392
393     rpc reset-session {
394         description "Restart the session between BGP peers";
395         input {
396             uses rpcx:rpc-context-ref {
397                 refine context-instance {
398                     rpcx:rpc-context-instance peer-rpc;
399                 }
400             }
401         }
402     }
403
404     rpc reset-stats {
405         description "Reset the BGP peer statistics.";
406         input {
407             uses rpcx:rpc-context-ref {
408                 refine context-instance {
409                     rpcx:rpc-context-instance peer-rpc;
410                 }
411             }
412         }
413     }
414
415     identity bgp-path-selection-mode {
416         description
417             "Service representing an address family + path selection mode.";
418
419         base "config:service-type";
420         config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.BGPBestPathSelection";
421     }
422
423     identity bgp-psm-impl {
424         base config:module-type;
425         config:provided-service bgp-path-selection-mode;
426         config:java-name-prefix BGPPSMImpl;
427     }
428
429     augment "/config:modules/config:module/config:configuration" {
430         case bgp-psm-impl {
431             when "/config:modules/config:module/config:type = 'bgp-psm-impl'";
432             container path-address-family {
433                 uses config:service-ref {
434                     refine type {
435                         mandatory true;
436                         config:required-identity bgp-table-type;
437                     }
438                 }
439             }
440             container path-selection-mode {
441                 uses config:service-ref {
442                     refine type {
443                         mandatory true;
444                         config:required-identity bps:path-selection-mode-factory;
445                     }
446                 }
447             }
448         }
449     }
450
451     identity rib-impl {
452         base config:module-type;
453         config:provided-service bgprib:rib;
454         config:provided-service rib-instance;
455         config:java-name-prefix RIBImpl;
456     }
457
458     augment "/config:modules/config:module/config:configuration" {
459         case rib-impl {
460             when "/config:modules/config:module/config:type = 'rib-impl'";
461
462             uses bgp-rib-impl:bgp-rib-impl-identifiers;
463
464             container extensions {
465                 uses config:service-ref {
466                     refine type {
467                         mandatory true;
468                         config:required-identity ribspi:consumer-extensions;
469                     }
470                 }
471             }
472
473             container bgp-dispatcher {
474                 uses config:service-ref {
475                     refine type {
476                         mandatory true;
477                         config:required-identity bgp-dispatcher;
478                     }
479                 }
480             }
481
482             container data-provider {
483                 uses config:service-ref {
484                     refine type {
485                         mandatory true;
486                         config:required-identity mdsb:binding-async-data-broker;
487                     }
488                 }
489             }
490
491             container codec-tree-factory {
492                 uses config:service-ref {
493                     refine type {
494                         mandatory true;
495                         config:required-identity mdsb:binding-codec-tree-factory;
496                     }
497                 }
498             }
499
500             container dom-data-provider {
501                 uses config:service-ref {
502                     refine type {
503                         mandatory true;
504                         config:required-identity sal:dom-async-data-broker;
505                     }
506                 }
507             }
508
509             container openconfig-provider {
510                 uses config:service-ref {
511                     refine type {
512                         mandatory false;
513                         config:required-identity bgp-oc-spi:bgp-openconfig-provider;
514                     }
515                 }
516             }
517
518             list local-table {
519                 uses config:service-ref {
520                     refine type {
521                         mandatory true;
522                         config:required-identity bgp-table-type;
523                     }
524                 }
525             }
526
527             list rib-path-selection-mode {
528                 uses config:service-ref {
529                     refine type {
530                         config:required-identity bgp-path-selection-mode;
531                     }
532                 }
533             }
534         }
535     }
536 }
537
538