Move all neutron YANG models under "neutron" top-level
[neutron.git] / model / src / main / yang / neutron-subnets.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-subnets {
9
10     yang-version 1;
11
12     namespace "urn:opendaylight:neutron-subnets";
13
14     prefix neutron-subnets;
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 Openstack Ice House Neutron Subnets model";
26
27     revision "2014-10-02" {
28         description
29                 "Initial version of Openstack Neutron Ice House Subnets model.";
30     }
31
32     grouping subnet-attrs {
33         leaf network-id {
34             type yang:uuid;
35             description "network this subnet is associated with.";
36         }
37         leaf ip-version {
38             description "IP version";
39             type enumeration {
40                 enum 4;
41                 enum 6;
42             }
43         }
44         leaf cidr {
45             type string;
46             description "cidr representing IP range for this subnet, based on IP version";
47         }
48         leaf gateway-ip {
49             type inet:ip-address;
50             description "default gateway used by devices in this subnet";
51         }
52         leaf-list dns-nameservers {
53             type inet:ip-address;
54             description "DNS name servers used by hosts in this subnet.";
55             // neutron subnet-create test-net1 40.0.0.0/24 --dns-nameservers list=true 8.8.8.7 8.8.8.8        }        }
56         }
57         leaf ipv6-address-mode {
58
59             description "neutron subnet-create --ip-version 6 --ipv6_ra_mode off --ipv6_address_mode
60                         off NETWORK CIDR neutron subnet-create --ip-version 6 --ipv6_ra_mode
61                         off --ipv6_address_mode dhcpv6-stateful NETWORK CIDR neutron subnet-create
62                         --ip-version 6 --ipv6_ra_mode slaac --ipv6_address_mode slaac
63                         NETWORK CIDR neutron subnet-create --ip-version 6 --ipv6_ra_mode
64                         dhcpv6-stateful --ipv6_address_mode off NETWORK CIDR neutron subnet-create
65                         --ip-version 6 --ipv6_ra_mode dhcpv6-stateless --ipv6_address_mode
66                         dhcpv6-stateless NETWORK CIDR Note: can't find this in the spec
67                         but OS is sending it with a null value.";
68             // ?? Do we make this an enumeration for validation or require the writer to write good values?
69             type enumeration {
70                 enum off;
71                 enum dhcpv6-stateful;
72                 enum slaac;
73                 enum dhcpv6-stateless;
74             }
75         }
76         leaf ipv6-ra-mode {
77             description "TODO can't find this in the spec but OS sends it with a null
78                         value.";
79             type enumeration {
80                 enum off;
81                 enum dhcpv6-stateful;
82                 enum slaac;
83                 enum dhcpv6-stateless;
84             }
85         }
86         list allocation-pools {
87             description "Sub-ranges of cidr available for dynamic allocation to ports";
88             key start;
89             leaf start {
90                 type string;
91             }
92             leaf end {
93                 type string;
94             }
95         }
96         list host-routes {
97             description "Routes that should be used by devices with IPs from this subnet
98                         (not including local subnet route).";
99             key destination;
100             leaf destination {
101                 type inet:ip-address;
102             }
103             leaf nexthop {
104                 type inet:ip-address;
105             }
106         }
107         leaf enable-dhcp {
108             type boolean;
109             description "Specifies whether DHCP is enabled for this subnet or not.";
110         }
111     }
112     grouping subnets-attributes {
113         container subnets {
114             list subnet {
115                 key "uuid";
116                 uses attrs:base-attrs;
117                 uses subnet-attrs;
118             }
119         }
120     }
121 }