Candidate Yang models for openstack neutron in OpenDaylight Controller 89/15989/14
authorKiran Koushik <kkoushik@brocade.com>
Tue, 3 Mar 2015 21:58:31 +0000 (03:28 +0530)
committerKiran Sreenivasa <kkoushik@brocade.com>
Fri, 20 Mar 2015 23:26:41 +0000 (16:26 -0700)
This patch is moving the neutron models pushed to controller repo through following gerrit
https://git.opendaylight.org/gerrit/#/c/13970/1

Scope of this patch is to define yang models in OpenDaylight controller for openstack neutron
APIs, so that we can enable the mechanism to store the neutron resource data in md-sal data
store for other applications to consume.
Patch 2: Address comments from reviewer
Patch 3: Removed whitespaces
Patch 4: Split models into 4 files. Fixed all reviewer comments(except one).
Patch 5: Fixed a build error(removed neutron.yang)
Patch 6: Fixed one remaining reviewer comment(move network-type to identity)
Patch 7: Fixed many comments(including tabs, moving provider to separate file, naming issues, re-org etc.
Patch 8: Added neutron-L3.yang module and fixed some more review comments
Patch 9: Fixed more comments from Ryan. Added augments in provider and L3 module.
Patch 10: Added neutron-metering.yang
Patch 11: Added neutron-secgroups.yang
Patch 12: Fixed uuid issue with Ed's patch + moved network defns into networks module
Patch 13: Fixed Ryan's latest comments(remove trailing space & Fix description)
Patch 14: Fixed Ryan's comments about Security group rules
Change-Id: I1fbc79e6e9856fa7cd18dd92d138e2b84a6d6a3c
Signed-off-by: Anil Vishnoi <vishnoianil@gmail.com>
Signed-off-by: Kiran Sreenivasa <kkoushik@brocade.com>
model/pom.xml [new file with mode: 0644]
model/src/main/yang/neutron-L3.yang [new file with mode: 0644]
model/src/main/yang/neutron-attrs.yang [new file with mode: 0644]
model/src/main/yang/neutron-metering.yang [new file with mode: 0644]
model/src/main/yang/neutron-network.yang [new file with mode: 0644]
model/src/main/yang/neutron-ports.yang [new file with mode: 0644]
model/src/main/yang/neutron-provider.yang [new file with mode: 0644]
model/src/main/yang/neutron-secgroups.yang [new file with mode: 0644]
model/src/main/yang/neutron-subnets.yang [new file with mode: 0644]
parent/pom.xml
pom.xml

diff --git a/model/pom.xml b/model/pom.xml
new file mode 100644 (file)
index 0000000..3d96c30
--- /dev/null
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.opendaylight.yangtools</groupId>
+    <artifactId>binding-parent</artifactId>
+    <version>0.7.0-SNAPSHOT</version>
+    <relativePath/>
+  </parent>
+
+  <groupId>org.opendaylight.neutron</groupId>
+  <artifactId>model</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.opendaylight.yangtools</groupId>
+      <artifactId>yang-binding</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.yangtools</groupId>
+      <artifactId>yang-common</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.yangtools.model</groupId>
+      <artifactId>ietf-inet-types</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.yangtools.model</groupId>
+      <artifactId>ietf-yang-types-20130715</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.yangtools.model</groupId>
+      <artifactId>yang-ext</artifactId>
+    </dependency>
+  </dependencies>
+  <scm>
+    <connection>scm:git:ssh://git.opendaylight.org:29418/neutron.git</connection>
+    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/neutron.git</developerConnection>
+    <tag>HEAD</tag>
+    <url>https://wiki.opendaylight.org/view/NeutronNorthBound:Main</url>
+  </scm>
+</project>
\ No newline at end of file
diff --git a/model/src/main/yang/neutron-L3.yang b/model/src/main/yang/neutron-L3.yang
new file mode 100644 (file)
index 0000000..66728f2
--- /dev/null
@@ -0,0 +1,135 @@
+//
+// 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.
+//
+module neutron-L3 {
+
+    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"; }
+
+    organization "OpenDaylight Neutron Group";
+
+    contact "J. Gregory Hall <ghall@brocade.com>";
+
+    description "This YANG module defines L3 attributes that are used by Openstack
+        Ice House Neutron modules.";
+
+    revision "2014-10-02" {
+        description
+                "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 {
+            description "The network_id, for the external gateways. If this is empty, then this
+                network does not have external access";
+            type yang:uuid;
+        }
+        leaf router-status {
+            description "Contains the Router status.";
+            type string;
+        }
+    }
+
+    grouping L3-floatingip-attrs {
+        leaf uuid {
+            type yang:uuid;
+            description "UUID to index this object.";
+        }
+
+        leaf tenant-id {
+            type yang:uuid;
+            description "The Tenant ID of this object.";
+        }
+        leaf router-id {
+            description "Contains the Router ID of this floatingip object.";
+            type yang:uuid;
+        }
+        leaf port-id {
+            description "Contains the Port ID of the fixed IP address that will be
+                associated with this object.";
+            type yang:uuid;
+        }
+        leaf floating-network-id {
+            description "The ID of the network associated with the floating IP.";
+            type yang:uuid;
+        }
+        leaf floating-ip-address {
+            description "The floating IP address.";
+            type inet:ip-address;
+        }
+        leaf fixed-ip-address {
+            description "The fixed IP address associated with the floating IP.
+                If you intend to associate the floating IP with a fixed IP at
+                creation time, then you must indicate the identifier of the
+                internal port(using port-id object). If an internal port has
+                multiple associated IP addresses, the service chooses the first
+                IP unless you explicitly specify the parameter fixed_ip_address
+                to select a specific IP.";
+            type inet:ip-address;
+        }
+    }
+
+    grouping interface-attrs {
+        leaf subnet-id {
+            description "Contains the Subnet ID of the interface.";
+            type yang:uuid;
+        }
+        leaf port-id {
+            description "Contains the Port ID of the interface.";
+            type yang:uuid;
+        }
+    }
+
+    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 {
+
+            description "An external IP address that is mapped to a port that is
+                attached to an internal network.";
+
+            key "uuid";
+            uses L3-floatingip-attrs;
+        }
+    }
+
+}
diff --git a/model/src/main/yang/neutron-attrs.yang b/model/src/main/yang/neutron-attrs.yang
new file mode 100644 (file)
index 0000000..c8f5541
--- /dev/null
@@ -0,0 +1,65 @@
+//
+// 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.
+//
+module neutron-attrs {
+
+    yang-version 1;
+
+    namespace "urn:opendaylight:neutron-attrs";
+
+    prefix neutron-attrs;
+
+    import ietf-yang-types { prefix "yang"; revision-date "2013-07-15";}
+    // 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; }
+
+    organization "OpenDaylight Neutron Group";
+
+    contact "J. Gregory Hall <ghall@brocade.com>";
+
+    description "This YANG module defines groupings that are used by Openstack
+        Ice House Neutron YANG modules.";
+
+    revision "2014-10-02" {
+        description
+                "Initial version of attributes used by OpenStack Ice House Neutron
+                models";
+    }
+
+    grouping base-attrs {
+
+        leaf uuid {
+            type yang:uuid;
+            description "UUID to index this neutron object.";
+        }
+
+        leaf name {
+            type string;
+            description "Human-readable name for the item. Might not be unique.";
+        }
+
+        leaf tenant-id {
+            type yang:uuid;
+            description "Admin-only. The UUID of the tenant that will own the network.
+                        This tenant can be different from the tenant that makes the create
+                        network request. However, only administrative users can specify
+                        a tenant ID other than their own. You cannot change this value
+                        through authorization policies.";
+        }
+    }
+
+    grouping admin-attrs {
+        leaf admin-state-up {
+            type boolean;
+            description "The administrative state of the network, which is up (true) or
+                        down (false).";
+        }
+        leaf status {
+            type string;
+            description "The network status.";
+        }
+    }
+}
diff --git a/model/src/main/yang/neutron-metering.yang b/model/src/main/yang/neutron-metering.yang
new file mode 100644 (file)
index 0000000..8c5af8d
--- /dev/null
@@ -0,0 +1,90 @@
+//
+// 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.
+//
+module neutron-metering {
+
+    yang-version 1;
+
+    namespace "urn:opendaylight: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 neutron-attrs { prefix "attrs"; }
+
+    organization "OpenDaylight Neutron Group";
+
+    contact "J. Gregory Hall <ghall@brocade.com>";
+
+    description "This YANG module defines metering attributes that are used by Openstack
+        Ice House Neutron YANG modules.";
+
+    revision "2014-10-02" {
+        description
+                "Initial version of metering attributes used by OpenStack Ice House Neutron
+                models";
+    }
+
+    grouping metering-label-attrs {
+        description "OpenStack Layer3 Metering label information.";
+        leaf description {
+            type string;
+            description "Description for the metering label.";
+        }
+    }
+    grouping metering-rule-attrs {
+        description "OpenStack Layer3 Metering label rules.";
+        leaf id {
+            type yang:uuid;
+            description "Metering Rule ID.";
+        }
+        leaf direction {
+            type enumeration {
+                enum ingress {
+                    description "Ingress direction.";
+                  }
+                  enum egress {
+                    description "Egress direction.";
+                  }
+            }
+            description "The direction in which metering rule is applied.";
+            default "ingress";
+        }
+        leaf metering-label-id {
+            type yang:uuid;
+            description "Metering Label ID to associate with this metering rule.";
+        }
+        leaf remote-ip-prefix {
+            description "The remote IP prefix to be associated with this metering rule. packet.";
+            type inet:ip-address;
+        }
+        leaf excluded {
+            type boolean;
+            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.";
+        }
+    }
+    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
diff --git a/model/src/main/yang/neutron-network.yang b/model/src/main/yang/neutron-network.yang
new file mode 100644 (file)
index 0000000..aca6851
--- /dev/null
@@ -0,0 +1,97 @@
+//
+// 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.
+//
+module neutron-networks {
+
+    yang-version 1;
+
+    namespace "urn:opendaylight:neutron-networks";
+
+    prefix neutron-networks;
+
+    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"; }
+
+    organization "OpenDaylight Neutron Group";
+
+    contact "J. Gregory Hall <ghall@brocade.com>";
+
+    description "This YANG module defines Openstack Ice House Neutron Network model";
+
+    revision "2014-10-02" {
+        description
+                "Initial version of Openstack Neutron Ice House Network model.";
+    }
+    identity network-type-base {
+        description
+                "Base Network type for all Network type identifiers.";
+    }
+
+    identity network-type-flat {
+        base network-type-base;
+        description
+                "Flat network type identity.";
+    }
+    identity network-type-vlan {
+        base network-type-base;
+        description
+                "VLAN network type identity.";
+    }
+    identity network-type-vxlan {
+        base network-type-base;
+        description
+                "VXLAN network type identity.";
+    }
+    identity network-type-gre {
+        base network-type-base;
+        description
+                "GRE network type identity.";
+    }
+
+    typedef network-type {
+        type identityref {
+            base network-type-base;
+        }
+        description
+                "This type is used to refer to a Network Type.";
+    }
+    grouping network-attrs {
+
+        leaf-list subnets {
+            description "The associated subnets.";
+            type yang:uuid;
+        }
+
+        leaf shared {
+            type boolean;
+            default "false";
+            description "Indicates whether this network or subnet is shared across all
+                        tenants. By default, only administrative users can change this
+                        value.";
+        }
+
+    }
+
+    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;
+        }
+    }
+}
diff --git a/model/src/main/yang/neutron-ports.yang b/model/src/main/yang/neutron-ports.yang
new file mode 100644 (file)
index 0000000..2f75120
--- /dev/null
@@ -0,0 +1,125 @@
+//
+// 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.
+//
+module neutron-ports {
+
+    yang-version 1;
+
+    namespace "urn:opendaylight:neutron-ports";
+
+    prefix neutron-ports;
+
+    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"; }
+
+    organization "OpenDaylight Neutron Group";
+
+    contact "J. Gregory Hall <ghall@brocade.com>";
+
+    description "This YANG module defines Openstack Ice House Neutron Ports model";
+
+    revision "2014-10-02" {
+        description
+                "Initial version of Openstack Neutron Ice House Ports model.";
+    }
+
+    grouping port-attrs {
+        leaf binding-host-id {
+            type yang:uuid;
+            description "The ID of the host where the port is allocated. In some cases,
+                        different implementations can run on different hosts.";
+        }
+        leaf-list allowed-address-pairs {
+            type string;
+            description "Allowed address pairs for this port. For example: neutron port-create
+                        net1 --allowed-address-pairs type=dict list=true mac_address=<mac_address>,ip_address=<ip_cidr>
+                        Setting an allowed-address-pair that matches the mac_address and
+                        ip_address of a port is prevented. This is because that would
+                        have no effect since traffic matching the mac_address and ip_address
+                        is already allowed to pass through the port";
+        }
+
+        leaf network-id {
+            type yang:uuid;
+        }
+        list extra-dhcp-opts {
+            description "Extra DHCP options";
+            reference "http://developer.openstack.org/api-ref-networking-v2.html";
+            key id ;
+            leaf id {
+                type string;
+            }
+            leaf opt-name {
+                type string;
+            }
+            leaf opt-value {
+                type string;
+            }
+        }
+
+        list binding-vif-details {
+            description "A dictionary that enables the application to pass information
+                        about functions that the Networking API provides. To enable or
+                        disable port filtering features such as security group and anti-MAC/IP
+                        spoofing, specify port-filter: True or port-filter: False ";
+
+            key id;
+            leaf id {
+                type string;
+            }
+
+            leaf port-filter {
+                type boolean;
+            }
+            leaf ovs-hybrid-plug {
+                type boolean;
+            }
+        }
+        leaf binding-vif-type {
+            type string;
+        }
+        leaf binding-vnic-type {
+            type string;
+        }
+        leaf device-owner {
+            type string;
+        }
+        leaf mac-address {
+            type string;
+        }
+        leaf binding-profile {
+            type string;
+        }
+
+        list fixed-ips {
+            key subnet-id;
+            leaf subnet-id {
+                type yang:uuid;
+            }
+            leaf ip-address {
+                type inet:ip-address;
+            }
+        }
+
+        leaf-list security-groups {
+            type yang:uuid;
+        }
+        leaf device-id {
+            type yang:uuid;
+        }
+    }
+
+    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.yang b/model/src/main/yang/neutron-provider.yang
new file mode 100644 (file)
index 0000000..3e510a1
--- /dev/null
@@ -0,0 +1,69 @@
+//
+// 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.
+//
+module neutron-provider {
+
+    yang-version 1;
+
+    namespace "urn:opendaylight:neutron-provider";
+
+    prefix neutron-provider;
+
+    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"; }
+
+    organization "OpenDaylight Neutron Group";
+
+    contact "J. Gregory Hall <ghall@brocade.com>";
+
+    description "This YANG module defines provider attributes that are used by Openstack
+        Ice House Neutron YANG modules.";
+
+    revision "2014-10-02" {
+        description
+                "Initial version of provider attributes used by OpenStack Ice House Neutron
+                models";
+    }
+
+    grouping provider-attrs {
+        leaf physical-network {
+            type string;
+            description "The physical network where this network object is implemented.
+                        The Networking API v2.0 does not provide a way to list available
+                        physical networks. For example, the Open vSwitch plug-in configuration
+                        file defines a symbolic name that maps to specific bridges on
+                        each Compute host.";
+        }
+
+        leaf network-type {
+            type networks:network-type;
+            description "The type of physical network that maps to this network resource.";
+        }
+        leaf segmentation-id {
+            type string;
+            description "An isolated segment on the physical network. The network-type
+                        attribute defines the segmentation model. For example, if network-type
+                        is vlan, this ID is a vlan identifier. If network-type is gre,
+                        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 providers {
+            description "List of provider network(s) associated with this network.";
+            key segmentation-id;
+            uses provider-attrs;
+        }
+        uses provider-attrs;
+    }
+}
diff --git a/model/src/main/yang/neutron-secgroups.yang b/model/src/main/yang/neutron-secgroups.yang
new file mode 100644 (file)
index 0000000..c43f3a1
--- /dev/null
@@ -0,0 +1,138 @@
+//
+// 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.
+//
+module neutron-secgroups {
+
+    yang-version 1;
+
+    namespace "urn:opendaylight:neutron-secgroups";
+
+    prefix neutron-secgroups;
+
+    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"; }
+
+    organization "OpenDaylight Neutron Group";
+
+    contact "J. Gregory Hall <ghall@brocade.com>";
+
+    description "This YANG module defines Security group objects that are used by Openstack
+        Ice House Neutron YANG modules.";
+
+    revision "2014-10-02" {
+        description
+                "Initial version of Security group objects used by OpenStack Ice House Neutron
+                models";
+    }
+
+    grouping security-group-attrs {
+        description "OpenStack Layer3 Security group information.";
+        leaf description {
+            type string;
+            description "Description for the security group.";
+        }
+    }
+    grouping security-rule-attrs {
+        description "OpenStack Layer3 Security Group rules.";
+        leaf id {
+            type yang:uuid;
+            description "Security Rule ID.";
+        }
+        leaf tenant-id {
+            type yang:uuid;
+            description "UUID of the tenant.";
+        }
+        leaf direction {
+            type enumeration {
+                enum ingress {
+                    description "Ingress direction.";
+                  }
+                  enum egress {
+                    description "Egress direction.";
+                  }
+            }
+            description "The direction in which metering rule is applied.
+                For a compute instance, an ingress security group rule is
+                applied to incoming (ingress) traffic for that instance.
+                An egress rule is applied to traffic leaving the instance.";
+            default "ingress";
+        }
+        leaf security-group-id {
+            type yang:uuid;
+            description "The security group ID to associate with this security group rule.";
+        }
+        leaf remote-group-id {
+            description "The remote group ID to be associated with this security group rule.
+                You can specify either remote-ip-prefix or remote-group-id in the request body.";
+            type yang:uuid;
+        }
+        leaf remote-ip-prefix {
+            description "The remote IP Prefix to be associated with this security group rule.
+                You can specify either remote-ip-prefix or remote-group-id in the request body.";
+            type inet:ip-address;
+        }
+        leaf protocol {
+            type enumeration {
+                enum null {
+                    description "NULL protocol.";
+                }
+                enum icmp {
+                    description "ICMP protocol.";
+                }
+                enum udp {
+                    description "UDP protocol.";
+                }
+                enum tcp {
+                    description "TCP protocol.";
+                }
+            }
+            description "The protocol that is matched by the security group rule.";
+        }
+        leaf ethertype {
+            description "Must be IPv4 or IPv6, and addresses represented in CIDR must
+                match the ingress or egress rules.";
+            type enumeration {
+                enum ipv4 {
+                    description "ipv4 type.";
+                }
+                enum ipv6 {
+                    description "ipv6 type.";
+                }
+            }
+        }
+        leaf port-range-min {
+            type uint32;
+            description "The minimum port number in the range that is matched by the
+                security group rule. If the protocol is TCP or UDP, this value must
+                be less than or equal to the value of the attribute. If the protocol
+                is ICMP, this value must be an ICMP type.";
+        }
+        leaf port-range-max {
+            type uint32;
+            description "The maximum port number in the range that is matched by the
+                security group rule. If the protocol is TCP or UDP, this value must
+                be less than or equal to the value of the attribute. If the protocol
+                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.";
+        }
+    }
+    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
diff --git a/model/src/main/yang/neutron-subnets.yang b/model/src/main/yang/neutron-subnets.yang
new file mode 100644 (file)
index 0000000..5ccf970
--- /dev/null
@@ -0,0 +1,119 @@
+//
+// 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.
+//
+module neutron-subnets {
+
+    yang-version 1;
+
+    namespace "urn:opendaylight:neutron-subnets";
+
+    prefix neutron-subnets;
+
+    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"; }
+
+    organization "OpenDaylight Neutron Group";
+
+    contact "J. Gregory Hall <ghall@brocade.com>";
+
+    description "This YANG module defines Openstack Ice House Neutron Subnets model";
+
+    revision "2014-10-02" {
+        description
+                "Initial version of Openstack Neutron Ice House Subnets model.";
+    }
+
+    grouping subnet-attrs {
+        leaf network-id {
+            type yang:uuid;
+            description "network this subnet is associated with.";
+        }
+        leaf ip-version {
+            description "IP version";
+            type enumeration {
+                enum 4;
+                enum 6;
+            }
+        }
+        leaf cidr {
+            type string;
+            description "cidr representing IP range for this subnet, based on IP version";
+        }
+        leaf gateway-ip {
+            type inet:ip-address;
+            description "default gateway used by devices in this subnet";
+        }
+        leaf-list dns-nameservers {
+            type inet:ip-address;
+            description "DNS name servers used by hosts in this subnet.";
+            // neutron subnet-create test-net1 40.0.0.0/24 --dns-nameservers list=true 8.8.8.7 8.8.8.8        }        }
+        }
+        leaf ipv6-address-mode {
+
+            description "neutron subnet-create --ip-version 6 --ipv6_ra_mode off --ipv6_address_mode
+                        off NETWORK CIDR neutron subnet-create --ip-version 6 --ipv6_ra_mode
+                        off --ipv6_address_mode dhcpv6-stateful NETWORK CIDR neutron subnet-create
+                        --ip-version 6 --ipv6_ra_mode slaac --ipv6_address_mode slaac
+                        NETWORK CIDR neutron subnet-create --ip-version 6 --ipv6_ra_mode
+                        dhcpv6-stateful --ipv6_address_mode off NETWORK CIDR neutron subnet-create
+                        --ip-version 6 --ipv6_ra_mode dhcpv6-stateless --ipv6_address_mode
+                        dhcpv6-stateless NETWORK CIDR Note: can't find this in the spec
+                        but OS is sending it with a null value.";
+            // ?? Do we make this an enumeration for validation or require the writer to write good values?
+            type enumeration {
+                enum off;
+                enum dhcpv6-stateful;
+                enum slaac;
+                enum dhcpv6-stateless;
+            }
+        }
+        leaf ipv6-ra-mode {
+            description "TODO can't find this in the spec but OS sends it with a null
+                        value.";
+            type enumeration {
+                enum off;
+                enum dhcpv6-stateful;
+                enum slaac;
+                enum dhcpv6-stateless;
+            }
+        }
+        list allocation-pools {
+            description "Sub-ranges of cidr available for dynamic allocation to ports";
+            key start;
+            leaf start {
+                type string;
+            }
+            leaf end {
+                type string;
+            }
+        }
+        list host-routes {
+            description "Routes that should be used by devices with IPs from this subnet
+                        (not including local subnet route).";
+            key destination;
+            leaf destination {
+                type inet:ip-address;
+            }
+            leaf nexthop {
+                type inet:ip-address;
+            }
+        }
+        leaf enable-dhcp {
+            type boolean;
+            description "Specifies whether DHCP is enabled for this subnet or not.";
+        }
+    }
+
+    container subnets {
+        list subnet {
+            key "uuid";
+            uses attrs:base-attrs;
+            uses subnet-attrs;
+        }
+    }
+}
\ No newline at end of file
index 038b538a7992207065db48a1c4167cd861f27042..9dac730c6b5680237d1922af79304769d61dbcbb 100644 (file)
   <artifactId>project-neutron-parent</artifactId>
   <version>0.5.0-SNAPSHOT</version>
   <packaging>pom</packaging>
+
   <properties>
     <aaa.version>0.1.3-SNAPSHOT</aaa.version>
     <jacoco.version>0.6.2.201302030002</jacoco.version>
+    <ietf-yang-types.version>2010.09.24.7-SNAPSHOT</ietf-yang-types.version>
+    <ietf-inet-types.version>2010.09.24.7-SNAPSHOT</ietf-inet-types.version>
+    <salGeneratorPath>src/main/yang-gen-sal</salGeneratorPath>
+    <yang.binding.version>0.7.0-SNAPSHOT</yang.binding.version>
+    <yangtools.version>0.7.0-SNAPSHOT</yangtools.version>
+    <yang-ext.version>2013.09.07.7-SNAPSHOT</yang-ext.version>
+    <maven.bundle.version>2.4.0</maven.bundle.version>
   </properties>
   <scm>
     <connection>scm:git:ssh://git.opendaylight.org:29418/neutron.git</connection>
     <developerConnection>scm:git:ssh://git.opendaylight.org:29418/neutron.git</developerConnection>
     <tag>HEAD</tag>
   </scm>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.opendaylight.yangtools</groupId>
+        <artifactId>yang-binding</artifactId>
+        <version>${yang.binding.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.opendaylight.yangtools</groupId>
+        <artifactId>yang-common</artifactId>
+        <version>${yang.binding.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.opendaylight.yangtools.model</groupId>
+        <artifactId>ietf-inet-types</artifactId>
+        <version>${ietf-inet-types.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.opendaylight.yangtools.model</groupId>
+        <artifactId>ietf-yang-types</artifactId>
+        <version>${ietf-yang-types.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.opendaylight.yangtools.model</groupId>
+        <artifactId>yang-ext</artifactId>
+        <version>${yang-ext.version}</version>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
   <build>
     <pluginManagement>
       <plugins>
           <artifactId>jacoco-maven-plugin</artifactId>
           <version>${jacoco.version}</version>
         </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-source-plugin</artifactId>
+          <version>2.2.1</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-jar-plugin</artifactId>
+          <version>2.4</version>
+        </plugin>
+        <plugin>
+          <groupId>org.opendaylight.yangtools</groupId>
+          <artifactId>yang-maven-plugin</artifactId>
+          <version>${yangtools.version}</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.felix</groupId>
+          <artifactId>maven-bundle-plugin</artifactId>
+          <version>${maven.bundle.version}</version>
+        </plugin>
       </plugins>
     </pluginManagement>
     <plugins>
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <extensions>true</extensions>
+        <configuration>
+          <instructions>
+            <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
+          </instructions>
+          <manifestLocation>${project.build.directory}/META-INF</manifestLocation>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <inherited>true</inherited>
+        <configuration>
+          <source>1.7</source>
+          <target>1.7</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-source-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>attach-sources</id>
+            <phase>deploy</phase>
+            <goals>
+              <goal>jar-no-fork</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
-  </build> 
-</project>
+  </build>
+</project>
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 728130e834655a195b2e2134aee39e638d313315..48a180634603027e1b0f5dfac3e8a2539ed2423e 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -25,5 +25,6 @@
     <module>transcriber</module>
     <module>features</module>
     <module>karaf</module>
+    <module>model</module>
   </modules>
 </project>