Merge "pyang: missing key in neutron port attribute"
[neutron.git] / model / src / main / yang / neutron-metering.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-metering {
9
10     yang-version 1;
11
12     namespace "urn:opendaylight:neutron-metering";
13
14     prefix neutron-metering;
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 metering attributes that are used by Openstack
26         Juno House Neutron YANG modules.";
27
28     revision "2014-10-02" {
29         description
30                 "Initial version of metering attributes used by OpenStack Ice House Neutron
31                 models";
32     }
33
34     grouping metering-label-attrs {
35         description "OpenStack Layer3 Metering label information.";
36         leaf description {
37             type string;
38             description "Description for the metering label.";
39         }
40     }
41     grouping metering-rule-attrs {
42         description "OpenStack Layer3 Metering label rules.";
43         leaf id {
44             type yang:uuid;
45             description "Metering Rule ID.";
46         }
47         leaf direction {
48             type enumeration {
49                 enum ingress {
50                     description "Ingress direction.";
51                   }
52                   enum egress {
53                     description "Egress direction.";
54                   }
55             }
56             description "The direction in which metering rule is applied.";
57             default "ingress";
58         }
59         leaf metering-label-id {
60             type yang:uuid;
61             description "Metering Label ID to associate with this metering rule.";
62         }
63         leaf remote-ip-prefix {
64             description "The remote IP prefix to be associated with this metering rule. packet.";
65             type inet:ip-address;
66         }
67         leaf excluded {
68             type boolean;
69             description "Specify whether the remote_ip_prefix 
70                 will be excluded or not from traffic counters of
71                 the metering label, ie: to not count the traffic
72                 of a specific IP address of a range.";
73             default "false";
74         }
75     }
76
77     grouping metering-labels-attributes {
78         container metering-labels {
79             description "Container for metering labels.";
80             list metering-label {
81                 key "uuid";
82                 uses attrs:base-attrs;
83                 uses metering-label-attrs;
84                 description "List of Metering Labels.";
85             }
86         }
87     }
88     grouping metering-rules-attributes {
89         container metering-rules {
90             description " Container for metering rules.";
91             list metering-rule {
92                 key "id";
93                 uses metering-rule-attrs;
94                 description "List of Metering Rules.";
95             }
96         }
97     }
98 }