yang model revise: neutron-metering.yang
[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     import neutron-constants { prefix "constants"; }
21
22     organization "OpenDaylight Neutron Group";
23
24     contact "J. Gregory Hall <ghall@brocade.com>, Kiran Sreenivasa <kkoushik@brocade.com>";
25
26     description "This YANG module defines Openstack Neutron Metering attributes";
27
28     revision "2015-07-12" {
29         description
30                 "OpenDaylight Beryllium release";
31     }
32
33     grouping metering-label-attributes {
34         description "OpenStack Layer3 Metering label information.";
35         leaf shared {
36             type boolean;
37             description "Indicates whether this metering label is shared across all tenants.";
38             default "false";
39         }
40     }
41
42     grouping metering-rule-attributes {
43         description "OpenStack Layer3 Metering label rules.";
44         leaf uuid {
45             type yang:uuid;
46             description "Metering Rule ID.";
47         }
48         leaf tenant-id {
49             type yang:uuid;
50             description "The UUID of the tenant that will own the object.";
51         }
52         leaf direction {
53             type identityref {
54                 base "constants:direction-base";
55             }
56             description "The direction in which metering rule is applied.";
57         }
58         leaf metering-label-id {
59             type yang:uuid;
60             description "Metering Label ID to associate with this metering rule.";
61         }
62         leaf remote-ip-prefix {
63             description "The remote IP prefix to be associated with this metering rule. packet.";
64             type inet:ip-prefix;
65         }
66         leaf excluded {
67             type boolean;
68             description "Specify whether the remote_ip_prefix
69                 will be excluded or not from traffic counters of
70                 the metering label, ie: to not count the traffic
71                 of a specific IP address of a range.";
72             default "false";
73         }
74     }
75
76     grouping metering-labels-attributes {
77         container metering-labels {
78             description "Container for metering labels.";
79             list metering-label {
80                 key "uuid";
81                 uses attrs:base-attributes;
82                 uses metering-label-attributes;
83                 description "List of Metering Labels.";
84             }
85         }
86     }
87
88     grouping metering-rules-attributes {
89         container metering-rules {
90             description " Container for metering rules.";
91             list metering-rule {
92                 key "uuid";
93                 uses metering-rule-attributes;
94                 description "List of Metering Rules.";
95             }
96         }
97     }
98 }