Merge "Add POJO classes and *Aware Interface for VPNaaS"
[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     import neutron-networks { prefix "networks"; }
21
22     organization "OpenDaylight Neutron Group";
23
24     contact "J. Gregory Hall <ghall@brocade.com>, Kiran Sreenivasa <kkoushik@brocade.com>";
25
26     description "This YANG module defines L3 attributes that are used by Openstack
27         Ice House Neutron modules.";
28
29     revision "2014-10-02" {
30         description
31                 "Initial version of L3 attributes used by OpenStack Ice House Neutron
32                 models";
33     }
34
35     grouping L3-attrs {
36
37         leaf-list external_network_id {
38             description "The network_id, for the external gateways. If this is empty, then this
39                 network does not have external access";
40             type yang:uuid;
41         }
42         leaf router-status {
43             description "Contains the Router status.";
44             type string;
45         }
46     }
47
48     grouping L3-floatingip-attrs {
49         leaf uuid {
50             type yang:uuid;
51             description "UUID to index this object.";
52         }
53
54         leaf tenant-id {
55             type yang:uuid;
56             description "The Tenant ID of this object.";
57         }
58         leaf router-id {
59             description "Contains the Router ID of this floatingip object.";
60             type yang:uuid;
61         }
62         leaf port-id {
63             description "Contains the Port ID of the fixed IP address that will be
64                 associated with this object.";
65             type yang:uuid;
66         }
67         leaf floating-network-id {
68             description "The ID of the network associated with the floating IP.";
69             type yang:uuid;
70         }
71         leaf floating-ip-address {
72             description "The floating IP address.";
73             type inet:ip-address;
74         }
75         leaf fixed-ip-address {
76             description "The fixed IP address associated with the floating IP.
77                 If you intend to associate the floating IP with a fixed IP at
78                 creation time, then you must indicate the identifier of the
79                 internal port(using port-id object). If an internal port has
80                 multiple associated IP addresses, the service chooses the first
81                 IP unless you explicitly specify the parameter fixed_ip_address
82                 to select a specific IP.";
83             type inet:ip-address;
84         }
85         leaf status {
86             type string;
87             description "The network status.";
88         }
89     }
90
91     grouping interface-attrs {
92         leaf subnet-id {
93             description "Contains the Subnet ID of the interface.";
94             type yang:uuid;
95         }
96         leaf port-id {
97             description "Contains the Port ID of the interface.";
98             type yang:uuid;
99         }
100     }
101
102     grouping routers-attributes {
103         container routers {
104             list router {
105
106                 description "A logical entity for forwarding packets across internal subnets
107                     and NATting them on external networks through an appropriate external
108                     gateway.";
109
110                 key "uuid";
111                 uses attrs:base-attrs;
112                 uses attrs:admin-attrs;
113                 uses L3-attrs;
114                 list interfaces {
115                     description "List of interfaces associated with this router object.";
116                     uses interface-attrs;
117                 }
118             }
119         }
120     }
121     grouping floatingips-attributes {
122         container floatingips {
123             list floatingip {
124
125                 description "An external IP address that is mapped to a port that is
126                     attached to an internal network.";
127
128                 key "uuid";
129                 uses L3-floatingip-attrs;
130             }
131         }
132     }
133 }