997412bae898a0e144eee3d8df718ca36c2b9911
[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             key "destination nexthop";
45             leaf destination {
46                 description "Specifies a destination in CIDR format";
47                 type inet:ip-prefix;
48             }
49             leaf nexthop {
50                 type inet:ip-address;
51             }
52         }
53         leaf router-status {
54             description "Contains the Router status.";
55             type string;
56         }
57     }
58
59     grouping L3-floatingip-attributes {
60         leaf uuid {
61             type yang:uuid;
62             description "UUID to index this object.";
63         }
64         leaf tenant-id {
65             type yang:uuid;
66             description "The Tenant ID of this object.";
67         }
68         leaf router-id {
69             description "Contains the Router ID of this floatingip object.";
70             type yang:uuid;
71         }
72         leaf port-id {
73             description "Contains the Port ID of the fixed IP address that will be
74                 associated with this object.";
75             type yang:uuid;
76         }
77         leaf floating-network-id {
78             description "The ID of the network associated with the floating IP.";
79             type yang:uuid;
80         }
81         leaf floating-ip-address {
82             description "The floating IP address.";
83             type inet:ip-address;
84         }
85         leaf fixed-ip-address {
86             description "The fixed IP address associated with the floating IP.
87                 If you intend to associate the floating IP with a fixed IP at
88                 creation time, then you must indicate the identifier of the
89                 internal port(using port-id object). If an internal port has
90                 multiple associated IP addresses, the service chooses the first
91                 IP unless you explicitly specify the parameter fixed_ip_address
92                 to select a specific IP.";
93             type inet:ip-address;
94         }
95         leaf status {
96             type string;
97             description "The network status.";
98         }
99     }
100
101     grouping routers-attributes {
102         container routers {
103             list router {
104
105                 description "A logical entity for forwarding packets across internal subnets
106                     and NATting them on external networks through an appropriate external
107                     gateway.";
108
109                 key "uuid";
110                 uses attrs:base-attributes;
111                 uses attrs:admin-attributes;
112                 uses L3-attributes;
113                 container external_gateway_info {
114                     leaf external-network-id {
115                         description "The network_id, for the external gateways. If this is empty, then this
116                             network does not have external access";
117                         type yang:uuid;
118                     }
119                     leaf enable-snat {
120                         description "If true, it indicates that the router is performing snat on external access ";
121                         type boolean;
122                         default "true";
123                     }
124                     list external-fixed-ips {
125                         description "external fixed IPs for this router ";
126                         key subnet-id;
127                         leaf subnet-id {
128                             type yang:uuid;
129                         }
130                         leaf ip-address {
131                             type inet:ip-address;
132                         }
133                     }
134                 }
135             }
136         }
137     }
138     grouping floatingips-attributes {
139         container floatingips {
140             list floatingip {
141
142                 description "An external IP address that is mapped to a port that is
143                     attached to an internal network.";
144
145                 key "uuid";
146                 uses L3-floatingip-attributes;
147             }
148         }
149     }
150 }