2db8eaa0c30b7bc6c228c6ee1a020fe087f10247
[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     import neutron-constants { prefix "constants"; }
21
22     organization "OpenDaylight Neutron Group";
23
24     contact "Kiran Sreenivasa <kkoushik@brocade.com>";
25
26     description "This YANG module defines LBaaSV2.0 objects that are used by Openstack
27         Ice House Neutron YANG modules.";
28
29     revision "2014-10-02" {
30         description
31                 "Initial version of LBaaSV2.0 objects used by OpenStack Ice House Neutron
32                 models";
33     }
34
35     grouping loadbalancer-attributes {
36         description "LBaaSV2.0 load balancer attributes.";
37         leaf descr {
38             type string;
39             description "Load balancer description.";
40             default "";
41         }
42         leaf vip-address {
43             type inet:ip-address;
44             description "The IP address of the VIP.";
45         }
46         leaf vip-subnet-id {
47             type yang:uuid;
48             description "The ID of the subnet on which to allocate the VIP address.";
49         }
50     }
51     grouping listener-attributes {
52         description "LBaaSV2.0 listener attributes.";
53         leaf default-pool-id {
54             type yang:uuid;
55             description "ID of default pool. Must have compatible protocol with listener.";
56         }
57         leaf admin-state-up {
58             type boolean;
59             description "The administrative state of the listener, which is up (true) or
60                         down (false).";
61             default "true";
62         }
63         leaf descr {
64             type string;
65             description "Detailed description of the listener.";
66         }
67         leaf protocol {
68             description "The protocol the front end listens for.";
69             type identityref {
70                 base "constants:protocol-base";
71             }
72         }
73         leaf protocol-port {
74             description "The port on which the front end listens.";
75             type uint16 {
76                 range 1..65535;
77             }
78         }
79         leaf-list loadbalancers {
80             type yang:uuid;
81             description "List of loadbalancers on which this listener is provisioned.";
82         }
83         leaf connection-limit {
84             description "Maximum connections this load balancer can have. Default is infinite.";
85             type int32 {
86                 range -1..65535;
87             }
88             default "-1";
89         }
90     }
91     grouping pool-attributes {
92         leaf admin-state-up {
93             type boolean;
94             description "The administrative state of the pool, which is up (true) or
95                         down (false).";
96         }
97         leaf descr {
98             type string;
99             description "Detailed description of the listener.";
100         }
101         leaf protocol {
102             description "The protocol the front end listens for.";
103             type identityref {
104                 base "constants:protocol-base";
105             }
106         }
107         leaf lb-algorithm {
108             type string;
109             description "The load-balancer algorithm, which is round-robin,
110                 least-connections, and so on. This value, which must be supported,
111                 is dependent on the load-balancer provider. Round-robin
112                 must be supported.";
113         }
114         leaf healthmonitor-id {
115             type yang:uuid;
116             description "List of healthmonitors associated with this pool.";
117         }
118         leaf-list listeners {
119             type yang:uuid;
120             description "List of listeners that belong to the pool.";
121         }
122         container session-persistence {
123             description "The session persistence algorithm. This algorithm is a
124                 dictionary with type and cookie_name keys.";
125             leaf cookie-name {
126                 type string;
127                 description "Cookie Name.";
128             }
129             leaf type {
130                 type string;
131                 description "Cookie type.";
132             }
133         }
134     }
135     grouping member-attributes {
136         leaf uuid {
137             type yang:uuid;
138             description "The unique ID for the member.";
139         }
140         leaf tenant-id {
141             type yang:uuid;
142             description "Owner of the member. Only an administrative user can specify
143                 a tenant ID other than its own.";
144         }
145         leaf subnet-id {
146             type yang:uuid;
147             description "Subnet in which to access this member.";
148         }
149         leaf address {
150             type inet:ip-address;
151             description "The IP address of the member.";
152         }
153         leaf protocol-port {
154             description "The port on which the application is hosted.";
155             type uint16 {
156                 range 1..65535;
157             }
158         }
159         leaf weight {
160             description "Weight of member.";
161             type uint16 {
162                 range 1..65535;
163             }
164             default "1";
165         }
166         leaf admin-state-up {
167             type boolean;
168             description "The administrative state of the member, which is up (true) or
169                         down (false).";
170             default "true";
171         }
172     }
173     grouping healthmonitor-attributes {
174         leaf uuid {
175             type yang:uuid;
176             description "The unique ID for the healthmonitor.";
177         }
178         leaf tenant-id {
179             type yang:uuid;
180             description "Owner of the VIP. Only an administrative user can specify
181                 a tenant ID other than its own.";
182         }
183         leaf type {
184             description "The type of probe, which is PING, TCP, HTTP, or HTTPS, that
185                 is sent by the load balancer to verify the member state.";
186             type identityref {
187                 base "constants:probe-base";
188             }
189         }
190         leaf admin-state-up {
191             type boolean;
192             description "The administrative state of the VPI, which is up (true) or
193                         down (false).";
194             default "true";
195         }
196         leaf delay {
197             description "The time, in seconds, between sending probes to members.";
198             type uint32;
199         }
200         leaf timeout {
201             description "The maximum number of seconds for a monitor to wait for a
202                 connection to be established before it times out. This value must be
203                 less than the delay value.";
204             type uint32;
205         }
206         leaf max-retries {
207             description "Number of allowed connection failures before changing the
208                 status of the member to INACTIVE.";
209             type uint16 {
210                 range 1..10;
211             }
212         }
213         leaf http-method {
214             type string;
215             description "The HTTP method that the monitor uses for requests.";
216             default "";
217         }
218         leaf url-path {
219             type string;
220             description "The HTTP path of the request sent by the monitor to test
221                 the health of a member. Must be a string beginning with a forward
222                 slash (/).";
223         }
224         leaf expected-codes {
225             type string;
226             description "Expected HTTP codes for a passing HTTP(S) monitor.";
227             default "";
228         }
229         leaf-list pools {
230             type yang:uuid;
231             description "List of pools associated with this healthmonitor.";
232         }
233     }
234     grouping lbaas-attributes {
235         container loadbalancers {
236             description "Container for Loadbalancers.";
237             list loadbalancer {
238                 key "uuid";
239                 uses attrs:base-attributes;
240                 uses attrs:admin-attributes;
241                 uses loadbalancer-attributes;
242                 description "List of Loadbalancers.";
243             }
244         }
245         container listeners {
246             description "Container for Listeners.";
247             list listener {
248                 key "uuid";
249                 uses attrs:base-attributes;
250                 uses listener-attributes;
251                 description "List of Listeners";
252             }
253         }
254         container pools {
255             description "Container for LBaaSV2.0 pools.";
256             list pool {
257                 key "uuid";
258                 uses attrs:base-attributes;
259                 uses pool-attributes;
260                 description "List of Pools";
261                 container members {
262                     description "Container for pool members.";
263                     list member {
264                         key "uuid";
265                         uses member-attributes;
266                         description "List of members.";
267                     }
268                 }
269             }
270         }
271         container healthmonitors {
272             description "Container for LBaaSV2.0 healthmonitors.";
273             list healthmonitor {
274                 key "uuid";
275                 uses healthmonitor-attributes;
276                 description "List of healthmonitors.";
277             }
278         }
279     }
280 }