BUG-5137: extraroutes in router not working
[neutron.git] / model / src / main / yang / neutron-L3.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-L3 {
9
10     yang-version 1;
11
12     namespace "urn:opendaylight:neutron-L3";
13
14     prefix neutron-L3;
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 "J. Gregory Hall <ghall@brocade.com>, Kiran Sreenivasa <kkoushik@brocade.com>";
24
25     description "This YANG module defines attributes used by Openstack Neutron L3 modules.";
26
27     revision "2015-07-12" {
28         description
29                 "OpenDaylight Beryllium release";
30     }
31
32     grouping L3-attributes {
33         leaf distributed {
34             description "whether this router is distributed or not.";
35             type boolean;
36             default "false";
37         }
38         leaf gateway-port-id {
39             description "the port uuid holding the router's gateway address.";
40             type yang:uuid;
41         }
42         list routes {
43             description "list of routes for this router.";
44             leaf destination {
45                 description "Specifies a destination in CIDR format";
46                 type inet:ip-prefix;
47             }
48             leaf nexthop {
49                 type inet:ip-address;
50             }
51         }
52         leaf router-status {
53             description "Contains the Router status.";
54             type string;
55         }
56     }
57
58     grouping L3-floatingip-attributes {
59         leaf uuid {
60             type yang:uuid;
61             description "UUID to index this object.";
62         }
63         leaf tenant-id {
64             type yang:uuid;
65             description "The Tenant ID of this object.";
66         }
67         leaf router-id {
68             description "Contains the Router ID of this floatingip object.";
69             type yang:uuid;
70         }
71         leaf port-id {
72             description "Contains the Port ID of the fixed IP address that will be
73                 associated with this object.";
74             type yang:uuid;
75         }
76         leaf floating-network-id {
77             description "The ID of the network associated with the floating IP.";
78             type yang:uuid;
79         }
80         leaf floating-ip-address {
81             description "The floating IP address.";
82             type inet:ip-address;
83         }
84         leaf fixed-ip-address {
85             description "The fixed IP address associated with the floating IP.
86                 If you intend to associate the floating IP with a fixed IP at
87                 creation time, then you must indicate the identifier of the
88                 internal port(using port-id object). If an internal port has
89                 multiple associated IP addresses, the service chooses the first
90                 IP unless you explicitly specify the parameter fixed_ip_address
91                 to select a specific IP.";
92             type inet:ip-address;
93         }
94         leaf status {
95             type string;
96             description "The network status.";
97         }
98     }
99
100     grouping interface-attributes {
101         leaf uuid {
102             type yang:uuid;
103             description "UUID to index this object.";
104         }
105         leaf tenant-id {
106             type yang:uuid;
107             description "The Tenant ID of this object.";
108         }
109         leaf subnet-id {
110             description "Contains the Subnet ID of the interface.";
111             type yang:uuid;
112         }
113         leaf port-id {
114             description "Contains the Port ID of the interface.";
115             type yang:uuid;
116         }
117     }
118
119     grouping routers-attributes {
120         container routers {
121             list router {
122
123                 description "A logical entity for forwarding packets across internal subnets
124                     and NATting them on external networks through an appropriate external
125                     gateway.";
126
127                 key "uuid";
128                 uses attrs:base-attributes;
129                 uses attrs:admin-attributes;
130                 uses L3-attributes;
131                 container external_gateway_info {
132                     leaf external-network-id {
133                         description "The network_id, for the external gateways. If this is empty, then this
134                             network does not have external access";
135                         type yang:uuid;
136                     }
137                     leaf enable-snat {
138                         description "If true, it indicates that the router is performing snat on external access ";
139                         type boolean;
140                         default "true";
141                     }
142                     list external-fixed-ips {
143                         description "external fixed IPs for this router ";
144                         key subnet-id;
145                         leaf subnet-id {
146                             type yang:uuid;
147                         }
148                         leaf ip-address {
149                             type inet:ip-address;
150                         }
151                     }
152                 }
153                 list interfaces {
154                     description "List of interfaces associated with this router object.";
155                     key "uuid";
156                     uses interface-attributes;
157                 }
158             }
159         }
160     }
161     grouping floatingips-attributes {
162         container floatingips {
163             list floatingip {
164
165                 description "An external IP address that is mapped to a port that is
166                     attached to an internal network.";
167
168                 key "uuid";
169                 uses L3-floatingip-attributes;
170             }
171         }
172     }
173 }