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