Merge changes from topic 'northbound-refactor'
[neutron.git] / model / src / main / yang / neutron-networks.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-networks {
9
10     yang-version 1;
11
12     namespace "urn:opendaylight:neutron-networks";
13
14     prefix neutron-networks;
15
16     import ietf-yang-types { prefix "yang"; }
17     import neutron-attrs { prefix "attrs"; }
18
19     organization "OpenDaylight Neutron Group";
20
21     contact "J. Gregory Hall <ghall@brocade.com>, Kiran Sreenivasa <kkoushik@brocade.com>";
22
23     description "This YANG module defines Openstack Neutron Network model";
24
25     revision "2015-07-12" {
26         description
27                 "OpenDaylight Beryllium release";
28     }
29     identity network-type-base {
30         description
31                 "Base Network type for all Network type identifiers.";
32     }
33
34     identity network-type-flat {
35         base network-type-base;
36         description
37                 "Flat network type identity.";
38     }
39     identity network-type-vlan {
40         base network-type-base;
41         description
42                 "VLAN network type identity.";
43     }
44     identity network-type-vxlan {
45         base network-type-base;
46         description
47                 "VXLAN network type identity.";
48     }
49     identity network-type-gre {
50         base network-type-base;
51         description
52                 "GRE network type identity.";
53     }
54
55     typedef network-type {
56         type identityref {
57             base network-type-base;
58         }
59         description
60                 "This type is used to refer to a Network Type.";
61     }
62
63     grouping networks-attributes {
64         container networks {
65             list network {
66
67                 description "A network is a virtual isolated layer-2 broadcast domain which
68                             is typically reserved to the tenant who created it, unless the
69                             network has been explicitly configured to be shared. Tenants can
70                             create multiple networks, until they reach the thresholds specified
71                             by per-tenant Quotas. The network is the principal entity for 
72                             the Neutron API. Ports and Subnets must always be associated 
73                             with a network.";
74
75                 key "uuid";
76
77                 leaf-list subnets {
78                     description "The associated subnets.";
79                     type yang:uuid;
80                 }
81
82                 leaf shared {
83                     type boolean;
84                     default "false";
85                     description "Indicates whether this network or subnet is shared across all
86                                 tenants. By default, only administrative users can change this
87                                 value.";
88                 }
89
90                 uses attrs:base-attributes;
91                 uses attrs:admin-attributes;
92             }
93         }
94     }
95 }