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