cc83a5f6196de8d3b61562f1ce6ab2ab95440e6e
[neutron.git] / model / src / main / yang / neutron-ports.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-ports {
9
10     yang-version 1;
11
12     namespace "urn:opendaylight:neutron-ports";
13
14     prefix neutron-ports;
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 Juno House Neutron Ports model";
26
27     revision "2014-10-02" {
28         description
29                 "Initial version of Openstack Neutron Ice House Ports model.";
30     }
31
32     grouping port-attrs {
33         list allowed-address-pairs {
34             description "Allowed address pairs for this port. For example: neutron port-create
35                         net1 --allowed-address-pairs type=dict list=true mac_address=<mac_address>,ip_address=<ip_cidr>
36                         Setting an allowed-address-pair that matches the mac_address and
37                         ip_address of a port is prevented. This is because that would
38                         have no effect since traffic matching the mac_address and ip_address
39                         is already allowed to pass through the port";
40             key "port-id";
41             leaf port-id {
42                 type string;
43             }
44             leaf mac-address {
45                 type string;
46             }
47             leaf ip-address {
48                 type string;
49             }
50         }
51
52         leaf network-id {
53             type yang:uuid;
54         }
55         list extra-dhcp-opts {
56             description "Extra DHCP options";
57             reference "http://developer.openstack.org/api-ref-networking-v2.html";
58             key "opt-name ip-version";
59             leaf opt-name {
60                 type string;
61             }
62             leaf opt-value {
63                 type string;
64             }
65             leaf ip-version {
66                 type enumeration {
67                     enum 4;
68                     enum 6;
69                 }
70             }
71         }
72         leaf device-owner {
73             type string;
74         }
75         leaf mac-address {
76             type string;
77         }
78         leaf binding-profile {
79             type string;
80         }
81
82         list fixed-ips {
83             key subnet-id;
84             leaf subnet-id {
85                 type yang:uuid;
86             }
87             leaf ip-address {
88                 type inet:ip-address;
89             }
90         }
91
92         leaf-list security-groups {
93             type yang:uuid;
94         }
95         leaf device-id {
96             type string;
97         }
98     }
99
100     grouping ports-attributes {
101         container ports {
102             list port {
103                 key "uuid";
104                 uses attrs:base-attributes;
105                 uses attrs:admin-attributes;
106                 uses port-attrs;
107             }
108         }
109     }
110 }