updating neutron-qos yang file for Qos Rule Types to change the model from Config...
[neutron.git] / model / src / main / yang / neutron-metering.yang
index 8c5af8dc94396d62d01c2b995be5f7d7ad28b85b..767f8f4e36ccab0dc48745f8389931572d790dbf 100644 (file)
@@ -1,9 +1,10 @@
-//
-// Copyright (c) 2012-2014 by Brocade Communications Systems, Inc. All Rights Reserved.
-//
-// This software is licensed, and not freely redistributable. See the
-// license agreement for details.
-//
+/*
+ * Copyright (c) 2015 Brocade Communications Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
 module neutron-metering {
 
     yang-version 1;
@@ -13,47 +14,45 @@ module neutron-metering {
     prefix neutron-metering;
 
     import ietf-yang-types { prefix "yang"; }
-    // It requires rfc6991 (revision 2013-07-15), but odl don't have it, so this patch verify build will fail.
-    import ietf-inet-types { prefix "inet"; revision-date 2010-09-24; }
+    import ietf-inet-types { prefix "inet"; revision-date 2013-07-15; }
     import neutron-attrs { prefix "attrs"; }
+    import neutron-constants { prefix "constants"; }
 
     organization "OpenDaylight Neutron Group";
 
-    contact "J. Gregory Hall <ghall@brocade.com>";
+    contact "J. Gregory Hall <ghall@brocade.com>, Kiran Sreenivasa <kkoushik@brocade.com>";
 
-    description "This YANG module defines metering attributes that are used by Openstack
-        Ice House Neutron YANG modules.";
+    description "This YANG module defines Openstack Neutron Metering attributes";
 
-    revision "2014-10-02" {
+    revision "2015-07-12" {
         description
-                "Initial version of metering attributes used by OpenStack Ice House Neutron
-                models";
+                "OpenDaylight Beryllium release";
     }
 
-    grouping metering-label-attrs {
+    grouping metering-label-attributes {
         description "OpenStack Layer3 Metering label information.";
-        leaf description {
-            type string;
-            description "Description for the metering label.";
+        leaf shared {
+            type boolean;
+            description "Indicates whether this metering label is shared across all tenants.";
+            default "false";
         }
     }
-    grouping metering-rule-attrs {
+
+    grouping metering-rule-attributes {
         description "OpenStack Layer3 Metering label rules.";
-        leaf id {
+        leaf uuid {
             type yang:uuid;
             description "Metering Rule ID.";
         }
+        leaf tenant-id {
+            type yang:uuid;
+            description "The UUID of the tenant that will own the object.";
+        }
         leaf direction {
-            type enumeration {
-                enum ingress {
-                    description "Ingress direction.";
-                  }
-                  enum egress {
-                    description "Egress direction.";
-                  }
+            type identityref {
+                base "constants:direction-base";
             }
             description "The direction in which metering rule is applied.";
-            default "ingress";
         }
         leaf metering-label-id {
             type yang:uuid;
@@ -61,30 +60,38 @@ module neutron-metering {
         }
         leaf remote-ip-prefix {
             description "The remote IP prefix to be associated with this metering rule. packet.";
-            type inet:ip-address;
+            type inet:ip-prefix;
         }
         leaf excluded {
             type boolean;
-            description "Specify whether the remote_ip_prefix 
+            description "Specify whether the remote_ip_prefix
                 will be excluded or not from traffic counters of
                 the metering label, ie: to not count the traffic
                 of a specific IP address of a range.";
             default "false";
         }
     }
-    container metering-labels {
-        description "Container for metering labels.";
-        list metering-label {
-            uses attrs:base-attrs;
-            uses metering-label-attrs;
-            description "List of Metering Labels.";
+
+    grouping metering-labels-attributes {
+        container metering-labels {
+            description "Container for metering labels.";
+            list metering-label {
+                key "uuid";
+                uses attrs:base-attributes;
+                uses metering-label-attributes;
+                description "List of Metering Labels.";
+            }
         }
     }
-    container metering-rules {
-        description " Container for metering rules.";
-        list metering-rule {
-            uses metering-rule-attrs;
-            description "List of Metering Rules.";
+
+    grouping metering-rules-attributes {
+        container metering-rules {
+            description " Container for metering rules.";
+            list metering-rule {
+                key "uuid";
+                uses metering-rule-attributes;
+                description "List of Metering Rules.";
+            }
         }
     }
-}
\ No newline at end of file
+}