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