From 300ffd3d6b4e4362599efe9ef37f774eb1fb3a86 Mon Sep 17 00:00:00 2001 From: Wojciech Dec Date: Mon, 6 Jun 2016 18:34:45 +0200 Subject: [PATCH] Adding Neutron Physical Provider network model. Allows relating Neutron providers to device physical interfaces Change-Id: I2016e0545d1956e2808cc563e04abfe50a1c50c9 Signed-off-by: Wojciech Dec --- neutron-mapper/pom.xml | 8 ++ .../main/yang/neutron-provider-topology.yang | 99 +++++++++++++++++++ .../src/main/yang/odl-external-reference.yang | 41 ++++++++ 3 files changed, 148 insertions(+) create mode 100644 neutron-mapper/src/main/yang/neutron-provider-topology.yang create mode 100644 neutron-mapper/src/main/yang/odl-external-reference.yang diff --git a/neutron-mapper/pom.xml b/neutron-mapper/pom.xml index 1edec15a4..4b3b291dd 100644 --- a/neutron-mapper/pom.xml +++ b/neutron-mapper/pom.xml @@ -58,6 +58,14 @@ org.opendaylight.mdsal.model ietf-yang-types-20130715 + + org.opendaylight.mdsal.model + opendaylight-l2-types + + + org.opendaylight.mdsal.model + ietf-topology + diff --git a/neutron-mapper/src/main/yang/neutron-provider-topology.yang b/neutron-mapper/src/main/yang/neutron-provider-topology.yang new file mode 100644 index 000000000..9b9f67bd7 --- /dev/null +++ b/neutron-mapper/src/main/yang/neutron-provider-topology.yang @@ -0,0 +1,99 @@ +module neutron-provider-topology { + // vi: set et smarttab sw=4 tabstop=4: + + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:neutron:provider:topology"; + prefix "neutron-provider"; + + organization "Cisco Systems, Inc."; + + contact "Wojciech Dec "; + + description + "Base model describing a Neutron network physical provider network, and + and mappings to a device's physical interfaces. + + Copyright (c) 2016 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"; + + revision "2016-06-06" { + description "Initial cut"; + } + + import network-topology { prefix nt; revision-date 2013-10-21; } + import neutron-networks { prefix neutron-netw; revision-date "2015-07-12"; } + import opendaylight-l2-types { prefix l2-types; revision-date "2013-08-27"; } + import odl-external-reference { prefix extref; } + import yang-ext { prefix ext; revision-date "2013-07-09"; } + + augment "/nt:network-topology/nt:topology/nt:topology-types" { + ext:augment-identifier "topology-types-neutron-provider-augment"; + container neutron-provider-topology { + presence "Indicates a Neutron Physical Provider topology"; + } + } + + augment "/nt:network-topology/nt:topology" { + ext:augment-identifier "topology-neutron-provider-augment"; + when "./nt:topology-types/neutron-provider-topology"; + + leaf physical-provider-type { + description "Technology used by the physical provider net"; + type neutron-netw:network-type; + } + + choice provider-parameters { + container vlan { + description "Used to check or assign vlan values"; + when "../type = neutron-netw:provider-type-vlan"; + container vlan-range { + leaf start { + description "Lowest VLAN"; + type l2-types:vlan-id; + } + leaf end { + type l2-types:vlan-id; + must "current() >= ../start"{} + } + } + } + } + } + + augment "/nt:network-topology/nt:topology/nt:node/nt:termination-point" { + ext:augment-identifier "termination-neutron-provider-augment"; + when "./nt:topology-types/neutron-provider-topology"; + + choice interface-type { + container physical-interface { + description + "Reference to physical ethernet interface that need to be added + into the provider bridge. This interface is a direct system interface + reference configured by the user prior to the device + being attached."; + + leaf interface-name { + type string; + mandatory true; + } + } + } + } + + augment "/nt:network-topology/nt:topology/nt:link" { + when "../nt:topology-types/neutron-provider-topology"; + ext:augment-identifier "link-neutron-provider-augment"; + leaf physical-interface { + description + "Reference to the network element interface. + + This reference needs to be resolved against the supporting + node's operational data store."; + config false; + type extref:external-reference; + } + } +} diff --git a/neutron-mapper/src/main/yang/odl-external-reference.yang b/neutron-mapper/src/main/yang/odl-external-reference.yang new file mode 100644 index 000000000..e82bfe2b7 --- /dev/null +++ b/neutron-mapper/src/main/yang/odl-external-reference.yang @@ -0,0 +1,41 @@ +module odl-external-reference { + // vi: set et smarttab sw=4 tabstop=4: + + yang-version 1; + // FIXME: this mode should go to OpenDaylight/mdsal + namespace "urn:opendaylight:params:xml:ns:yang:external:reference"; + prefix "extref"; + + organization "Cisco Systems, Inc."; + + contact "Robert Varga "; + + description + "Model defining the base type for external references for use instead + of an instance-identifier, which does not allow referencing entities + unknown in the model (due to imports, etc.). + + Copyright (c) 2016 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"; + + revision "2016-01-29" { + description "Initial model"; + } + + typedef external-reference { + description "Reference to a YANG-modeled node which resides outside + of this system. The format must use module names as namespace + prefixes -- in a similar fashion RESTCONF does. The reference + is evaluated from the root of the external system. + + This data type does not hold the coordinates of the external + system, nor does it specify which data store on the external + system should be used to satisfy the reference. This information + should be described in the model which instantiates a leaf of + this type."; + type string; + } +} -- 2.36.6