BUG-223: Support having multiple RIB instances
[bgpcep.git] / bgp / rib-impl-config / src / main / yang / bgp-rib-impl.yang
1 // vi: set smarttab et sw=4 tabstop=4:
2 module bgp-rib-impl {
3     yang-version 1;
4     namespace "urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl";
5     prefix "bgprib-impl";
6
7     import bgp-listener { prefix bgpl; revision-date 2013-04-09; }
8     import bgp-rib { prefix rib; revision-date 2013-09-25; }
9     import config-bgp-rib { prefix bgprib; revision-date 2013-07-01; }
10     import config-bgp-parser-spi { prefix bgpspi; revision-date 2013-11-15; }
11     import config-bgp-rib-spi { prefix ribspi; revision-date 2013-11-15; }
12     import opendaylight-md-sal-binding {prefix mdsb; revision-date 2013-10-28; }
13     import netty { prefix netty; revision-date 2013-11-19; }
14     import reconnect-strategy { prefix rs; revision-date 2013-11-09; }
15     import config { prefix config; revision-date 2013-04-05; }
16
17     organization "Cisco Systems, Inc.";
18
19     contact "Robert Varga <rovarga@cisco.com>";
20
21     description
22         "This module contains the base YANG definitions for
23          BGP listener implementation.
24
25         Copyright (c)2013 Cisco Systems, Inc. All rights reserved.;
26
27         This program and the accompanying materials are made available
28         under the terms of the Eclipse Public License v1.0 which
29         accompanies this distribution, and is available at
30         http://www.eclipse.org/legal/epl-v10.html";
31
32     revision "2013-04-09" {
33         description
34             "Initial revision";
35     }
36
37     identity base-bgp-parser {
38         base config:module-type;
39         config:java-name-prefix BaseBGPParser;
40         config:provided-service bgpspi:extension;
41     }
42
43     augment "/config:modules/config:module/config:configuration" {
44         case base-bgp-parser {
45             when "/config:modules/config:module/config:type = 'base-bgp-parser'";
46         }
47     }
48
49     identity bgp-proposal {
50         description
51             "Service representing a BGP proposal.";
52
53         base "config:service-type";
54         config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.BGPSessionProposal";
55     }
56
57     identity bgp-proposal-impl {
58         base config:module-type;
59         config:provided-service bgp-proposal;
60         config:java-name-prefix BGPSessionProposalImpl;
61     }
62
63     augment "/config:modules/config:module/config:configuration" {
64         case bgp-proposal-impl {
65             when "/config:modules/config:module/config:type = 'bgp-proposal-impl'";
66
67             leaf holdtimer {
68                 type int16;
69                 default 180;
70             }
71
72             leaf bgp-id {
73                 mandatory true;
74                 type string;
75             }
76
77             leaf as-number {
78                 mandatory true;
79                 type int32;
80             }
81         }
82     }
83
84     identity bgp-dispatcher {
85         description
86             "Service representing a BGP Dispatcher.";
87
88         base "config:service-type";
89         config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.BGPDispatcher";
90     }
91
92     identity bgp-dispatcher-impl {
93         base config:module-type;
94         config:provided-service bgp-dispatcher;
95         config:java-name-prefix BGPDispatcherImpl;
96     }
97
98     augment "/config:modules/config:module/config:configuration" {
99         case bgp-dispatcher-impl {
100             when "/config:modules/config:module/config:type = 'bgp-dispatcher-impl'";
101
102             container bgp-extensions {
103                 uses config:service-ref {
104                     refine type {
105                         mandatory true;
106                         config:required-identity bgpspi:consumer-extensions;
107                     }
108                 }
109             }
110
111             container boss-group {
112                 uses config:service-ref {
113                     refine type {
114                         mandatory true;
115                         config:required-identity netty:netty-threadgroup;
116                     }
117                 }
118             }
119
120             container worker-group {
121                 uses config:service-ref {
122                     refine type {
123                         mandatory true;
124                         config:required-identity netty:netty-threadgroup;
125                     }
126                 }
127             }
128         }
129     }
130
131     identity bgp-impl {
132         base config:module-type;
133         config:provided-service bgpl:listener;
134         config:java-name-prefix BGPImpl;
135     }
136
137     augment "/config:modules/config:module/config:configuration" {
138         case bgp-impl {
139             when "/config:modules/config:module/config:type = 'bgp-impl'";
140
141             container bgp-dispatcher {
142                 uses config:service-ref {
143                     refine type {
144                         mandatory true;
145                         config:required-identity bgp-dispatcher;
146                     }
147                 }
148             }
149
150             container bgp-proposal {
151                 uses config:service-ref {
152                     refine type {
153                         mandatory true;
154                         config:required-identity bgp-proposal;
155                     }
156                 }
157             }
158
159             leaf host {
160                  mandatory true;
161                  type string;
162             }
163
164             leaf port {
165                  type uint16;
166                  default 179;
167             }
168         }
169     }
170
171     identity base-bgp-rib {
172         base config:module-type;
173         config:provided-service ribspi:extension;
174         config:java-name-prefix BaseBGPRIB;
175     }
176
177     augment "/config:modules/config:module/config:configuration" {
178         case base-bgp-rib {
179             when "/config:modules/config:module/config:type = 'base-bgp-rib'";
180         }
181     }
182
183     identity rib-impl {
184         base config:module-type;
185         config:provided-service bgprib:rib;
186         config:java-name-prefix RIBImpl;
187     }
188
189     augment "/config:modules/config:module/config:configuration" {
190         case rib-impl {
191             when "/config:modules/config:module/config:type = 'rib-impl'";
192
193             container bgp {
194                 uses config:service-ref {
195                     refine type {
196                         mandatory true;
197                         config:required-identity bgpl:listener;
198                     }
199                 }
200             }
201
202             container extensions {
203                 uses config:service-ref {
204                     refine type {
205                         mandatory true;
206                         config:required-identity ribspi:consumer-extensions;
207                     }
208                 }
209             }
210
211             container session-reconnect-strategy {
212                 uses config:service-ref {
213                     refine type {
214                         mandatory true;
215                         config:required-identity rs:reconnect-strategy;
216                     }
217                 }
218             }
219
220             container tcp-reconnect-strategy {
221                 uses config:service-ref {
222                     refine type {
223                         mandatory true;
224                         config:required-identity rs:reconnect-strategy;
225                     }
226                 }
227             }
228
229             container data-provider {
230                 uses config:service-ref {
231                     refine type {
232                         mandatory true;
233                         config:required-identity mdsb:binding-data-broker;
234                     }
235                 }
236             }
237
238             leaf rib-id {
239                 type rib:rib-id;
240                 mandatory true;
241             }
242         }
243     }
244 }
245