c9dd3c55dc732221f38a16dfdba455b438179343
[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     }
40
41     augment "/config:modules/config:module/config:configuration" {
42         case base-bgp-parser {
43             when "/config:modules/config:module/config:type = 'base-bgp-parser'";
44
45             container bgp-extensions {
46                 uses config:service-ref {
47                     refine type {
48                         mandatory true;
49                         config:required-identity bgpspi:extensions;
50                     }
51                 }
52             }
53         }
54     }
55
56     identity bgp-rib-extensions-impl {
57         base config:module-type;
58         config:provided-service ribspi:extensions;
59         config:java-name-prefix RIBExtensionsImpl;
60     }
61
62     augment "/config:modules/config:module/config:configuration" {
63         case bgp-rib-extensions-impl {
64             when "/config:modules/config:module/config:type = 'bgp-rib-extensions-impl'";
65         }
66     }
67
68     identity bgp-proposal {
69         description
70             "Service representing a BGP proposal.";
71
72         base "config:service-type";
73         config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.BGPSessionProposal";
74     }
75
76     identity bgp-proposal-impl {
77         base config:module-type;
78         config:provided-service bgp-proposal;
79         config:java-name-prefix BGPSessionProposalImpl;
80     }
81
82     augment "/config:modules/config:module/config:configuration" {
83         case bgp-proposal-impl {
84             when "/config:modules/config:module/config:type = 'bgp-proposal-impl'";
85
86             leaf holdtimer {
87                 type int16;
88                 default 180;
89             }
90
91             leaf bgp-id {
92                 mandatory true;
93                 type string;
94             }
95
96             leaf as-number {
97                 mandatory true;
98                 type int32;
99             }
100         }
101     }
102
103     identity bgp-dispatcher {
104         description
105             "Service representing a BGP Dispatcher.";
106
107         base "config:service-type";
108         config:java-class "org.opendaylight.protocol.bgp.rib.impl.spi.BGPDispatcher";
109     }
110
111     identity bgp-dispatcher-impl {
112         base config:module-type;
113         config:provided-service bgp-dispatcher;
114         config:java-name-prefix BGPDispatcherImpl;
115     }
116
117     augment "/config:modules/config:module/config:configuration" {
118         case bgp-dispatcher-impl {
119             when "/config:modules/config:module/config:type = 'bgp-dispatcher-impl'";
120
121             container bgp-extensions {
122                 uses config:service-ref {
123                     refine type {
124                         mandatory true;
125                         config:required-identity bgpspi:consumer-extensions;
126                     }
127                 }
128             }
129             
130             container boss-group {
131                 uses config:service-ref {
132                     refine type {
133                         mandatory true;
134                         config:required-identity netty:netty-threadgroup;
135                     }
136                 }
137             }
138             
139             container worker-group {
140                 uses config:service-ref {
141                     refine type {
142                         mandatory true;
143                         config:required-identity netty:netty-threadgroup;
144                     }
145                 }
146             }
147         }
148     }
149
150     identity bgp-impl {
151         base config:module-type;
152             config:provided-service bgpl:listener;
153         config:java-name-prefix BGPImpl;
154
155     }
156
157     augment "/config:modules/config:module/config:configuration" {
158         case bgp-impl {
159             when "/config:modules/config:module/config:type = 'bgp-impl'";
160
161             container bgp-dispatcher {
162                 uses config:service-ref {
163                     refine type {
164                         mandatory true;
165                         config:required-identity bgp-dispatcher;
166                     }
167                 }
168             }
169
170             container bgp-proposal {
171                 uses config:service-ref {
172                     refine type {
173                         mandatory true;
174                         config:required-identity bgp-proposal;
175                     }
176                 }
177             }
178
179             leaf host {
180                  mandatory true;
181                  type string;
182             }
183
184             leaf port {
185                  mandatory true;
186                  type uint16;
187             }
188         }
189     }
190
191     identity rib-impl {
192         base config:module-type;
193         config:provided-service bgprib:rib;
194         config:java-name-prefix RIBImpl;
195     }
196
197
198     augment "/config:modules/config:module/config:configuration" {
199         case rib-impl {
200             when "/config:modules/config:module/config:type = 'rib-impl'";
201
202             container bgp {
203                 uses config:service-ref {
204                     refine type {
205                         mandatory true;
206                         config:required-identity bgpl:listener;
207                     }
208                 }
209             }
210
211             container extensions {
212                 uses config:service-ref {
213                     refine type {
214                         mandatory true;
215                         config:required-identity ribspi:consumer-extensions;
216                     }
217                 }
218             }
219                         
220             container session-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 tcp-reconnect-strategy {
230                 uses config:service-ref {
231                     refine type {
232                         mandatory true;
233                         config:required-identity rs:reconnect-strategy;
234                     }
235                 }
236             }
237                        
238             container data-provider {
239                 uses config:service-ref {
240                     refine type {
241                         mandatory true;
242                         config:required-identity mdsb:binding-data-broker;
243                     }
244                 }
245             }
246         }
247     }
248 }
249