Merge "Add neutron FWaaS YANG model"
[neutron.git] / model / src / main / yang / neutron-fwaas.yang
1 /*
2  * Copyright (c) 2015 IBM Corporation.  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-fwaas {
9
10     yang-version 1;
11
12     namespace "urn:opendaylight:neutron-fwaas";
13
14     prefix neutron-fwaas;
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 "R. Moats <rmoats@us.ibm.com>";
24
25     description "This YANG module defines Openstack Juno House Neutron VPNaaS model";
26
27     grouping firewall-attrs {
28         leaf descr {
29             type string;
30             description "Detailed description of the firewall.";
31         }
32         leaf shared {
33             description "whether the firewall is shared or not";
34             type boolean;
35         }
36         leaf firewall-policy-id {
37             description "the firewall policy UUID for this firewall";
38             type yang:uuid;
39         }
40     }
41
42     grouping firewallpolicy-attrs {
43         leaf descr {
44             type string;
45             description "Detailed description of the firewall policy.";
46         }
47         leaf shared {
48             description "whether the firewall policy is shared or not";
49             type boolean;
50         }
51         leaf audited {
52             description "whether the firewall policy is audited or not";
53             type boolean;
54         }
55         leaf-list firewall-rules {
56             description "whether the firewall policy is audited or not";
57             type yang:uuid;
58         }
59     }
60
61     grouping firewallrule-attrs {
62         leaf descr {
63             type string;
64             description "Detailed description of the firewall rule.";
65         }
66         leaf status {
67             type string;
68             description "Status of the firewall rule.";
69         }
70         leaf shared {
71             description "whether the firewall rule is shared or not";
72             type boolean;
73         }
74         leaf enabled {
75             description "whether the firewall rule is enabled or not";
76             type boolean;
77         }
78         leaf firewall-policy-id {
79             description "the firewall policy UUID for this firewall rule";
80             type yang:uuid;
81         }
82         leaf protocol {
83             description "the protocol this rule applies to";
84             type string;
85         }
86         leaf ip-version {
87             description "the ip version this rule applies to";
88             type int16;
89         }
90         leaf source-ip-addr {
91             type inet:ip-address;
92             description "the source ip address for this rule";
93         }
94         leaf destination-ip-addr {
95             type inet:ip-address;
96             description "the destination ip address for this rule";
97         }
98         leaf source-port {
99             description "the source port for this rule";
100             type int16;
101         }
102         leaf destination-port {
103             description "the destination port for this rule";
104             type int16;
105         }
106         leaf position {
107             description "the priority position this rule occupies";
108             type int16;
109         }
110         leaf action {
111             description "the action fot this rule";
112             type string;
113         }
114     }
115
116     grouping fwaas-attributes {
117         container firewalls {
118             list firewall {
119                 key "uuid";
120                 uses attrs:base-attrs;
121                 uses attrs:admin-attrs;
122                 uses firewall-attrs;
123             }
124         }
125         container firewall-policies {
126             list firewall-policy {
127                 key "uuid";
128                 uses attrs:base-attrs;
129                 uses firewallpolicy-attrs;
130             }
131         }
132         container firewall-rules {
133             list firewall-rule {
134                 key "uuid";
135                 uses attrs:base-attrs;
136                 uses firewallrule-attrs;
137             }
138         }
139     }
140 }