Move all neutron YANG models under "neutron" top-level 86/17386/3
authorKiran Sreenivasa <kkoushik@brocade.com>
Mon, 30 Mar 2015 20:48:29 +0000 (13:48 -0700)
committerRyan Moats <rmoats@us.ibm.com>
Tue, 31 Mar 2015 13:35:35 +0000 (08:35 -0500)
Patch 1:Moved all the neutron YANG models under the "neutron" top-level as suggested by Ed. Fixed compile errors too.
Patch 2: Fixed Rogue space issues from Flavio.
Patch 3: rebase

Change-Id: I411b1eea5f5a30a1b2b17cb9d5020984803ab349
Signed-off-by: Kiran Sreenivasa <kkoushik@brocade.com>
model/src/main/yang/neutron-L3-ext.yang [new file with mode: 0644]
model/src/main/yang/neutron-L3.yang
model/src/main/yang/neutron-metering.yang
model/src/main/yang/neutron-network.yang
model/src/main/yang/neutron-ports.yang
model/src/main/yang/neutron-provider-ext.yang [new file with mode: 0644]
model/src/main/yang/neutron-provider.yang
model/src/main/yang/neutron-secgroups.yang
model/src/main/yang/neutron-subnets.yang
model/src/main/yang/neutron.yang [new file with mode: 0644]

diff --git a/model/src/main/yang/neutron-L3-ext.yang b/model/src/main/yang/neutron-L3-ext.yang
new file mode 100644 (file)
index 0000000..fc15e5d
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * 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-L3-ext {
+
+    yang-version 1;
+
+    namespace "urn:opendaylight:neutron-L3-ext";
+
+    prefix neutron-L3-ext;
+
+    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 neutron-attrs { prefix "attrs"; }
+    import neutron-networks { prefix "networks"; }
+    import neutron { prefix "neutron"; }
+    import neutron-L3 { prefix "neutron-L3"; }
+
+    organization "OpenDaylight Neutron Group";
+
+    contact "J. Gregory Hall <ghall@brocade.com>, Kiran Sreenivasa <kkoushik@brocade.com>";
+
+    description "This YANG module defines L3 model extensions that are used by Openstack
+        Ice House Neutron modules.";
+
+    revision "2014-10-02" {
+        description
+                "Initial version of L3 model extensions used by OpenStack Ice House Neutron
+                models";
+    }
+
+    augment "/neutron:neutron/neutron:networks/neutron:network"{
+        description "
+          This module augments the networks container in the neutron-networks
+          module with router information.
+          ";
+        leaf external {
+            description "If true, it indicates that the router is externally accessible.";
+            type boolean;
+            default "false";
+        }
+    }
+}
index 8a04455ebe7feee299f16fd05201163d930b96b6..aa2a99d9175aee6b66a1d69e92393a50a8ee554f 100644 (file)
@@ -31,17 +31,7 @@ module neutron-L3 {
                 "Initial version of L3 attributes used by OpenStack Ice House Neutron
                 models";
     }
-    augment "/networks:networks/networks:network"{
-        description "
-          This module augments the networks container in the neutron-networks
-          module with router information.
-          ";
-        leaf external {
-            description "If true, it indicates that the router is externally accessible.";
-            type boolean;
-            default "false";
-        }
-    }
+
     grouping L3-attrs {
 
         leaf-list external_network_id {
@@ -109,32 +99,35 @@ module neutron-L3 {
         }
     }
 
-    container routers {
-        list router {
-
-            description "A logical entity for forwarding packets across internal subnets
-                and NATting them on external networks through an appropriate external
-                gateway.";
-
-            key "uuid";
-            uses attrs:base-attrs;
-            uses attrs:admin-attrs;
-            uses L3-attrs;
-            list interfaces {
-                description "List of interfaces associated with this router object.";
-                uses interface-attrs;
+    grouping routers-attributes {
+        container routers {
+            list router {
+
+                description "A logical entity for forwarding packets across internal subnets
+                    and NATting them on external networks through an appropriate external
+                    gateway.";
+
+                key "uuid";
+                uses attrs:base-attrs;
+                uses attrs:admin-attrs;
+                uses L3-attrs;
+                list interfaces {
+                    description "List of interfaces associated with this router object.";
+                    uses interface-attrs;
+                }
             }
         }
     }
-    container floatingips {
-        list floatingip {
+    grouping floatingips-attributes {
+        container floatingips {
+            list floatingip {
 
-            description "An external IP address that is mapped to a port that is
-                attached to an internal network.";
+                description "An external IP address that is mapped to a port that is
+                    attached to an internal network.";
 
-            key "uuid";
-            uses L3-floatingip-attrs;
+                key "uuid";
+                uses L3-floatingip-attrs;
+            }
         }
     }
-
 }
index ebc7bd09c11bb542e35e05c6ac04a88d14d00bfe..73acc13bf1ee2bd5ba8bed143bd243806770e75e 100644 (file)
@@ -73,19 +73,24 @@ module neutron-metering {
             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 {
+                uses attrs:base-attrs;
+                uses metering-label-attrs;
+                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 {
+                uses metering-rule-attrs;
+                description "List of Metering Rules.";
+            }
         }
     }
 }
\ No newline at end of file
index 4f61daa8b00390a31ff3c72e45c570150ce44415..3d37b1fb67e53aae477885a841fa71300a53c7c9 100644 (file)
@@ -78,21 +78,23 @@ module neutron-networks {
 
     }
 
-    container networks {
-        list network {
-
-            description "A network is a virtual isolated layer-2 broadcast domain which
-                        is typically reserved to the tenant who created it, unless the
-                        network has been explicitly configured to be shared. Tenants can
-                        create multiple networks, until they reach the thresholds specified
-                        by per-tenant Quotas. The network is the principal entity for 
-                        the Neutron API. Ports and Subnets must always be associated 
-                        with a network.";
-
-            key "uuid";
-            uses attrs:base-attrs;
-            uses attrs:admin-attrs;
-            uses network-attrs;
+    grouping networks-attributes {
+        container networks {
+            list network {
+
+                description "A network is a virtual isolated layer-2 broadcast domain which
+                            is typically reserved to the tenant who created it, unless the
+                            network has been explicitly configured to be shared. Tenants can
+                            create multiple networks, until they reach the thresholds specified
+                            by per-tenant Quotas. The network is the principal entity for 
+                            the Neutron API. Ports and Subnets must always be associated 
+                            with a network.";
+
+                key "uuid";
+                uses attrs:base-attrs;
+                uses attrs:admin-attrs;
+                uses network-attrs;
+            }
         }
     }
 }
index f059cb723761464c16d35f25eb9d56ef9a428566..39ae5c621568751f36bf39f84da417da073991c1 100644 (file)
@@ -115,12 +115,14 @@ module neutron-ports {
         }
     }
 
-    container ports {
-        list port {
-            key "uuid";
-            uses attrs:base-attrs;
-            uses attrs:admin-attrs;
-            uses port-attrs;
+    grouping ports-attributes {
+        container ports {
+            list port {
+                key "uuid";
+                uses attrs:base-attrs;
+                uses attrs:admin-attrs;
+                uses port-attrs;
+            }
         }
     }
 }
diff --git a/model/src/main/yang/neutron-provider-ext.yang b/model/src/main/yang/neutron-provider-ext.yang
new file mode 100644 (file)
index 0000000..6c911c1
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * 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-provider-ext {
+
+    yang-version 1;
+
+    namespace "urn:opendaylight:neutron-provider-ext";
+
+    prefix neutron-provider-ext;
+
+    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 neutron-attrs { prefix "attrs"; }
+    import neutron-networks { prefix "networks"; }
+    import neutron { prefix "neutron"; }
+    import neutron-provider { prefix "provider"; }
+
+    organization "OpenDaylight Neutron Group";
+
+    contact "J. Gregory Hall <ghall@brocade.com>, Kiran Sreenivasa <kkoushik@brocade.com>";
+
+    description "This YANG module defines provider model extensions that are used by Openstack
+        Ice House Neutron YANG modules.";
+
+    revision "2014-10-02" {
+        description
+                "Initial version of provider model extensions used by OpenStack Ice House Neutron
+                models";
+    }
+
+    augment "/neutron:neutron/neutron:networks/neutron:network"{
+        description "
+          This module augments the networks container in the neutron-networks
+          module with provider information.
+          ";
+        list providers {
+            description "List of provider network(s) associated with this network.";
+            key segmentation-id;
+            uses provider:provider-attrs;
+        }
+        uses provider:provider-attrs;
+    }
+}
index 088b208aa5c1ed2e044f8ffceb73224a2d147161..ec4de09f2287e786c5eb110b30a805850021d620 100644 (file)
@@ -54,17 +54,4 @@ module neutron-provider {
                         this ID is a gre key.";
         }
     }
-
-    augment "/networks:networks/networks:network"{
-        description "
-          This module augments the networks container in the neutron-networks
-          module with provider information.
-          ";
-        list segments {
-            description "List of provider network(s) associated with this network.";
-            key segmentation-id;
-            uses provider-attrs;
-        }
-        uses provider-attrs;
-    }
 }
index f8dab48b400165308caa20b2381b91322e43897e..de60080cbd30ad4652b93b80ec6f13266585472d 100644 (file)
@@ -121,19 +121,25 @@ module neutron-secgroups {
                 is ICMP, this value must be an ICMP type.";
         }
     }
-    container security-groups {
-        description "Container for security groups.";
-        list security-group {
-            uses attrs:base-attrs;
-            uses security-group-attrs;
-            description "List of Metering Labels.";
+
+    grouping security-groups-attributes {
+        container security-groups {
+            description "Container for security groups.";
+            list security-group {
+                uses attrs:base-attrs;
+                uses security-group-attrs;
+                description "List of Metering Labels.";
+            }
         }
     }
-    container security-rules {
-        description "Container for security group rules.";
-        list security-rule {
-            uses security-rule-attrs;
-            description "List of Security Group Rules.";
+
+    grouping security-rules-attributes {
+        container security-rules {
+            description "Container for security group rules.";
+            list security-rule {
+                uses security-rule-attrs;
+                description "List of Security Group Rules.";
+            }
         }
     }
 }
\ No newline at end of file
index a9d8810200fda30ede7c348dd0b091a84cc97283..3902952a2ee4523d22fcf3e0d063c554d27f1fa1 100644 (file)
@@ -109,12 +109,13 @@ module neutron-subnets {
             description "Specifies whether DHCP is enabled for this subnet or not.";
         }
     }
-
-    container subnets {
-        list subnet {
-            key "uuid";
-            uses attrs:base-attrs;
-            uses subnet-attrs;
+    grouping subnets-attributes {
+        container subnets {
+            list subnet {
+                key "uuid";
+                uses attrs:base-attrs;
+                uses subnet-attrs;
+            }
         }
     }
 }
\ No newline at end of file
diff --git a/model/src/main/yang/neutron.yang b/model/src/main/yang/neutron.yang
new file mode 100644 (file)
index 0000000..0488dfc
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2014 Cisco 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 {
+
+    yang-version 1;
+
+    namespace "urn:opendaylight:neutron-L3";
+
+    prefix neutron-L3;
+
+    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 neutron-attrs { prefix "attrs"; }
+    import neutron-networks { prefix "networks"; }
+    import neutron-ports { prefix "ports"; }
+    import neutron-subnets { prefix "subnets"; }
+    import neutron-secgroups { prefix "secgroups"; }
+    import neutron-L3 { prefix "l3"; }
+    import neutron-metering { prefix "metering"; }
+
+    organization "OpenDaylight Neutron Group";
+
+    contact "Ed Warnicke <eaw@cisco.com>";
+
+    description "This YANG module defines a top level for the neutron models in opendaylight.";
+
+    revision "2015-03-25" {
+        description
+                "Initial version of top level neutron model";
+    }
+
+    container neutron {
+        uses networks:networks-attributes;
+        uses l3:routers-attributes;
+        uses l3:floatingips-attributes;
+        uses metering:metering-labels-attributes;
+        uses metering:metering-rules-attributes;
+        uses ports:ports-attributes;
+        uses secgroups:security-groups-attributes;
+        uses secgroups:security-rules-attributes;
+        uses subnets:subnets-attributes;
+    }
+}
\ No newline at end of file