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