Merge "Bug 3072: Make NeutronRoutersNorthbound.addRouterInterface() idem-potent"
[neutron.git] / model / src / main / yang / neutron-lbaasv2.yang
1 /*
2  * Copyright (c) 2015 Brocade Communications Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 module neutron-lbaasv2 {
9
10     yang-version 1;
11
12     namespace "urn:opendaylight:neutron-lbaasv2";
13
14     prefix neutron-lbaasv2;
15
16     import ietf-yang-types { prefix "yang"; }
17     // It requires rfc6991 (revision 2013-07-15), but odl don't have it, so this patch verify build will fail.
18     import ietf-inet-types { prefix "inet"; revision-date 2010-09-24; }
19     import neutron-attrs { prefix "attrs"; }
20
21     organization "OpenDaylight Neutron Group";
22
23     contact "Kiran Sreenivasa <kkoushik@brocade.com>";
24
25     description "This YANG module defines LBaaSV2.0 objects that are used by Openstack
26         Ice House Neutron YANG modules.";
27
28     revision "2014-10-02" {
29         description
30                 "Initial version of LBaaSV2.0 objects used by OpenStack Ice House Neutron
31                 models";
32     }
33
34     grouping loadbalancer-attrs {
35         description "LBaaSV2.0 load balancer attributes.";
36         leaf descr {
37             type string;
38             description "Load balancer description.";
39             default "";
40         }
41         leaf vip-address {
42             type inet:ip-address;
43             description "The IP address of the VIP.";
44         }
45         leaf vip-subnet-id {
46             type yang:uuid;
47             description "The ID of the subnet on which to allocate the VIP address.";
48         }
49     }
50     grouping listener-attrs {
51         description "LBaaSV2.0 listener attributes.";
52         leaf default-pool-d {
53             type yang:uuid;
54             description "ID of default pool. Must have compatible protocol with listener.";
55         }
56         leaf admin-state-up {
57             type boolean;
58             description "The administrative state of the listner, which is up (true) or
59                         down (false).";
60             default "true";
61         }
62         leaf descr {
63             type string;
64             description "Detailed description of the listener.";
65         }
66         leaf protocol {
67             description "The protocol the front end listens for.";
68             type enumeration {
69                 enum http {
70                     description "HTTP protocol.";
71                 }
72                 enum https {
73                     description "HTTPS protocol.";
74                 }
75                 enum tcp {
76                     description "TCP protocol.";
77                 }
78             }
79         }
80         leaf protocol-port {
81             description "The port on which the front end listens.";
82             type uint16 {
83                 range 1..65535;
84             }
85         }
86         leaf-list loadbalancers {
87             type yang:uuid;
88             description "List of loadbalancers on which this listener is provisioned.";
89         }
90         leaf connection-limit {
91             description "Maximum connections this load balancer can have. Default is infinite.";
92             type int32 {
93                 range -1..65535;
94             }
95             default "-1";
96         }
97     }
98     grouping pool-attrs {
99         leaf admin-state-up {
100             type boolean;
101             description "The administrative state of the pool, which is up (true) or
102                         down (false).";
103         }
104         leaf descr {
105             type string;
106             description "Detailed description of the listener.";
107         }
108         leaf protocol {
109             description "The protocol the front end listens for.";
110             type enumeration {
111                 enum http {
112                     description "HTTP protocol.";
113                 }
114                 enum https {
115                     description "HTTPS protocol.";
116                 }
117                 enum tcp {
118                     description "TCP protocol.";
119                 }
120             }
121         }
122         leaf lb-algorithm {
123             type string;
124             description "The load-balancer algorithm, which is round-robin,
125                 least-connections, and so on. This value, which must be supported,
126                 is dependent on the load-balancer provider. Round-robin
127                 must be supported.";
128         }
129         leaf-list healthmonitor-ids {
130             type yang:uuid;
131             description "List of healthmonitors associated with this pool.";
132         }
133         leaf-list members {
134             type yang:uuid;
135             description "List of members that belong to the pool.";
136         }
137         leaf-list listeners {
138             type yang:uuid;
139             description "List of listeners that belong to the pool.";
140         }
141         container session-persistence {
142             description "The session persistence algorithm. This algorithm is a
143                 dictionary with type and cookie_name keys.";
144             leaf cookie-name {
145                 type string;
146                 description "Cookie Name.";
147             }
148             leaf type {
149                 type string;
150                 description "Cookie type.";
151             }
152         }
153     }
154     grouping member-attrs {
155         leaf uuid {
156             type yang:uuid;
157             description "The unique ID for the member.";
158         }
159         leaf tenant-id {
160             type yang:uuid;
161             description "Owner of the member. Only an administrative user can specify
162                 a tenant ID other than its own.";
163         }
164         leaf subnet-id {
165             type yang:uuid;
166             description "Subnet in which to access this member.";
167         }
168         leaf address {
169             type inet:ip-address;
170             description "The IP address of the member.";
171         }
172         leaf protocol-port {
173             description "The port on which the application is hosted.";
174             type uint16 {
175                 range 1..65535;
176             }
177         }
178         leaf weight {
179             description "Weight of member.";
180             type uint16 {
181                 range 1..65535;
182             }
183             default "1";
184         }
185         leaf admin-state-up {
186             type boolean;
187             description "The administrative state of the member, which is up (true) or
188                         down (false).";
189             default "true";
190         }
191     }
192     grouping healthmonitor-attrs {
193         leaf uuid {
194             type yang:uuid;
195             description "The unique ID for the healthmonitor.";
196         }
197         leaf tenant-id {
198             type yang:uuid;
199             description "Owner of the VIP. Only an administrative user can specify
200                 a tenant ID other than its own.";
201         }
202         leaf type {
203             description "The type of probe, which is PING, TCP, HTTP, or HTTPS, that
204                 is sent by the load balancer to verify the member state.";
205             type enumeration {
206                 enum http {
207                     description "HTTP protocol.";
208                 }
209                 enum https {
210                     description "HTTPS protocol.";
211                 }
212                 enum tcp {
213                     description "TCP protocol.";
214                 }
215                 enum ping {
216                     description "ICMP protocol.";
217                 }
218             }
219         }
220         leaf admin-state-up {
221             type boolean;
222             description "The administrative state of the VPI, which is up (true) or
223                         down (false).";
224             default "true";
225         }
226         leaf delay {
227             description "The time, in seconds, between sending probes to members.";
228             type uint32;
229         }
230         leaf timeout {
231             description "The maximum number of seconds for a monitor to wait for a
232                 connection to be established before it times out. This value must be
233                 less than the delay value.";
234             type uint32;
235         }
236         leaf max-retries {
237             description "Number of allowed connection failures before changing the
238                 status of the member to INACTIVE.";
239             type uint16 {
240                 range 1..10;
241             }
242         }
243         leaf http-method {
244             type string;
245             description "The HTTP method that the monitor uses for requests.";
246             default "";
247         }
248         leaf url-path {
249             type string;
250             description "The HTTP path of the request sent by the monitor to test
251                 the health of a member. Must be a string beginning with a forward
252                 slash (/).";
253         }
254         leaf expected-codes {
255             type string;
256             description "Expected HTTP codes for a passing HTTP(S) monitor.";
257             default "";
258         }
259         leaf-list pools {
260             type yang:uuid;
261             description "List of pools associated with this healthmonitor.";
262         }
263     }
264     grouping lbaas-attributes {
265         container loadbalancer {
266             description "Container for Loadbalancers.";
267             list loadbalancers {
268                 key "uuid";
269                 uses attrs:base-attrs;
270                 uses attrs:admin-attrs;
271                 uses loadbalancer-attrs;
272                 description "List of Loadbalancers.";
273             }
274         }
275         container listener {
276             description "Container for Listeners.";
277             list listeners {
278                 key "uuid";
279                 uses attrs:base-attrs;
280                 uses listener-attrs;
281                 description "List of Listeners";
282             }
283         }
284         container pool {
285             description "Container for LBaaSV2.0 pools.";
286             list pools {
287                 key "uuid";
288                 uses attrs:base-attrs;
289                 uses pool-attrs;
290                 description "List of Pools";
291                 container member {
292                     description "Container for pool members.";
293                     list members {
294                         key "uuid";
295                         uses member-attrs;
296                         description "List of members.";
297                     }
298                 }
299             }
300         }
301         container healthmonitor {
302             description "Container for LBaaSV2.0 healthmonitors.";
303             list healthmonitors {
304                 key "uuid";
305                 uses healthmonitor-attrs;
306                 description "List of healthmonitors.";
307             }
308         }
309     }
310 }