BGPCEP-701: Remove old statistics, keep only openconfig stats
[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-rib-spi-cfg { prefix ribspi; revision-date 2013-11-15; }
13     import ietf-inet-types { prefix inet; revision-date 2013-07-15; }
14     import ietf-yang-types { prefix yang; revision-date 2013-07-15; }
15     import opendaylight-md-sal-binding {prefix mdsb; revision-date 2013-10-28; }
16     import opendaylight-md-sal-dom {prefix sal; revision-date 2013-10-28; }
17     import opendaylight-md-sal-binding-v1-codec { prefix mdsb1; revision-date 2016-07-14; }
18     import netty { prefix netty; revision-date 2013-11-19; }
19     import config { prefix config; revision-date 2013-04-05; }
20     import rpc-context { prefix rpcx; revision-date 2013-06-17; }
21     import odl-bgp-path-selection-mode { prefix bps; revision-date 2016-03-01;}
22     import bgp-peer { prefix peer; revision-date 2016-06-06; }
23
24     organization "Cisco Systems, Inc.";
25
26     contact "Robert Varga <rovarga@cisco.com>";
27
28     description
29         "This module contains the base YANG definitions for
30          BGP listener implementation.
31
32         Copyright (c)2013 Cisco Systems, Inc. All rights reserved.;
33
34         This program and the accompanying materials are made available
35         under the terms of the Eclipse Public License v1.0 which
36         accompanies this distribution, and is available at
37         http://www.eclipse.org/legal/epl-v10.html";
38
39     revision "2016-03-30" {
40         description
41             "Updated to simplify reconnection strategy.";
42     }
43     revision "2013-04-09" {
44         description
45             "Initial revision";
46     }
47
48     identity bgp-dispatcher {
49         description
50             "Service representing a BGP Dispatcher.";
51
52         base "config:service-type";
53         config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.BGPDispatcher";
54         config:disable-osgi-service-registration;
55     }
56
57     identity bgp-dispatcher-impl {
58         base config:module-type;
59         config:provided-service bgp-dispatcher;
60         config:java-name-prefix BGPDispatcherImpl;
61     }
62
63     augment "/config:modules/config:module/config:configuration" {
64         case bgp-dispatcher-impl {
65             when "/config:modules/config:module/config:type = 'bgp-dispatcher-impl'";
66         }
67     }
68
69     identity rib-instance {
70         description
71             "Service representing a RIB instance";
72
73         base "config:service-type";
74         config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.RIB";
75         config:disable-osgi-service-registration;
76     }
77
78     identity bgp-peer-registry {
79         description
80             "Registry of BGP peers. Every new BGP in/out connection looks for peers to handle bgp messages in this registry";
81
82         base "config:service-type";
83         config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.BGPPeerRegistry";
84         config:disable-osgi-service-registration;
85     }
86
87     identity strict-bgp-peer-registry {
88         description
89             "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";
90
91         config:provided-service bgp-peer-registry;
92         base config:module-type;
93         config:java-name-prefix StrictBgpPeerRegistry;
94     }
95
96     augment "/config:modules/config:module/config:configuration" {
97         case strict-bgp-peer-registry {
98             when "/config:modules/config:module/config:type = 'strict-bgp-peer-registry'";
99         }
100     }
101
102     identity bgp-peer {
103         description
104             "BGP peer instance.";
105
106         base config:module-type;
107         config:java-name-prefix BGPPeer;
108     }
109
110     identity bgp-application-peer {
111         description
112             "Application peer handler which handles translation from custom RIB into local RIB";
113
114         base config:module-type;
115         config:java-name-prefix BGPApplicationPeer;
116     }
117
118     augment "/config:modules/config:module/config:configuration" {
119         case bgp-application-peer {
120             when "/config:modules/config:module/config:type = 'bgp-application-peer'";
121
122             container data-broker {
123                 uses config:service-ref {
124                     refine type {
125                         mandatory true;
126                         config:required-identity sal:dom-async-data-broker;
127                     }
128                 }
129             }
130
131             container target-rib {
132                 uses config:service-ref {
133                     refine type {
134                         mandatory true;
135                         config:required-identity rib-instance;
136                     }
137                 }
138             }
139
140             container bgp-peer-registry {
141                 description "BGP peer registry where current instance of BGP peer will be registered.";
142                 uses config:service-ref {
143                     refine type {
144                         // FIXME backwards compatibility. If not configured, GLOBAL instance is used
145                         mandatory false;
146                         config:required-identity bgp-peer-registry;
147                     }
148                 }
149             }
150
151             leaf application-rib-id {
152                 type rib:application-rib-id;
153                 mandatory true;
154             }
155
156             leaf bgp-peer-id {
157                 type bgp-t:bgp-id;
158                 mandatory true;
159             }
160         }
161     }
162
163     identity bgp-table-type {
164         description
165             "Service representing a AFI/SAFI pair";
166
167         base "config:service-type";
168         config:java-class "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.BgpTableType";
169     }
170
171     identity add-path {
172         base "config:service-type";
173         config:java-class "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.mp.capabilities.add.path.capability.AddressFamilies";
174     }
175
176     identity add-path-impl {
177         config:provided-service add-path;
178         base config:module-type;
179         config:java-name-prefix AddPathImpl;
180     }
181
182     identity bgp-table-type-impl {
183         description
184             "Simple provider for bgp-table-type.";
185
186         config:provided-service bgp-table-type;
187         base config:module-type;
188         config:java-name-prefix BGPTableTypeImpl;
189     }
190
191     augment "/config:modules/config:module/config:configuration" {
192         case bgp-table-type-impl {
193             when "/config:modules/config:module/config:type = 'bgp-table-type-impl'";
194
195             uses bgp-mp:bgp-table-type;
196         }
197     }
198
199     augment "/config:modules/config:module/config:configuration" {
200         case add-path-impl {
201             when "/config:modules/config:module/config:type = 'add-path-impl'";
202             container address-family {
203                 uses config:service-ref {
204                     refine type {
205                         mandatory true;
206                         config:required-identity bgp-table-type;
207                     }
208                 }
209             }
210             leaf send-receive {
211                 type bgp-mp:send-receive;
212                 mandatory true;
213             }
214         }
215     }
216
217     augment "/config:modules/config:module/config:configuration" {
218         case bgp-peer {
219             when "/config:modules/config:module/config:type = 'bgp-peer'";
220
221             uses peer:bgp-peer-config;
222
223             list advertized-table {
224                 key "type name";
225                 uses config:service-ref {
226                     refine type {
227                         mandatory true;
228                         config:required-identity bgp-table-type;
229                     }
230                 }
231             }
232
233             list add-path {
234                 key "type name";
235                 uses config:service-ref {
236                     refine type {
237                         config:required-identity add-path;
238                     }
239                 }
240             }
241
242             container rpc-registry {
243                 uses config:service-ref {
244                     refine type {
245                         mandatory false;
246                         config:required-identity mdsb:binding-rpc-registry;
247                     }
248                 }
249             }
250
251             container rib {
252                 uses config:service-ref {
253                     refine type {
254                         mandatory true;
255                         config:required-identity rib-instance;
256                     }
257                 }
258             }
259
260             container peer-registry {
261                 description "BGP peer registry where current instance of BGP peer will be registered.";
262                 uses config:service-ref {
263                     refine type {
264                         // FIXME backwards compatibility. If not configured, GLOBAL instance is used
265                         mandatory false;
266                         config:required-identity bgp-peer-registry;
267                     }
268                 }
269             }
270         }
271     }
272
273     identity peer-rpc;
274
275     augment "/config:modules/config:module/config:state" {
276         case bgp-peer {
277             when "/config:modules/config:module/config:type = 'bgp-peer'";
278
279             rpcx:rpc-context-instance "peer-rpc";
280         }
281     }
282
283     rpc reset-session {
284         description "Restart the session between BGP peers";
285         input {
286             uses rpcx:rpc-context-ref {
287                 refine context-instance {
288                     rpcx:rpc-context-instance peer-rpc;
289                 }
290             }
291         }
292     }
293
294     identity bgp-path-selection-mode {
295         description
296             "Service representing an address family + path selection mode.";
297
298         base "config:service-type";
299         config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.BGPBestPathSelection";
300     }
301
302     identity bgp-psm-impl {
303         base config:module-type;
304         config:provided-service bgp-path-selection-mode;
305         config:java-name-prefix BGPPSMImpl;
306     }
307
308     augment "/config:modules/config:module/config:configuration" {
309         case bgp-psm-impl {
310             when "/config:modules/config:module/config:type = 'bgp-psm-impl'";
311             container path-address-family {
312                 uses config:service-ref {
313                     refine type {
314                         mandatory true;
315                         config:required-identity bgp-table-type;
316                     }
317                 }
318             }
319             container path-selection-mode {
320                 uses config:service-ref {
321                     refine type {
322                         mandatory true;
323                         config:required-identity bps:path-selection-mode-factory;
324                     }
325                 }
326             }
327         }
328     }
329
330     identity rib-impl {
331         base config:module-type;
332         config:provided-service bgprib:rib;
333         config:provided-service rib-instance;
334         config:java-name-prefix RIBImpl;
335     }
336
337     augment "/config:modules/config:module/config:configuration" {
338         case rib-impl {
339             when "/config:modules/config:module/config:type = 'rib-impl'";
340
341             uses bgp-rib-impl:bgp-rib-impl-identifiers;
342
343             container extensions {
344                 uses config:service-ref {
345                     refine type {
346                         mandatory true;
347                         config:required-identity ribspi:consumer-extensions;
348                     }
349                 }
350             }
351
352             container bgp-dispatcher {
353                 uses config:service-ref {
354                     refine type {
355                         mandatory true;
356                         config:required-identity bgp-dispatcher;
357                     }
358                 }
359             }
360
361             container data-provider {
362                 uses config:service-ref {
363                     refine type {
364                         mandatory true;
365                         config:required-identity mdsb:binding-async-data-broker;
366                     }
367                 }
368             }
369
370             container codec-tree-factory {
371                 uses config:service-ref {
372                     refine type {
373                         mandatory true;
374                         config:required-identity mdsb1:binding-v1-codec-tree-factory;
375                     }
376                 }
377             }
378
379             container dom-data-provider {
380                 uses config:service-ref {
381                     refine type {
382                         mandatory true;
383                         config:required-identity sal:dom-async-data-broker;
384                     }
385                 }
386             }
387
388             list local-table {
389                 uses config:service-ref {
390                     refine type {
391                         mandatory true;
392                         config:required-identity bgp-table-type;
393                     }
394                 }
395             }
396
397             list rib-path-selection-mode {
398                 uses config:service-ref {
399                     refine type {
400                         config:required-identity bgp-path-selection-mode;
401                     }
402                 }
403             }
404         }
405     }
406 }
407