429eca3e9194a4ca6c1b8614a90a92191317e4fd
[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     import neutron-constants { prefix "constants"; }
21     import neutron-types { prefix "types"; }
22
23     organization "OpenDaylight Neutron Group";
24
25     contact "J. Gregory Hall <ghall@brocade.com>, Kiran Sreenivasa <kkoushik@brocade.com>";
26
27     description "This YANG module defines Openstack Neutron Ports model";
28
29     revision "2015-07-12" {
30         description
31                 "OpenDaylight Beryllium release";
32     }
33
34     grouping port-attributes {
35         list allowed-address-pairs {
36             description "Allowed address pairs for this port. For example: neutron port-create
37                         net1 --allowed-address-pairs type=dict list=true mac_address=<mac_address>,ip_address=<ip_cidr>
38                         Setting an allowed-address-pair that matches the mac_address and
39                         ip_address of a port is prevented. This is because that would
40                         have no effect since traffic matching the mac_address and ip_address
41                         is already allowed to pass through the port";
42             key "mac-address ip-address";
43             leaf mac-address {
44                 type yang:mac-address;
45             }
46             leaf ip-address {
47                 type types:ip-prefix-or-address;
48             }
49         }
50
51         leaf network-id {
52             type yang:uuid;
53         }
54         list extra-dhcp-opts {
55             description "Extra DHCP options";
56             reference "http://developer.openstack.org/api-ref-networking-v2.html";
57             key "opt-name ip-version";
58             leaf opt-name {
59                 type string;
60             }
61             leaf opt-value {
62                 type string;
63             }
64             leaf ip-version {
65                 type identityref {
66                     base "constants:ip-version-base";
67                 }
68             }
69         }
70         leaf device-owner {
71             type string;
72         }
73         leaf mac-address {
74             type yang:mac-address;
75         }
76         list fixed-ips {
77             key "subnet-id ip-address";
78             leaf subnet-id {
79                 type yang:uuid;
80             }
81             leaf ip-address {
82                 type inet:ip-address;
83             }
84         }
85
86         leaf-list security-groups {
87             type yang:uuid;
88         }
89         leaf device-id {
90             type string;
91         }
92     }
93
94     grouping ports-attributes {
95         container ports {
96             list port {
97                 key "uuid";
98                 uses attrs:base-attributes;
99                 uses attrs:admin-attributes;
100                 uses port-attributes;
101             }
102         }
103     }
104 }