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