- commons
+-- parent : Contains Parent pom.xml for all the ovsdb modules.
- +-- integrationtest : Contains the parent pom.xml for all the integrationtest needs.
- distribution : Builds a working controller distribution based on the controller + ovsdb modules and other
dependant modules such as openflowplugin
- features : This folder contains all the Karaf related files.
-- integrationtest : Contains all the PAX-Exam based integrationTests that covers IT for all the modules.
-
- library : Contains Schema-independent library that is a reference implementation for RFC 7047.
This module doesn't depend on any of the Opendaylight components.
This library module can also be used independently in a non-OSGi environment.
-- northbound : Provides AD-SAL style Northbound REST APIs.
- Supports the legacy v2 APIs to provide backward compatibility for Hydrogen Release
- Also supports the newer v3 APIs to provide schema-independent access to the OVSDB protocol.
-
- openstack
+-- net-virt : Handles the Openstack Neutron ML2 and Network Service calls and performs all the logic required
for Network Virtualization.
4. Once karaf has started and you see the Opendaylight ascii art in the console, the last step
is to start the OVSDB plugin framework with the following command in the karaf console:
- "feature:install odl-ovsdb-openstack odl-ovsdb-northbound" (without quotation marks).
+ "feature:install odl-ovsdb-openstack" (without quotation marks).
Sample output from Karaf console :
odl-ovsdb-library | 1.0.0-SNAPSHOT | x | ovsdb-1.0.0-SNAPSHOT | OVSDB :: Library
odl-ovsdb-schema-openvswitch | 1.0.0-SNAPSHOT | x | ovsdb-1.0.0-SNAPSHOT | OVSDB :: Schema :: Open_vSwitch
odl-ovsdb-schema-hardwarevtep | 1.0.0-SNAPSHOT | x | ovsdb-1.0.0-SNAPSHOT | OVSDB :: Schema :: hardware_vtep
- odl-ovsdb-plugin | 1.0.0-SNAPSHOT | x | ovsdb-1.0.0-SNAPSHOT | OpenDaylight :: OVSDB :: Plugin
- odl-ovsdb-northbound | 0.6.0-SNAPSHOT | | ovsdb-1.0.0-SNAPSHOT | OpenDaylight :: OVSDB :: Northbound
odl-ovsdb-openstack | 1.0.0-SNAPSHOT | x | ovsdb-1.0.0-SNAPSHOT | OpenDaylight :: OVSDB :: OpenStack Network Virtual
odl-ovsdb-ovssfc | 0.0.1-SNAPSHOT | | ovsdb-0.0.1-SNAPSHOT | OpenDaylight :: OVSDB :: OVS Service Function Chai
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (C) 2014 Red Hat, 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.ovsdb</groupId>
- <artifactId>commons</artifactId>
- <version>1.4.0-SNAPSHOT</version>
- <relativePath>../parent</relativePath>
- </parent>
-
- <artifactId>commons.integrationtest</artifactId>
- <name>${project.artifactId}.parent</name>
- <version>1.4.0-SNAPSHOT</version>
- <packaging>pom</packaging>
- <description>The OVSDB Plugin integration project is a project for OpenDaylight that will implement the Open vSwitch Database RFC 7047 management protocol allowing the Southbound configuration of vSwitches and a network virtualization implementation.</description>
- <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
- <licenses>
- <license>
- <name>Eclipse Public License v1.0</name>
- <url>http://www.eclipse.org/legal/epl-v10.html</url>
- </license>
- </licenses>
- <developers>
- <developer>
- <name>Sam Hague</name>
- <email>shague@gmail.com</email>
- <url>https://github.com/shague</url>
- </developer>
- </developers>
- <scm>
- <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
- <tag>HEAD</tag>
- <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
- </scm>
-
- <properties>
- <!-- Overrides -->
- <!-- Controller Dependencies for Pax Exam -->
- <configuration.implementation.version>0.6.0-SNAPSHOT</configuration.implementation.version>
- <configuration.version>0.6.0-SNAPSHOT</configuration.version>
- <connectionmanager.version>0.3.0-SNAPSHOT</connectionmanager.version>
- <containermanager.it.version>0.7.0-SNAPSHOT</containermanager.it.version>
- <flowprogrammer.northbound.version>0.6.0-SNAPSHOT</flowprogrammer.northbound.version>
- <forwarding.staticrouting>0.7.0-SNAPSHOT</forwarding.staticrouting>
- <forwarding.staticrouting.northbound.version>0.6.0-SNAPSHOT</forwarding.staticrouting.northbound.version>
- <forwardingrulesmanager.implementation.version>0.6.0-SNAPSHOT</forwardingrulesmanager.implementation.version>
- <hosttracker.api.version>0.7.0-SNAPSHOT</hosttracker.api.version>
- <hosttracker.implementation.version>0.7.0-SNAPSHOT</hosttracker.implementation.version>
- <hosttracker.northbound.version>0.6.0-SNAPSHOT</hosttracker.northbound.version>
- <logging.bridge.version>0.6.0-SNAPSHOT</logging.bridge.version>
- <routing.dijkstra_implementation.version>0.6.0-SNAPSHOT</routing.dijkstra_implementation.version>
- <sal.implementation.version>0.6.0-SNAPSHOT</sal.implementation.version>
- <security.version>0.6.0-SNAPSHOT</security.version>
- <statistics.northbound.version>0.6.0-SNAPSHOT</statistics.northbound.version>
- <statisticsmanager.implementation.version>0.6.0-SNAPSHOT</statisticsmanager.implementation.version>
- <statisticsmanager.version>0.7.0-SNAPSHOT</statisticsmanager.version>
- <subnets.northbound.version>0.6.0-SNAPSHOT</subnets.northbound.version>
- <switchmanager.implementation.version>0.6.0-SNAPSHOT</switchmanager.implementation.version>
- <switchmanager.northbound.version>0.6.0-SNAPSHOT</switchmanager.northbound.version>
- <topology.northbound.version>0.6.0-SNAPSHOT</topology.northbound.version>
- <topology.web.version>0.6.0-SNAPSHOT</topology.web.version>
- <topologymanager.version>0.6.0-SNAPSHOT</topologymanager.version>
- <usermanager.implementation.version>0.6.0-SNAPSHOT</usermanager.implementation.version>
- <usermanager.northbound.version>0.2.0-SNAPSHOT</usermanager.northbound.version>
- <usermanager.version>0.6.0-SNAPSHOT</usermanager.version>
- <!-- 3rd Party Dependencies -->
- <yaml.version>1.10</yaml.version>
- </properties>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.yaml</groupId>
- <artifactId>snakeyaml</artifactId>
- <version>${yaml.version}</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <dependencies>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- </dependency>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-core</artifactId>
- </dependency>
-
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-annotations</artifactId>
- </dependency>
-
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- </dependency>
-
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- </dependency>
-
- <dependency>
- <groupId>com.fasterxml.jackson.jaxrs</groupId>
- <artifactId>jackson-jaxrs-json-provider</artifactId>
- </dependency>
-
- <dependency>
- <groupId>com.fasterxml.jackson.module</groupId>
- <artifactId>jackson-module-jaxb-annotations</artifactId>
- </dependency>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </dependency>
- <!-- Jersey for JAXRS -->
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-core</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-server</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-client</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-net</groupId>
- <artifactId>commons-net</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.3</version>
- </dependency>
- <dependency>
- <groupId>eclipselink</groupId>
- <artifactId>javax.persistence</artifactId>
- </dependency>
- <dependency>
- <groupId>eclipselink</groupId>
- <artifactId>javax.resource</artifactId>
- </dependency>
- <dependency>
- <groupId>equinoxSDK381</groupId>
- <artifactId>javax.servlet</artifactId>
- </dependency>
- <dependency>
- <groupId>equinoxSDK381</groupId>
- <artifactId>javax.servlet.jsp</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.gogo.command</artifactId>
- <version>0.14.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.gogo.runtime</artifactId>
- <version>0.12.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.gogo.shell</artifactId>
- <version>0.10.0</version>
- </dependency>
- <dependency>
- <groupId>equinoxSDK381</groupId>
- <artifactId>org.eclipse.equinox.cm</artifactId>
- </dependency>
- <dependency>
- <groupId>equinoxSDK381</groupId>
- <artifactId>org.eclipse.equinox.console</artifactId>
- </dependency>
- <dependency>
- <groupId>equinoxSDK381</groupId>
- <artifactId>org.eclipse.equinox.ds</artifactId>
- </dependency>
- <dependency>
- <groupId>equinoxSDK381</groupId>
- <artifactId>org.eclipse.equinox.launcher</artifactId>
- </dependency>
- <dependency>
- <groupId>equinoxSDK381</groupId>
- <artifactId>org.eclipse.equinox.util</artifactId>
- </dependency>
- <dependency>
- <groupId>equinoxSDK381</groupId>
- <artifactId>org.eclipse.osgi</artifactId>
- </dependency>
- <dependency>
- <groupId>equinoxSDK381</groupId>
- <artifactId>org.eclipse.osgi.services</artifactId>
- </dependency>
- <!-- Gemini Web -->
- <dependency>
- <groupId>geminiweb</groupId>
- <artifactId>org.eclipse.gemini.web.core</artifactId>
- </dependency>
- <dependency>
- <groupId>geminiweb</groupId>
- <artifactId>org.eclipse.gemini.web.extender</artifactId>
- </dependency>
- <dependency>
- <groupId>geminiweb</groupId>
- <artifactId>org.eclipse.gemini.web.tomcat</artifactId>
- </dependency>
- <dependency>
- <groupId>geminiweb</groupId>
- <artifactId>org.eclipse.virgo.kernel.equinox.extensions</artifactId>
- </dependency>
- <dependency>
- <groupId>geminiweb</groupId>
- <artifactId>org.eclipse.virgo.util.common</artifactId>
- </dependency>
- <dependency>
- <groupId>geminiweb</groupId>
- <artifactId>org.eclipse.virgo.util.io</artifactId>
- </dependency>
- <dependency>
- <groupId>geminiweb</groupId>
- <artifactId>org.eclipse.virgo.util.math</artifactId>
- </dependency>
- <dependency>
- <groupId>geminiweb</groupId>
- <artifactId>org.eclipse.virgo.util.osgi</artifactId>
- </dependency>
- <dependency>
- <groupId>geminiweb</groupId>
- <artifactId>org.eclipse.virgo.util.osgi.manifest</artifactId>
- </dependency>
- <dependency>
- <groupId>geminiweb</groupId>
- <artifactId>org.eclipse.virgo.util.parser.manifest</artifactId>
- </dependency>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-buffer</artifactId>
- </dependency>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-codec</artifactId>
- </dependency>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-common</artifactId>
- </dependency>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-handler</artifactId>
- </dependency>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-transport</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.portlet</groupId>
- <artifactId>portlet-api</artifactId>
- <version>2.0</version>
- </dependency>
- <dependency>
- <groupId>orbit</groupId>
- <artifactId>javax.activation</artifactId>
- </dependency>
- <dependency>
- <groupId>orbit</groupId>
- <artifactId>javax.annotation</artifactId>
- </dependency>
- <dependency>
- <groupId>orbit</groupId>
- <artifactId>javax.ejb</artifactId>
- </dependency>
- <dependency>
- <groupId>orbit</groupId>
- <artifactId>javax.el</artifactId>
- </dependency>
- <dependency>
- <groupId>orbit</groupId>
- <artifactId>javax.mail.glassfish</artifactId>
- </dependency>
- <dependency>
- <groupId>orbit</groupId>
- <artifactId>javax.servlet.jsp.jstl</artifactId>
- </dependency>
- <dependency>
- <groupId>orbit</groupId>
- <artifactId>javax.servlet.jsp.jstl.impl</artifactId>
- </dependency>
- <dependency>
- <groupId>orbit</groupId>
- <artifactId>javax.xml.rpc</artifactId>
- </dependency>
- <dependency>
- <groupId>orbit</groupId>
- <artifactId>org.apache.catalina</artifactId>
- </dependency>
- <dependency>
- <groupId>orbit</groupId>
- <artifactId>org.apache.catalina.ha</artifactId>
- </dependency>
- <dependency>
- <groupId>orbit</groupId>
- <artifactId>org.apache.catalina.tribes</artifactId>
- </dependency>
- <dependency>
- <groupId>orbit</groupId>
- <artifactId>org.apache.coyote</artifactId>
- </dependency>
- <dependency>
- <groupId>orbit</groupId>
- <artifactId>org.apache.el</artifactId>
- </dependency>
- <dependency>
- <groupId>orbit</groupId>
- <artifactId>org.apache.jasper</artifactId>
- </dependency>
- <dependency>
- <groupId>orbit</groupId>
- <artifactId>org.apache.juli.extras</artifactId>
- </dependency>
- <dependency>
- <groupId>orbit</groupId>
- <artifactId>org.apache.tomcat.api</artifactId>
- </dependency>
- <dependency>
- <groupId>orbit</groupId>
- <artifactId>org.apache.tomcat.util</artifactId>
- </dependency>
- <dependency>
- <groupId>org.aopalliance</groupId>
- <artifactId>com.springsource.org.aopalliance</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.dependencymanager</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.dependencymanager.shell</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.fileinstall</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpcore-nio</artifactId>
- <version>4.2.1</version>
- <optional>true</optional>
- </dependency>
-
- <dependency>
- <groupId>org.codehaus.enunciate</groupId>
- <artifactId>enunciate-core-annotations</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.codehaus.jettison</groupId>
- <artifactId>jettison</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.spec.javax.transaction</groupId>
- <artifactId>jboss-transaction-api_1.1_spec</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-binding-it</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller.thirdparty</groupId>
- <artifactId>com.sun.jersey.jersey-servlet</artifactId>
- <version>${jersey-servlet.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller.thirdparty</groupId>
- <artifactId>org.apache.catalina.filters.CorsFilter</artifactId>
- <version>${corsfilter.version}</version>
- </dependency>
- <dependency>
- <groupId>org.ow2.asm</groupId>
- <artifactId>asm-all</artifactId>
- <version>${asm.version}</version>
- </dependency>
- <!-- Visual VM hook -->
- <dependency>
- <groupId>org.ow2.chameleon.management</groupId>
- <artifactId>chameleon-mbeans</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>log4j-over-slf4j</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.aop</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.asm</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.beans</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.context</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.context.support</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.expression</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.transaction</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.web</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.web.servlet</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.security</groupId>
- <artifactId>spring-security-config</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.security</groupId>
- <artifactId>spring-security-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.security</groupId>
- <artifactId>spring-security-taglibs</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.security</groupId>
- <artifactId>spring-security-web</artifactId>
- </dependency>
- <dependency>
- <groupId>virgomirror</groupId>
- <artifactId>org.eclipse.jdt.core.compiler.batch</artifactId>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.ovsdb</groupId>
- <artifactId>library</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.ovsdb</groupId>
- <artifactId>northbound</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.ovsdb</groupId>
- <artifactId>openstack.net-virt</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.ovsdb</groupId>
- <artifactId>schema.hardwarevtep</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.ovsdb</groupId>
- <artifactId>schema.openvswitch</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.ovsdb</groupId>
- <artifactId>utils.servicehelper</artifactId>
- </dependency>
-
- <!-- Add Pax Exam -->
- <dependency>
- <groupId>org.ops4j.pax.exam</groupId>
- <artifactId>pax-exam-junit4</artifactId>
- </dependency>
- <dependency>
- <groupId>org.ops4j.pax.exam</groupId>
- <artifactId>pax-exam-link-mvn</artifactId>
- </dependency>
- <dependency>
- <groupId>org.ops4j.pax.url</groupId>
- <artifactId>pax-url-aether</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>properties-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>set-system-properties</goal>
- </goals>
- <configuration>
- <properties>
- <property>
- <name>logback.configurationFile</name>
- <!--<value>${project.parent.basedir}/logback.xml</value>-->
- </property>
- </properties>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.ops4j.pax.exam</groupId>
- <artifactId>maven-paxexam-plugin</artifactId>
- <version>1.2.4</version>
- <executions>
- <execution>
- <id>generate-config</id>
- <phase>none</phase>
- <goals>
- <goal>generate-depends-file</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
<maven>3.1.1</maven>
</prerequisites>
<modules>
- <module>integrationtest</module>
<module>parent</module>
</modules>
</project>
<version>1.2.0-SNAPSHOT</version>
<packaging>bundle</packaging>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-artifacts</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>mdsal-model-artifacts</artifactId>
+ <version>0.8.0-SNAPSHOT</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-topology</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>yang-ext</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-inet-types</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-yang-types-20130715</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>opendaylight-l2-types</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>concepts</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <configLocation>
+ ${project.basedir}/../../commons/parent/src/main/resources/ovsdb_checks.xml
+ </configLocation>
+ <failsOnError>true</failsOnError>
+ <includes>**/*.java,**/*.xml,**/*.ini,**/*.sh,**/*.bat</includes>
+ <excludes>**/yang/</excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+
</project>
--- /dev/null
+module hwvtep {
+ yang-version 1;
+ namespace "urn:opendaylight:params:xml:ns:yang:ovsdb:hwvtep";
+ prefix "hwvtepsb";
+
+ import network-topology {prefix "topo"; revision-date "2013-10-21"; }
+ import yang-ext { prefix "ext"; }
+ import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
+ import ietf-yang-types { prefix yang; revision-date "2013-07-15";}
+ import opendaylight-l2-types { prefix ethertype; revision-date "2013-08-27";}
+
+ revision "2015-09-01" {
+ description "1st revision of southbound model for hwvtep";
+ }
+
+ typedef hwvtep-physical-switch-ref {
+ description "A reference to a hwvtep based physical switch";
+ type instance-identifier;
+ }
+
+ typedef hwvtep-logical-switch-ref {
+ description "A reference to a logical switch in hwvtep based switches";
+ type instance-identifier;
+ }
+
+ typedef hwvtep-physical-locator-ref {
+ description "A reference to an endpoint to which logical switch traffic may be encapsulated and forwarded";
+ type instance-identifier;
+ }
+
+ typedef hwvtep-physical-locator-set-ref {
+ description "A reference to a set of endpoints to which logical switch traffic may be encapsulated and forwarded via replication";
+ type instance-identifier;
+ }
+
+ typedef hwvtep-global-ref {
+ description "A reference to an hwvtep global node";
+ type instance-identifier;
+ }
+
+ typedef hwvtep-node-name {
+ type string;
+ }
+
+ grouping hwvtep-node-identification {
+ leaf hwvtep-node-name {
+ description "The name of the node";
+ type hwvtep-node-name;
+ }
+ leaf hwvtep-node-description {
+ description "The description of the node";
+ type string;
+ }
+ }
+
+ grouping hwvtep-mac-table-generic-attributes {
+ leaf mac-entry-key {
+ description "MAC address entry";
+ type string;
+ }
+ leaf logical-switch-ref {
+ description "The logical switch to which this mapping applies";
+ type hwvtep-logical-switch-ref;
+ }
+ }
+
+ grouping hwvtep-ucast-mac-table-attributes {
+ description "Unicast mac table attributes";
+ leaf ipaddr {
+ description "Optional IP address associated with the mac";
+ type inet:ip-address;
+ }
+ leaf locator-ref {
+ description "Reference to the physical locator to reach this entry";
+ type hwvtep-physical-locator-ref;
+ }
+ }
+
+ grouping hwvtep-mcast-mac-table-attributes {
+ leaf locator-set-ref {
+ description "Reference to a set of physical locators used for replication";
+ type hwvtep-physical-locator-set-ref;
+ }
+ }
+
+ grouping hwvtep-tunnel-attributes {
+ leaf local-locator-ref {
+ description "Reference to the physical locator to reach this entry";
+ type hwvtep-physical-locator-ref;
+ }
+ leaf remote-locator-ref {
+ description "Reference to the physical locator to reach this entry";
+ type hwvtep-physical-locator-ref;
+ }
+ leaf bfd-config-local {
+ type string;
+ }
+ leaf bfd-config-remote {
+ type string;
+ }
+ leaf bfd-params {
+ type string;
+ }
+ }
+
+ grouping hwvtep-physical-switch-attributes {
+ container physical-switch-id {
+ uses hwvtep-node-identification;
+ }
+ list management-ips {
+ key "management-ips-key";
+ leaf management-ips-key {
+ description "Management IP address of the switch";
+ type inet:ip-address;
+ }
+ }
+ leaf managed-by {
+ description "The hwvtep global node to which this physical switch belongs to";
+ type hwvtep-global-ref;
+ }
+ list tunnel-ips {
+ key "tunnel-ips-key";
+ leaf tunnel-ips-key {
+ description "Management IP address of the switch";
+ type inet:ip-address;
+ }
+ }
+ list tunnels {
+ uses hwvtep-tunnel-attributes ;
+ }
+ list ucast-macs-local {
+ key "mac-entry-key";
+ uses hwvtep-mac-table-generic-attributes;
+ uses hwvtep-ucast-mac-table-attributes;
+ }
+ list ucast-macs-remote {
+ key "mac-entry-key";
+ uses hwvtep-mac-table-generic-attributes;
+ uses hwvtep-ucast-mac-table-attributes;
+ }
+ list mcast-macs-local {
+ key "mac-entry-key";
+ uses hwvtep-mac-table-generic-attributes;
+ uses hwvtep-mcast-mac-table-attributes;
+ }
+ list mcast-macs-remote {
+ key "mac-entry-key";
+ uses hwvtep-mac-table-generic-attributes;
+ uses hwvtep-mcast-mac-table-attributes;
+ }
+ }
+
+ grouping hwvtep-connection-info-attributes {
+ leaf remote-ip {
+ type inet:ip-address;
+ description "Hwvtep Connection Remote IP";
+ }
+ leaf remote-port {
+ type inet:port-number;
+ description "Hwvtep Connection Remote Port Number";
+ }
+ leaf local-ip {
+ type inet:ip-address;
+ description "Hwvtep Connection Local IP";
+ }
+ leaf local-port {
+ type inet:port-number;
+ description "Hwvtep Connection Local Port Number IP";
+ }
+ }
+
+ grouping hwvtep-global-attributes {
+ description "global node for the hwvtep";
+ container connection-info {
+ uses hwvtep-connection-info-attributes;
+ }
+ list managers {
+ description "";
+ key "target";
+ leaf target {
+ description "Uri indicating connection method to the Manager";
+ type inet:uri;
+ }
+ leaf manager-uuid {
+ description "The unique identifier of the manager";
+ type yang:uuid;
+ }
+ leaf is-connected {
+ type boolean;
+ }
+ list manager-other-configs {
+ description "Key-value pairs for configuring rarely used features.
+ other_config : dscp : optional string
+ contains an integer, in the range 0 - 63. DSCP value to be used when establishing a connection to the switch. Default value of 48 if none specified.";
+ key "other-config-key";
+ leaf other-config-key {
+ description "other-config name/key";
+ type string;
+ }
+ leaf other-config-value {
+ description "other-config value";
+ type string;
+ }
+ }
+ }
+ list switches {
+ key "switch-ref";
+ leaf switch-ref {
+ type hwvtep-physical-switch-ref;
+ }
+ }
+ }
+
+ identity encapsulation-type-base {
+ description "Base Encapsulation type";
+ }
+
+ identity encapsulation-type-vxlan-over-ipv4 {
+ base encapsulation-type-base;
+ description "Encapsulation type vxlan-over-ipv4";
+ }
+
+ typedef encapsulation-type {
+ type identityref {
+ base encapsulation-type-base;
+ }
+ description "This type is used to refer to an Encapsulation Type.";
+ }
+
+ grouping hwvtep-physical-locator-attributes {
+ leaf encapsulation-type {
+ type encapsulation-type;
+ description "Encapsulation type used by this locator";
+ }
+ leaf dst-ip {
+ type inet:ip-address;
+ description "IP address of the locator";
+ }
+ }
+
+ grouping hwvtep-physical-locator-set-attributes {
+ list locators-ref {
+ leaf locator-ref {
+ type hwvtep-physical-locator-ref;
+ }
+ }
+ }
+
+ grouping hwvtep-logical-switch-attributes {
+ uses hwvtep-node-identification;
+ leaf hwvtep-logical-switch-external-id {
+ description "A unique identifier of the logical switch";
+ type yang:uuid;
+ }
+ leaf tunnel-key {
+ description "Per Logical Switch tunnel key";
+ type string;
+ }
+ }
+
+ grouping hwvtep-physical-port-attributes {
+ container physical-port-id {
+ uses hwvtep-node-identification;
+ }
+ list vlan-bindings {
+ description "A map of vlan ID to logical switch pairs";
+ key "vlan-id-key";
+ leaf vlan-id-key {
+ description "vlan ids in the range 0 - 4095";
+ type ethertype:vlan-id;
+ }
+ leaf logical-switch {
+ description "Reference to logical switch for the vlan";
+ type hwvtep-logical-switch-ref;
+ }
+ }
+ }
+
+ augment "/topo:network-topology/topo:topology/topo:node" {
+ description "Augmentation for physical switch nodes managed by hwvtep";
+ ext:augment-identifier "physical-switch-augmentation";
+ uses hwvtep-physical-switch-attributes;
+ }
+
+ augment "/topo:network-topology/topo:topology/topo:node" {
+ description "Augment topology node for a hwvtep node";
+ ext:augment-identifier "hwvtep-global-augmentation";
+ uses hwvtep-global-attributes;
+ }
+
+ augment "/topo:network-topology/topo:topology/topo:node" {
+ description "Augmentation for logical switches for a hwvtep node";
+ ext:augment-identifier "hwvtep-logical-switch-augmentation";
+ uses hwvtep-logical-switch-attributes;
+ }
+
+ augment "/topo:network-topology/topo:topology/topo:node" {
+ description "Augmentation for physical locator set for a hwvtep node";
+ ext:augment-identifier "hwvtep-physical-locator-set-augmentation";
+ uses hwvtep-physical-locator-set-attributes;
+ }
+ augment "/topo:network-topology/topo:topology/topo:node/topo:termination-point" {
+ description "Augment topology node termination-point for a hwvtep physical-locator";
+ ext:augment-identifier "hwvtep-physical-locator-augmentation";
+ uses hwvtep-physical-locator-attributes;
+ }
+ augment "/topo:network-topology/topo:topology/topo:node/topo:termination-point" {
+ description "Augment topology node termination-point for a hwvtep physical-port";
+ ext:augment-identifier "hwvtep-physical-port-augmentation";
+ uses hwvtep-physical-port-attributes;
+ }
+
+}
+++ /dev/null
-module hwvtepsouthbound {
- yang-version 1;
- namespace "urn:opendaylight:params:xml:ns:yang:hwvtepsouthbound";
- prefix "hwvtepsouthbound";
-
- revision "2015-09-01" {
- description "Initial revision of hwvtepsouthbound model";
- }
-}
<packaging>bundle</packaging>
<properties>
- <skipITs>false</skipITs>
<karaf.distro.groupId>org.opendaylight.ovsdb</karaf.distro.groupId>
<karaf.distro.artifactId>hwvtepsouthbound-karaf</karaf.distro.artifactId>
<karaf.distro.version>1.2.0-SNAPSHOT</karaf.distro.version>
</dependency>
</dependencies>
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <properties>
+ <skipITs>true</skipITs>
+ </properties>
+ </profile>
+ <profile>
+ <id>integrationtest</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <properties>
+ <skipITs>false</skipITs>
+ </properties>
+ </profile>
+ </profiles>
</project>
\ No newline at end of file
+++ /dev/null
-/target-ide
-PutObjectStoreHere
-ObjectStore
-logs
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (C) 2014 Red Hat, 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.ovsdb</groupId>
- <artifactId>commons.integrationtest</artifactId>
- <version>1.4.0-SNAPSHOT</version>
- <relativePath>../commons/integrationtest</relativePath>
- </parent>
-
- <artifactId>integrationtest</artifactId>
- <version>1.4.0-SNAPSHOT</version>
- <packaging>jar</packaging>
- <description>The OVSDB Plugin integration project is a project for OpenDaylight that will implement the Open vSwitch Database RFC 7047 management protocol allowing the Southbound configuration of vSwitches and a network virtualization implementation.</description>
- <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
- <licenses>
- <license>
- <name>Eclipse Public License v1.0</name>
- <url>http://www.eclipse.org/legal/epl-v10.html</url>
- </license>
- </licenses>
- <developers>
- <developer>
- <name>Sam Hague</name>
- <email>shague@gmail.com</email>
- <url>https://github.com/shague</url>
- </developer>
- </developers>
- <scm>
- <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
- <tag>HEAD</tag>
- <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
- </scm>
-
- <dependencies>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-binding-it</artifactId>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.ops4j.pax.exam</groupId>
- <artifactId>pax-exam-container-native</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller.model</groupId>
- <artifactId>model-inventory</artifactId>
- </dependency>
- <dependency>
- <groupId>org.ops4j.pax.exam</groupId>
- <artifactId>pax-exam</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.ops4j.pax.exam</groupId>
- <artifactId>pax-exam-spi</artifactId>
- <!-- Should be in a parent POM -->
- <version>4.4.0</version>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <!-- Cache surefire in Maven Local repo for offline builds -->
- <dependency>
- <groupId>org.apache.maven.surefire</groupId>
- <artifactId>surefire-junit4</artifactId>
- <version>${maven.surefire.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.surefire</groupId>
- <artifactId>surefire-junit47</artifactId>
- <version>${maven.surefire.version}</version>
- </dependency>
- </dependencies>
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>${lifecycle.mapping.version}</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>org.apache.servicemix.tooling</groupId>
- <artifactId>depends-maven-plugin</artifactId>
- <versionRange>[0,)</versionRange>
- <goals>
- <goal>generate-depends-file</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore/>
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.ops4j.pax.exam</groupId>
- <artifactId>maven-paxexam-plugin</artifactId>
- <executions>
- <execution>
- <id>generate-config</id>
- <goals>
- <goal>generate-depends-file</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.servicemix.tooling</groupId>
- <artifactId>depends-maven-plugin</artifactId>
- <version>1.2</version>
- <executions>
- <execution>
- <id>generate-depends-file</id>
- <goals>
- <goal>generate-depends-file</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-checkstyle-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.jacoco</groupId>
- <artifactId>jacoco-maven-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-failsafe-plugin</artifactId>
- <executions>
- <execution>
- <id>failsafe-integration-tests</id>
- <phase>integration-test</phase>
- <goals>
- <goal>integration-test</goal>
- </goals>
- <configuration>
- <forkCount>1</forkCount>
- <reuseForks>false</reuseForks>
- <parallel>none</parallel>
- <threadCount>1</threadCount>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <dependencies>
- <dependency>
- <groupId>org.ops4j.pax.exam</groupId>
- <artifactId>pax-exam-container-native</artifactId>
- </dependency>
- </dependencies>
- </profile>
- <profile>
- <id>karafit</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <dependencies>
- <dependency>
- <groupId>org.ops4j.pax.exam</groupId>
- <artifactId>pax-exam-container-karaf</artifactId>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
-</project>
+++ /dev/null
-/*
- * Copyright (C) 2014 Red Hat, Inc.
- *
- * 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
- *
- * Authors : Madhu Venugopal
- */
-package org.opendaylight.ovsdb.integrationtest.ovsdbclient;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.util.Properties;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
-import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.rules.TestRule;
-import org.junit.rules.TestWatcher;
-import org.junit.runner.Description;
-import org.opendaylight.ovsdb.lib.OvsdbClient;
-import org.opendaylight.ovsdb.lib.OvsdbConnection;
-import org.opendaylight.ovsdb.lib.OvsdbConnectionListener;
-import org.opendaylight.ovsdb.lib.impl.OvsdbConnectionService;
-import org.opendaylight.ovsdb.lib.message.OvsdbRPC;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public abstract class OvsdbTestBase implements OvsdbRPC.Callback{
- private static final Logger LOG = LoggerFactory.getLogger(OvsdbTestBase.class);
- private final static String SERVER_IPADDRESS = "ovsdbserver.ipaddress";
- private final static String SERVER_PORT = "ovsdbserver.port";
- private final static String CONNECTION_TYPE = "ovsdbserver.connection";
- private final static String CONNECTION_TYPE_ACTIVE = "active";
- private final static String CONNECTION_TYPE_PASSIVE = "passive";
-
- private final static String DEFAULT_SERVER_PORT = "6640";
-
- /**
- * Represents the Open Vswitch Schema
- */
- public final static String OPEN_VSWITCH_SCHEMA = "Open_vSwitch";
-
- public Properties loadProperties() {
- Properties props = new Properties(System.getProperties());
- return props;
- }
-
- public OvsdbClient getTestConnection() throws IOException, InterruptedException, ExecutionException, TimeoutException {
- Properties props = loadProperties();
- String addressStr = props.getProperty(SERVER_IPADDRESS);
- String portStr = props.getProperty(SERVER_PORT, DEFAULT_SERVER_PORT);
- String connectionType = props.getProperty(CONNECTION_TYPE, "active");
-
- // If the connection type is active, controller connects to the ovsdb-server
- if (connectionType.equalsIgnoreCase(CONNECTION_TYPE_ACTIVE)) {
- if (addressStr == null) {
- Assert.fail(usage());
- }
-
- InetAddress address;
- try {
- address = InetAddress.getByName(addressStr);
- } catch (Exception e) {
- System.out.println("Unable to resolve " + addressStr);
- e.printStackTrace();
- return null;
- }
-
- Integer port;
- try {
- port = Integer.parseInt(portStr);
- } catch (NumberFormatException e) {
- System.out.println("Invalid port number : " + portStr);
- e.printStackTrace();
- return null;
- }
-
- OvsdbConnection connection = OvsdbConnectionService.getService();
- return connection.connect(address, port);
- } else if (connectionType.equalsIgnoreCase(CONNECTION_TYPE_PASSIVE)) {
- ExecutorService executor = Executors.newFixedThreadPool(1);
- Future<OvsdbClient> passiveConnection = executor.submit(new PassiveListener());
- return passiveConnection.get(60, TimeUnit.SECONDS);
- }
- Assert.fail("Connection parameter ("+CONNECTION_TYPE+") must be either active or passive");
- return null;
- }
-
- private String usage() {
- return "Integration Test needs a valid connection configuration as follows :\n" +
- "active connection : mvn -Pintegrationtest -Dovsdbserver.ipaddress=x.x.x.x -Dovsdbserver.port=yyyy verify\n"+
- "passive connection : mvn -Pintegrationtest -Dovsdbserver.connection=passive verify\n";
- }
-
- public class PassiveListener implements Callable<OvsdbClient>, OvsdbConnectionListener {
- OvsdbClient client = null;
- @Override
- public OvsdbClient call() throws Exception {
- OvsdbConnection connection = OvsdbConnectionService.getService();
- connection.registerConnectionListener(this);
- while (client == null) {
- Thread.sleep(500);
- }
- return client;
- }
-
- @Override
- public void connected(OvsdbClient client) {
- this.client = client;
- }
-
- @Override
- public void disconnected(OvsdbClient client) {
- Assert.assertEquals(this.client.getConnectionInfo(), client.getConnectionInfo());
- this.client = null;
- }
- }
-
- @Rule
- public TestRule watcher = new TestWatcher() {
- @Override
- protected void starting(Description description) {
- LOG.info("TestWatcher: Starting test: {}",
- description.getDisplayName());
- }
-
- @Override
- protected void finished(Description description) {
- LOG.info("TestWatcher: Finished test: {}", description.getDisplayName());
- }
- };
-}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<persisted-snapshots>
- <snapshots>
- <snapshot>
- <required-capabilities>
- <capability>urn:opendaylight:l2:types?module=opendaylight-l2-types&revision=2013-08-27</capability>
- <capability>
- urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&revision=2013-10-28
- </capability>
- <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom?module=opendaylight-md-sal-dom&revision=2013-10-28</capability>
- <capability>
- urn:opendaylight:params:xml:ns:yang:controller:config?module=config&revision=2013-04-05
- </capability>
- <capability>urn:ietf:params:netconf:capability:candidate:1.0</capability>
- <capability>urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring?module=ietf-netconf-monitoring&revision=2010-10-04</capability>
- <capability>urn:ietf:params:xml:ns:yang:rpc-context?module=rpc-context&revision=2013-06-17
- </capability>
- <capability>
- urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl?module=opendaylight-sal-binding-broker-impl&revision=2013-10-28
- </capability>
- <capability>urn:ietf:params:xml:ns:yang:ietf-inet-types?module=ietf-inet-types&revision=2010-09-24
- </capability>
- <capability>urn:ietf:params:xml:ns:yang:ietf-yang-types?module=ietf-yang-types&revision=2010-09-24
- </capability>
- <capability>
- urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl?module=opendaylight-sal-dom-broker-impl&revision=2013-10-28
- </capability>
- <capability>urn:opendaylight:params:xml:ns:yang:controller:logback:config?module=config-logging&revision=2013-07-16</capability>
- <capability>urn:opendaylight:yang:extension:yang-ext?module=yang-ext&revision=2013-07-09
- </capability>
- <capability>
- urn:opendaylight:params:xml:ns:yang:controller:md:sal:common?module=opendaylight-md-sal-common&revision=2013-10-28
- </capability>
-
- <!-- openflowjava -->
- <capability>urn:opendaylight:params:xml:ns:yang:openflow:switch:connection:provider:impl?module=openflow-switch-connection-provider-impl&revision=2014-03-28</capability>
- <capability>urn:opendaylight:params:xml:ns:yang:openflow:switch:connection:provider?module=openflow-switch-connection-provider&revision=2014-03-28</capability>
- <!-- openflowplugin -->
- <capability>urn:opendaylight:params:xml:ns:yang:openflow:common:config:impl?module=openflow-provider-impl&revision=2014-03-26</capability>
- <capability>urn:opendaylight:params:xml:ns:yang:openflow:common:config?module=openflow-provider&revision=2014-03-26</capability>
- </required-capabilities>
- <configuration>
-
- <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
- <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
- <module>
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">prefix:schema-service-singleton</type>
- <name>yang-schema-service</name>
- </module>
- <module>
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:runtime-generated-mapping</type>
- <name>runtime-mapping-singleton</name>
- </module>
- <module>
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-notification-broker</type>
- <name>binding-notification-broker</name>
- </module>
- <module>
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-broker-impl</type>
- <name>binding-broker-impl</name>
- <notification-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
- <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-notification-service</type>
- <name>binding-notification-broker</name>
- </notification-service>
- <data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
- <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-data-broker</type>
- <name>binding-data-broker</name>
- </data-broker>
- <root-data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
- <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-async-data-broker</type>
- <name>binding-data-broker</name>
- </root-data-broker>
- </module>
- <!--
- Tree-based in-memory data store. This is the data store which is currently
- recommended for single-node deployments.
- -->
- <module>
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">prefix:dom-inmemory-data-broker</type>
- <name>inmemory-data-broker</name>
- <schema-service>
- <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:schema-service</type>
- <name>yang-schema-service</name>
- </schema-service>
- </module>
- <module>
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl">prefix:dom-broker-impl</type>
- <name>inmemory-dom-broker</name>
- <async-data-broker>
- <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-async-data-broker</type>
- <name>inmemory-data-broker</name>
- </async-data-broker>
- </module>
- <module>
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-data-compatible-broker</type>
- <name>inmemory-binding-data-broker</name>
- <dom-async-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
- <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-broker-osgi-registry</type>
- <name>dom-broker</name>
- </dom-async-broker>
- <binding-mapping-service xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
- <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">binding:binding-dom-mapping-service</type>
- <name>runtime-mapping-singleton</name>
- </binding-mapping-service>
- </module>
- <module>
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">prefix:binding-forwarded-data-broker</type>
- <name>binding-async-data-broker</name>
- <binding-forwarded-data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">
- <dom-async-broker>
- <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-async-data-broker</type>
- <name>inmemory-data-broker</name>
- </dom-async-broker>
- <schema-service>
- <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:schema-service</type>
- <name>yang-schema-service</name>
- </schema-service>
- <binding-mapping-service>
- <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">binding:binding-dom-mapping-service</type>
- <name>runtime-mapping-singleton</name>
- </binding-mapping-service>
- </binding-forwarded-data-broker>
- </module>
-
- </modules>
-
- <services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
- <service>
- <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:schema-service</type>
- <instance>
- <name>yang-schema-service</name>
- <provider>/modules/module[type='schema-service-singleton'][name='yang-schema-service']</provider>
- </instance>
- </service>
- <service>
- <type xmlns:binding-impl="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">binding-impl:binding-dom-mapping-service</type>
- <instance>
- <name>runtime-mapping-singleton</name>
- <provider>/modules/module[type='runtime-generated-mapping'][name='runtime-mapping-singleton']</provider>
- </instance>
- </service>
- <service>
- <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-notification-service</type>
- <instance>
- <name>binding-notification-broker</name>
- <provider>/modules/module[type='binding-notification-broker'][name='binding-notification-broker']</provider>
- </instance>
- </service>
- <service>
- <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-broker-osgi-registry</type>
- <instance>
- <name>binding-osgi-broker</name>
- <provider>/modules/module[type='binding-broker-impl'][name='binding-broker-impl']</provider>
- </instance>
- </service>
- <service>
- <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-rpc-registry</type>
- <instance>
- <name>binding-rpc-broker</name>
- <provider>/modules/module[type='binding-broker-impl'][name='binding-broker-impl']</provider>
- </instance>
- </service>
-
- <service>
- <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-broker-osgi-registry</type>
- <instance>
- <name>dom-broker</name>
- <provider>/modules/module[type='dom-broker-impl'][name='inmemory-dom-broker']</provider>
- </instance>
- </service>
-
- <service>
- <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-data-broker</type>
- <instance>
- <name>binding-data-broker</name>
- <provider>/modules/module[type='binding-data-compatible-broker'][name='inmemory-binding-data-broker']</provider>
- </instance>
- </service>
-
- <service>
- <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-async-data-broker</type>
- <instance>
- <name>binding-data-broker</name>
- <provider>/modules/module[type='binding-forwarded-data-broker'][name='binding-async-data-broker']</provider>
- </instance>
- </service>
-
- <service>
- <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-async-data-broker</type>
- <instance>
- <name>inmemory-data-broker</name>
- <provider>/modules/module[type='dom-inmemory-data-broker'][name='inmemory-data-broker']</provider>
- </instance>
- </service>
-
- </services>
- </data>
-
- </configuration>
- </snapshot>
-
- </snapshots>
-</persisted-snapshots>
+++ /dev/null
-pax.exam.logging = none
-pax.exam.service.timeout = 5000
+++ /dev/null
-<configuration scan="true">
- <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
- <encoder>
- <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
- </encoder>
- </appender>
-
- <logger name="org.opendaylight.ovsdb" level="INFO" />
-
- <logger name="org.opendaylight.ovsdb.lib.jsonrpc.JsonRpcEndpoint" level="TRACE" additivity="false">
- <appender-ref ref="STDOUT" />
- </logger>
-
- <root level="ERROR">
- <appender-ref ref="STDOUT" />
- </root>
-</configuration>
+++ /dev/null
-# This file contains test cases for the OVSDB Northbound API
-# The ordering of the test data MUST be as follows:
-# name:
-# operation:
-# uri:
-# json:
-# expected:
-#
-# The tests are run in the order specified in this file
-# The following variables are permitted in the URI or JSON:
-#
-# ${node} = The node identifier
-# ${uuid} = The last UUID returned by a POST operation
-# ${bridge_uuid} = The UUID of the test bridge
-# ${port_uuid} = The UUID of the test port
----
-- name: testGetBridgeRows
- operation: GET
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/bridge/rows
- json:
- expected: 200
-
-- name: testGetPortRows
- operation: GET
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/port/rows
- json:
- expected: 200
-
-- name: testGetInterfaceRows
- operation: GET
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/interface/rows
- json:
- expected: 200
-
-- name: testGetControllerRows
- operation: GET
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/controller/rows
- json:
- expected: 200
-
-- name: testGetSslRows
- operation: GET
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/ssl/rows
- json:
- expected: 200
-
-- name: testGetSflowRows
- operation: GET
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/sflow/rows
- json:
- expected: 200
-
-- name: testGetQosRows
- operation: GET
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/qos/rows
- json:
- expected: 200
-
-- name: testGetQueueRows
- operation: GET
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/queue/rows
- json:
- expected: 200
-
-- name: testGetNetflowRows
- operation: GET
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/netflow/rows
- json:
- expected: 200
-
-- name: testGetManagerRows
- operation: GET
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/manager/rows
- json:
- expected: 200
-
-- name: testGetOpenVswitchRows
- operation: GET
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/open_vswitch/rows
- json:
- expected: 200
-
-# Bridge
-
-- name: testCreateBridge
- operation: POST
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/bridge/rows
- json: >
- {
- "row": {
- "Bridge": {
- "name": "bridge1",
- "datapath_type": "OPENFLOW"
- }
- }
- }
- expected: 201
-
-- name: testGetBridgeRow
- operation: GET
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/bridge/rows/${uuid}
- json:
- expected: 200
-
-- name: testUpdateBridgeRow
- operation: PUT
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/bridge/rows/${uuid}
- json: >
- {
- "row": {
- "Bridge": {
- "stp_enable": true
- }
- }
- }
- expected: 200
-
-# Port
-
-- name: testCreatePort
- operation: POST
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/port/rows
- json: >
- {
- "parent_uuid":"${bridge_uuid}",
- "row":{
- "Port":{
- "name":"testPort1"
- }
- }
- }
- expected: 201
-
-- name: testGetPortRow
- operation: GET
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/port/rows/${uuid}
- json:
- expected: 200
-
-- name: testUpdatePortRow
- operation: PUT
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/port/rows/${uuid}
- json: >
- {
- "row": {
- "Port": {
- "fake_bridge": true
- }
- }
- }
- expected: 200
-
-# Interface
-
-- name: testCreateInteface
- operation: POST
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/interface/rows
- json: >
- {
- "parent_uuid": "${port_uuid}",
- "row":{
- "Interface":{
- "name":"testInterface",
- "admin_state":"up"
- }
- }
- }
- expected: 201
-
-- name: testGetInterfaceRow
- operation: GET
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/interface/rows/${uuid}
- json:
- expected: 200
-
-- name: testUpdateInterfaceRow
- operation: PUT
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/interface/rows/${uuid}
- json: >
- {
- "row":{
- "Interface":{
- "type": "gre"
- }
- }
- }
- expected: 200
-
-- name: testDeleteInterfaceRow
- operation: DELETE
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/interface/rows/${uuid}
- json:
- expected: 204
-
-# Controller
-
-- name: testCreateController
- operation: POST
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/controller/rows
- json: >
- {
- "parent_uuid" : "${bridge_uuid}",
- "row" : {
- "Controller": {
- "target": "1.1.1.1"
- }
- }
- }
- expected: 201
-
-- name: testGetControllerRow
- operation: GET
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/controller/rows/${uuid}
- json:
- expected: 200
-
-- name: testUpdateControllerRow
- operation: PUT
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/controller/rows/${uuid}
- json: >
- {
- "row":{
- "Controller":{
- "is_connected": false
- }
- }
- }
- expected: 200
-
-- name: testDeleteControllerRow
- operation: DELETE
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/controller/rows/${uuid}
- json:
- expected: 204
-
-# SSL
-
-- name: testCreateSslRow
- operation: POST
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/ssl/rows
- json: >
- {
- "row":{
- "SSL":{
- "name":"mySSL",
- "ca_cert" : "ca_cert",
- "bootstrap_ca_cert" : true,
- "certificate":"pieceofpaper",
- "private_key" : "private"
- }
- }
- }
- expected: 201
-
-- name: testGetSslRow
- operation: GET
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/ssl/rows/${uuid}
- json:
- expected: 200
-
-- name: testUpdateSslRow
- operation: PUT
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/ssl/rows/${uuid}
- json: >
- {
- "row":{
- "SSL":{
- "private_key" : "secret"
- }
- }
- }
- expected: 200
-
-- name: testDeleteSslRow
- operation: DELETE
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/ssl/rows/${uuid}
- json:
- expected: 204
-
-# sFlow
-
-- name: testCreateSflowRow
- operation: POST
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/sflow/rows
- json: >
- {
- "parent_uuid": "${bridge_uuid}",
- "row": {
- "sFlow": {
- "targets": [
- "set",
- [
- "targets_string"
- ]
- ]
- }
- }
- }
- expected: 201
-
-- name: testGetSflowRow
- operation: GET
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/sflow/rows/${uuid}
- json:
- expected: 200
-
-- name: testUpdateSflowRow
- operation: PUT
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/sflow/rows/${uuid}
- json: >
- {
- "row":{
- "sFlow":{
- "targets": [
- "set",
- [
- "targets_string",
- "second_target"
- ]
- ]
- }
- }
- }
- expected: 200
-
-- name: testDeleteSflowRow
- operation: DELETE
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/sflow/rows/${uuid}
- json:
- expected: 204
-
-# QoS
-
-- name: testCreateQosRow
- operation: POST
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/qos/rows
- json: >
- {
- "parent_uuid" : "${port_uuid}",
- "row" : {
- "QoS": {
- "type": "linux-htb"
- }
- }
- }
- expected: 201
-
-- name: testGetQosRow
- operation: GET
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/qos/rows/${uuid}
- json:
- expected: 200
-
-- name: testUpdateQosRow
- operation: PUT
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/qos/rows/${uuid}
- json: >
- {
- "row":{
- "QoS":{
- "type": "linux-hfsc"
- }
- }
- }
- expected: 200
-
-# Queue
-
-- name: testCreateQueueRow
- operation: POST
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/queue/rows
- json: >
- {
- "parent_uuid": "${qos_uuid}",
- "row": {
- "Queue": {
- "dscp" : [
- "set",
- [
- 25
- ]
- ]
- }
- }
- }
- expected: 201
-
-- name: testGetQueueRow
- operation: GET
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/queue/rows/${uuid}
- json:
- expected: 200
-
-- name: testUpdateQueueRow
- operation: PUT
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/queue/rows/${uuid}
- json: >
- {
- "row":{
- "Queue":{
- "other_config" : [
- "map", ["foo", "bar" ]
- ]
- }
- }
- }
- expected: 200
-
-- name: testDeleteQueueRow
- operation: DELETE
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/queue/rows/${uuid}
- json:
- expected: 204
-
-# NetFlow
-
-- name: testCreateNetflowRow
- operation: POST
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/netflow/rows
- json: >
- {
- "parent_uuid":"${bridge_uuid}",
- "row" : {
- "NetFlow":{
- "targets" : [
- "set", ["192.168.1.102:9998"]],
- "active_timeout" : "0"
- }
- }
- }
- expected: 201
-
-- name: testGetNetflowRow
- operation: GET
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/netflow/rows/${uuid}
- json:
- expected: 200
-
-- name: testUpdateNetflowRow
- operation: PUT
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/netflow/rows/${uuid}
- json: >
- {
- "row" : {
- "NetFlow":{
- "targets" : [
- "set", ["192.168.1.102:9998", "192.168.2.102:9998"]]
- }
- }
- }
- expected: 200
-
-- name: testDeleteNetflowRow
- operation: DELETE
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/netflow/rows/${uuid}
- json:
- expected: 204
-
-# Manager
-
-- name: testCreateManagerRow
- operation: POST
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/manager/rows
- json: >
- {
- "parent_uuid":"${ovs_uuid}",
- "row":{
- "Manager":{
- "target":"a_string",
- "is_connected": true,
- "state":"active"
- }
- }
- }
- expected: 201
-
-- name: testGetManagerRow
- operation: GET
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/manager/rows/${uuid}
- json:
- expected: 200
-
-- name: testUpdateManagerRow
- operation: PUT
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/manager/rows/${uuid}
- json: >
- {
- "row":{
- "Manager":{
- "is_connected": false
- }
- }
- }
- expected: 200
-
-- name: testDeleteManagerRow
- operation: DELETE
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/manager/rows/${uuid}
- json:
- expected: 204
-
-# Cleanup
-
-- name: testDeleteQosRow
- operation: DELETE
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/qos/rows/${qos_uuid}
- json:
- expected: 204
-
-- name: testDeletePortRow
- operation: DELETE
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/port/rows/${port_uuid}
- json:
- expected: 204
-
-- name: testDeleteBridgeRow
- operation: DELETE
- uri: /ovsdb/nb/v2/node/OVS/${node}/tables/bridge/rows/${bridge_uuid}
- json:
- expected: 204
+++ /dev/null
-<?xml version='1.0' encoding='utf-8'?>
-<Server>
- <!--APR library loader. Documentation at /docs/apr.html -->
- <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
- <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
- <Listener className="org.apache.catalina.core.JasperListener" />
- <!-- Prevent memory leaks due to use of particular java/javax APIs-->
- <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
- <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
- <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
-
- <Service name="Catalina">
- <Connector port="8888" protocol="org.apache.coyote.http11.Http11NioProtocol"
- connectionTimeout="20000"
- redirectPort="8443" />
-
- <!--
- Please remove the comments around the following Connector tag to enable HTTPS Authentication support.
- Remember to add a valid keystore in the configuration folder.
- More info : http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration
- -->
-
- <!--
- <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
- maxThreads="150" scheme="https" secure="true"
- clientAuth="false" sslProtocol="TLS"
- keystoreFile="configuration/keystore"
- keystorePass="changeit"/>
- -->
-
- <Engine name="Catalina" defaultHost="localhost">
- <Host name="localhost" appBase=""
- unpackWARs="false" autoDeploy="false"
- deployOnStartup="false" createDirs="false">
- <Realm className="org.opendaylight.controller.security.ControllerCustomRealm" />
- <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-
- <!--
- <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
- prefix="web_access_log_" suffix=".txt" resolveHosts="false"
- rotatable="true" fileDateFormat="yyyy-MM"
- pattern="%{yyyy-MM-dd HH:mm:ss.SSS z}t - [%a] - %r"/>
- -->
-
- </Host>
- </Engine>
- </Service>
-</Server>
<type>xml</type>
<classifier>config</classifier>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>utils.servicehelper</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>schema.openvswitch</artifactId>
+ <version>${project.version}</version>
+ </dependency>
</dependencies>
</project>
import static org.opendaylight.ovsdb.lib.operations.Operations.op;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
+import com.google.common.util.concurrent.ListenableFuture;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
-
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
+import org.junit.runner.RunWith;
import org.opendaylight.ovsdb.lib.MonitorCallBack;
import org.opendaylight.ovsdb.lib.OvsdbClient;
-import org.opendaylight.ovsdb.lib.impl.OvsdbConnectionService;
+import org.opendaylight.ovsdb.lib.it.LibraryIntegrationTestBase;
+import org.opendaylight.ovsdb.lib.it.LibraryIntegrationTestUtils;
import org.opendaylight.ovsdb.lib.message.MonitorRequest;
import org.opendaylight.ovsdb.lib.message.MonitorRequestBuilder;
import org.opendaylight.ovsdb.lib.message.MonitorSelect;
import org.opendaylight.ovsdb.lib.message.TableUpdate;
import org.opendaylight.ovsdb.lib.message.TableUpdates;
-import org.opendaylight.ovsdb.lib.message.UpdateNotification;
import org.opendaylight.ovsdb.lib.notation.Column;
import org.opendaylight.ovsdb.lib.notation.Mutator;
import org.opendaylight.ovsdb.lib.notation.Row;
import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
import org.opendaylight.ovsdb.lib.schema.TableSchema;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerSuite;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
-import com.google.common.util.concurrent.ListenableFuture;
-
-
-public class OvsdbClientTestIT extends OvsdbTestBase {
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerSuite.class)
+public class OvsdbClientTestIT extends LibraryIntegrationTestBase {
OvsdbClient ovs;
DatabaseSchema dbSchema = null;
Assert.assertNotNull(dbNames);
boolean hasOpenVswitchSchema = false;
for(String dbName : dbNames) {
- if (dbName.equals(OPEN_VSWITCH_SCHEMA)) {
+ if (dbName.equals(LibraryIntegrationTestUtils.OPEN_VSWITCH_SCHEMA)) {
hasOpenVswitchSchema = true;
break;
}
}
- Assert.assertTrue(OPEN_VSWITCH_SCHEMA+" schema is not supported by the switch", hasOpenVswitchSchema);
+ Assert.assertTrue(LibraryIntegrationTestUtils.OPEN_VSWITCH_SCHEMA
+ + " schema is not supported by the switch", hasOpenVswitchSchema);
}
@Before
return;
}
- ovs = getTestConnection();
+ ovs = LibraryIntegrationTestUtils.getTestConnection(this);
System.out.println("Connection Info :" + ovs.getConnectionInfo().toString());
testGetDBs();
- dbSchema = ovs.getSchema(OPEN_VSWITCH_SCHEMA).get();
+ dbSchema = ovs.getSchema(LibraryIntegrationTestUtils.OPEN_VSWITCH_SCHEMA).get();
}
@After
List<OperationResult> operationResults = results.get();
System.out.println("Delete operation results = " + operationResults);
- OvsdbConnectionService.getService().disconnect(ovs);
- }
-
-
- @Override
- public void update(Object node, UpdateNotification upadateNotification) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void locked(Object node, List<String> ids) {
- // TODO Auto-generated method stub
-
- }
- @Override
- public void stolen(Object node, List<String> ids) {
- // TODO Auto-generated method stub
-
+ ovs.disconnect();
}
}
import static org.opendaylight.ovsdb.lib.operations.Operations.op;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
+import com.google.common.util.concurrent.ListenableFuture;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
-
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
+import org.junit.runner.RunWith;
import org.opendaylight.ovsdb.lib.OvsdbClient;
-import org.opendaylight.ovsdb.lib.impl.OvsdbConnectionService;
-import org.opendaylight.ovsdb.lib.message.UpdateNotification;
+import org.opendaylight.ovsdb.lib.it.LibraryIntegrationTestBase;
+import org.opendaylight.ovsdb.lib.it.LibraryIntegrationTestUtils;
import org.opendaylight.ovsdb.lib.notation.Mutator;
import org.opendaylight.ovsdb.lib.notation.UUID;
import org.opendaylight.ovsdb.lib.operations.OperationResult;
import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
import org.opendaylight.ovsdb.lib.schema.TableSchema;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerSuite;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Sets;
-import com.google.common.util.concurrent.ListenableFuture;
-
-public class OvsdbClientTestITTyped extends OvsdbTestBase {
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerSuite.class)
+public class OvsdbClientTestTypedIT extends LibraryIntegrationTestBase {
OvsdbClient ovs;
DatabaseSchema dbSchema = null;
Assert.assertNotNull(dbNames);
boolean hasOpenVswitchSchema = false;
for(String dbName : dbNames) {
- if (dbName.equals(OPEN_VSWITCH_SCHEMA)) {
+ if (dbName.equals(LibraryIntegrationTestUtils.OPEN_VSWITCH_SCHEMA)) {
hasOpenVswitchSchema = true;
break;
}
}
- Assert.assertTrue(OPEN_VSWITCH_SCHEMA+" schema is not supported by the switch", hasOpenVswitchSchema);
+ Assert.assertTrue(LibraryIntegrationTestUtils.OPEN_VSWITCH_SCHEMA
+ + " schema is not supported by the switch", hasOpenVswitchSchema);
}
@Before
if (ovs != null) {
return;
}
- ovs = this.getTestConnection();
+ ovs = LibraryIntegrationTestUtils.getTestConnection(this);
testGetDBs();
- dbSchema = ovs.getSchema(OPEN_VSWITCH_SCHEMA).get();
+ dbSchema = ovs.getSchema(LibraryIntegrationTestUtils.OPEN_VSWITCH_SCHEMA).get();
}
@After
List<OperationResult> operationResults = results.get();
System.out.println("Delete operation results = " + operationResults);
- OvsdbConnectionService.getService().disconnect(ovs);
- }
-
- @Override
- public void update(Object node, UpdateNotification upadateNotification) {
- // TODO Auto-generated method stub
-
- }
- @Override
- public void locked(Object node, List<String> ids) {
- // TODO Auto-generated method stub
-
- }
- @Override
- public void stolen(Object node, List<String> ids) {
- // TODO Auto-generated method stub
-
+ ovs.disconnect();
}
}
*/
package org.opendaylight.ovsdb.integrationtest.ovsdbclient;
+
import java.util.Map;
import java.util.Set;
-
import org.opendaylight.ovsdb.lib.notation.Column;
import org.opendaylight.ovsdb.lib.notation.UUID;
import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
+++ /dev/null
-<?xml version="1.0"?>
-<enunciate label="full" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.26.xsd">
-
- <services>
- <rest defaultRestSubcontext="/ovsdb/nb/v2"/>
- </services>
-
- <modules>
- <docs docsDir="rest" title="OVSDB Table operations over REST" includeExampleXml="true" includeExampleJson="true"/>
- </modules>
-</enunciate>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (C) 2014 Red Hat, 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.ovsdb</groupId>
- <artifactId>commons</artifactId>
- <version>1.4.0-SNAPSHOT</version>
- <relativePath>../commons/parent</relativePath>
- </parent>
-
- <artifactId>northbound</artifactId>
- <version>0.8.0-SNAPSHOT</version>
- <packaging>bundle</packaging>
- <description>The OVSDB Plugin integration project is a project for OpenDaylight that will implement the Open vSwitch Database RFC 7047 management protocol allowing the Southbound configuration of vSwitches and a network virtualization implementation.</description>
- <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
- <licenses>
- <license>
- <name>Eclipse Public License v1.0</name>
- <url>http://www.eclipse.org/legal/epl-v10.html</url>
- </license>
- </licenses>
- <developers>
- <developer>
- <name>Sam Hague</name>
- <email>shague@gmail.com</email>
- <url>https://github.com/shague</url>
- </developer>
- </developers>
- <scm>
- <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
- <tag>HEAD</tag>
- <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
- </scm>
-
- <dependencies>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- </dependency>
- <dependency>
- <groupId>org.codehaus.enunciate</groupId>
- <artifactId>enunciate-core-annotations</artifactId>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.powermock</groupId>
- <artifactId>powermock-api-mockito</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.powermock</groupId>
- <artifactId>powermock-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.powermock</groupId>
- <artifactId>powermock-module-junit4</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>commons.northbound</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.ovsdb</groupId>
- <artifactId>library</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.ovsdb</groupId>
- <artifactId>plugin</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.ovsdb</groupId>
- <artifactId>utils.servicehelper</artifactId>
- </dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Import-Package>org.opendaylight.controller.sal.utils,
- org.opendaylight.controller.northbound.commons,
- org.opendaylight.controller.northbound.commons.exception,
- org.opendaylight.controller.northbound.commons.utils,
- com.sun.jersey.spi.container.servlet,
- org.opendaylight.controller.sal.core,
- org.opendaylight.controller.sal.authorization,
- org.opendaylight.ovsdb.plugin.api,
- org.opendaylight.ovsdb.lib,
- org.opendaylight.ovsdb.lib.jsonrpc,
- org.opendaylight.ovsdb.lib.notation,
- org.opendaylight.ovsdb.lib.operations,
- org.opendaylight.ovsdb.lib.message,
- org.opendaylight.ovsdb.lib.schema,
- org.opendaylight.ovsdb.lib.schema.typed,
- javax.ws.rs,
- javax.ws.rs.core,
- javax.xml.bind,
- javax.xml.bind.annotation,
- org.slf4j,
- org.apache.catalina.filters,
- !org.codehaus.enunciate.jaxrs,*</Import-Package>
- <Export-Package/>
- <Web-ContextPath>/ovsdb/nb</Web-ContextPath>
- <Jaxrs-Resources>,${classes;ANNOTATION;javax.ws.rs.Path}</Jaxrs-Resources>
- </instructions>
- <manifestLocation>${project.basedir}/src/main/resources/META-INF</manifestLocation>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-checkstyle-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.codehaus.enunciate</groupId>
- <artifactId>maven-enunciate-plugin</artifactId>
- <version>${enunciate.version}</version>
- </plugin>
- <plugin>
- <groupId>org.jacoco</groupId>
- <artifactId>jacoco-maven-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-</project>
+++ /dev/null
-/*
- * Copyright (c) 2014, 2015 Red Hat, 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
- */
-
-package org.opendaylight.ovsdb.northbound;
-
-import com.fasterxml.jackson.databind.SerializationFeature;
-import java.util.List;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.opendaylight.controller.northbound.commons.exception.InternalServerErrorException;
-import org.opendaylight.ovsdb.lib.OvsdbClient;
-import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-/**
- * Northbound interface for OVSDB Databases
- */
-public class DatabaseResource {
-
- String nodeId;
- ObjectMapper objectMapper;
- DatabaseResource(String id) {
- this.nodeId = id;
- objectMapper = new ObjectMapper();
- objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
- }
-
- private DatabaseSchema getDatabaseSchema (String databaseName) {
- String csDatabaseName = this.caseSensitiveDatabaseName(databaseName);
- OvsdbClient client = NodeResource.getOvsdbClient(nodeId, this);
- return client.getDatabaseSchema(csDatabaseName);
- }
-
- @GET
- @Produces(MediaType.APPLICATION_JSON)
- public Response getDatabases(){
- OvsdbClient client = NodeResource.getOvsdbClient(nodeId, this);
- try {
- List<String> databases = client.getDatabases().get();
- if (databases == null) {
- return Response.noContent().build();
- }
- String response = objectMapper.writeValueAsString(databases);
- return Response.status(Response.Status.OK)
- .entity(response)
- .build();
- } catch (Exception e) {
- throw new InternalServerErrorException("Failed due to exception " + e.getMessage());
- }
- }
-
- @GET
- @Path("{name}")
- @Produces(MediaType.APPLICATION_JSON)
- public Response getDatabases(@PathParam("name") String name) throws JsonProcessingException {
- DatabaseSchema dbSchema = this.getDatabaseSchema(name);
- String response = objectMapper.writeValueAsString(dbSchema);
- return Response.status(Response.Status.OK)
- .entity(response)
- .build();
- }
-
- @Path("{name}/table")
- public TableResource getDatabaseTables(@PathParam("name") String name){
- String csDatabaseName = this.caseSensitiveDatabaseName(name);
- return new TableResource(nodeId, csDatabaseName);
- }
-
- private String caseSensitiveDatabaseName (String ciDatabaseName) {
- OvsdbClient client = NodeResource.getOvsdbClient(nodeId, this);
- try {
- List<String> databases = client.getDatabases().get();
- if (databases == null) {
- return ciDatabaseName;
- }
- for (String csDatabaseName : databases) {
- if (csDatabaseName.equalsIgnoreCase(ciDatabaseName)) {
- return csDatabaseName;
- }
- }
- return ciDatabaseName;
- } catch (Exception e) {
- return ciDatabaseName;
- }
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2014, 2015 Red Hat, 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
- */
-
-package org.opendaylight.ovsdb.northbound;
-
-import com.fasterxml.jackson.databind.SerializationFeature;
-import java.io.InputStream;
-import java.util.Collections;
-import java.util.List;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.opendaylight.controller.northbound.commons.RestMessages;
-import org.opendaylight.controller.northbound.commons.exception.ResourceNotFoundException;
-import org.opendaylight.controller.northbound.commons.exception.ServiceUnavailableException;
-import org.opendaylight.ovsdb.lib.OvsdbClient;
-import org.opendaylight.ovsdb.plugin.api.Connection;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.common.collect.Lists;
-
-/**
- * Northbound Interface for OVSDB Nodes
- */
-public class NodeResource {
- ObjectMapper objectMapper;
- public NodeResource () {
- objectMapper = new ObjectMapper();
- objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
- }
-
- public static Node getOvsdbNode(String nodeId, Object bundleClassRef) {
- OvsdbConnectionService connectionService =
- (OvsdbConnectionService)ServiceHelper.
- getGlobalInstance(OvsdbConnectionService.class, bundleClassRef);
- if (connectionService == null) {
- throw new ServiceUnavailableException("Ovsdb ConnectionService "
- + RestMessages.SERVICEUNAVAILABLE.toString());
- }
-
- Node node = connectionService.getNode(nodeId);
- if (node == null) {
- throw new ResourceNotFoundException("Node "+nodeId+" not found");
- }
-
- return node;
- }
-
- public static Connection getOvsdbConnection(String nodeId, Object bundleClassRef) {
- OvsdbConnectionService connectionService =
- (OvsdbConnectionService)ServiceHelper.
- getGlobalInstance(OvsdbConnectionService.class, bundleClassRef);
- if (connectionService == null) {
- throw new ServiceUnavailableException("Ovsdb ConnectionService "
- + RestMessages.SERVICEUNAVAILABLE.toString());
- }
-
- Node node = connectionService.getNode(nodeId);
- if (node == null) {
- throw new ResourceNotFoundException("Node "+nodeId+" not found");
- }
-
- Connection connection = connectionService.getConnection(node);
- if (connection == null) {
- throw new ResourceNotFoundException("Connection for "+nodeId+" not available");
- }
-
- return connection;
- }
-
- public static OvsdbClient getOvsdbClient(String nodeId, Object bundleClassRef) {
- Connection connection = NodeResource.getOvsdbConnection(nodeId, bundleClassRef);
- OvsdbClient client = connection.getClient();
- if (client == null) {
- throw new ResourceNotFoundException("No Ovsdb Client to handle Node "+nodeId);
- }
- return client;
- }
-
- @GET
- @Produces(MediaType.APPLICATION_JSON)
- public Response getNodes() throws JsonProcessingException {
- OvsdbConnectionService connectionService = (OvsdbConnectionService)ServiceHelper.getGlobalInstance(OvsdbConnectionService.class, this);
- List<Node> nodes = connectionService.getNodes();
- if (nodes == null) {
- return Response.noContent().build();
- }
-
- List<String> nodeIds = Lists.newArrayList();
- for (Node node : nodes) {
- nodeIds.add(node.getId().getValue());
- }
- Collections.sort(nodeIds);
-
- String response = objectMapper.writeValueAsString(nodeIds);
- return Response.status(Response.Status.OK)
- .entity(response)
- .build();
- }
-
- @POST
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public Response createNode(InputStream is){
- return Response.noContent().build();
- }
-
- @GET
- @Path("{id}")
- @Produces(MediaType.APPLICATION_JSON)
- public Response getNode(@PathParam("id") String id) throws JsonProcessingException {
- OvsdbClient client = NodeResource.getOvsdbClient(id, this);
- String response = objectMapper.writeValueAsString(client.getConnectionInfo());
- return Response.status(Response.Status.OK)
- .entity(response)
- .build();
- }
-
- @PUT
- @Path("{id}")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public Response updateNode(@PathParam("id") String id, InputStream is){
- return Response.noContent().build();
- }
-
- @DELETE
- @Path("{id}")
- public Response deleteNode(@PathParam("id") String id){
- return Response.noContent().build();
- }
-
- @Path("{id}/database")
- public DatabaseResource getNodeDatabase(@PathParam("id") String nodeId){
- return new DatabaseResource(nodeId);
- }
-
-}
+++ /dev/null
-/*
- * Copyright (c) 2014, 2015 Red Hat, 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
- */
-
-package org.opendaylight.ovsdb.northbound;
-
-import java.io.IOException;
-import java.util.Map;
-import java.util.concurrent.ExecutionException;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.SecurityContext;
-import javax.ws.rs.core.UriInfo;
-
-import org.codehaus.enunciate.jaxrs.ResponseCode;
-import org.codehaus.enunciate.jaxrs.StatusCodes;
-import org.codehaus.enunciate.jaxrs.TypeHint;
-import org.opendaylight.controller.northbound.commons.RestMessages;
-import org.opendaylight.controller.northbound.commons.exception.BadRequestException;
-import org.opendaylight.controller.northbound.commons.exception.ServiceUnavailableException;
-import org.opendaylight.controller.northbound.commons.exception.UnauthorizedException;
-import org.opendaylight.controller.northbound.commons.utils.NorthboundUtils;
-import org.opendaylight.controller.sal.authorization.Privilege;
-import org.opendaylight.ovsdb.plugin.api.Status;
-import org.opendaylight.ovsdb.lib.OvsdbClient;
-import org.opendaylight.ovsdb.lib.notation.Row;
-import org.opendaylight.ovsdb.lib.notation.UUID;
-import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
-import org.opendaylight.ovsdb.plugin.api.OvsVswitchdSchemaConstants;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService;
-import org.opendaylight.ovsdb.plugin.api.StatusWithUuid;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-
-import com.fasterxml.jackson.databind.JsonNode;
-
-/**
-* OVSDB Northbound REST API.<br>
-* This class provides REST APIs to Create, Read, Update and Delete OVSDB Row in any of the ovsdb table
-* database one at a time. The JSON used to create rows is in the same format as the OVSDB JSON-RPC messages.
-* This format is documented in the <a href="http://openvswitch.org/ovs-vswitchd.conf.db.5.pdf">OVSDB Schema</a>
-* and in <a href="http://tools.ietf.org/rfc/rfc7047.txt">RFC 7047</a>.
-*
-* <br>
-* <br>
-* Authentication scheme : <b>HTTP Basic</b><br>
-* Authentication realm : <b>opendaylight</b><br>
-* Transport : <b>HTTP and HTTPS</b><br>
-* <br>
-* HTTPS Authentication is disabled by default.
-*/
-
-@Path("/v2/")
-@Deprecated
-public class OvsdbNorthboundV2 {
-
- @Context
- private UriInfo _uriInfo;
- private String username;
-
- @Context
- public void setSecurityContext(SecurityContext context) {
- if (context != null && context.getUserPrincipal() != null) {
- username = context.getUserPrincipal().getName();
- }
- }
-
- protected String getUserName() {
- return username;
- }
-
- /**
- * Create a Row for Open_vSwitch schema
- *
- * @param nodeType type of node e.g OVS
- * @param nodeId ID of the node
- * @param tableName name of the OVSDB table
- * @param rowJson the {@link OvsdbRow} Row that is being inserted
- *
- * @return Response as dictated by the HTTP Response Status code
- *
- * <br>
- * Examples:
- * <br>
- * Create a Bridge Row:
- * <pre>
- *
- * Request URL:
- * POST http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/bridge/rows
- *
- * JSON:
- * {
- * "row": {
- * "Bridge": {
- * "name": "bridge1",
- * "datapath_type": "OPENFLOW"
- * }
- * }
- * }
- * </pre>
- *
- *
- * Create a Port Row:
- * <pre>
- *
- * Request URL:
- * POST http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/port/rows
- *
- * JSON:
- * {
- * "parent_uuid": "b01cd26b-9c63-4216-8cf2-55f7087adab1",
- * "row": {
- * "Port": {
- * "name": "port1",
- * "mac": [
- * "set",
- * "00:00:00:00:00:01"
- * ],
- * "tag": [
- * "set",
- * 200
- * ]
- * }
- * }
- * }
- * </pre>
- *
- *
- * Create an Interface Row:
- * <pre>
- *
- * Request URL:
- * POST http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/interface/rows
- *
- * JSON:
- * {
- * "parent_uuid": "c7b54c9b-9b25-4801-a81d-d7bc489d4840",
- * "row": {
- * "Interface": {
- * "name": "br2",
- * "mac": [
- * "set",
- * "00:00:bb:bb:00:01"
- * ],
- * "admin_state": "up"
- * }
- * }
- * }
- * </pre>
- *
- *
- * Create an SSL Row:
- * <pre>
- *
- * Request URL:
- * POST http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/SSL/rows
- *
- * JSON:
- * {
- * "row": {
- * "SSL": {
- * "name": "mySSL",
- * "ca_cert": "ca_cert",
- * "bootstrap_ca_cert": true,
- * "certificate": "pieceofpaper",
- * "private_key": "private"
- * }
- * }
- * }
- * </pre>
- *
- *
- * Create an sFlow Row:
- * <pre>
- *
- * Request URL:
- * POST http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/sflow/rows
- *
- * JSON:
- * {
- * "parent_uuid": "6b3072ba-a120-4db9-82f8-a8ce4eae6942",
- * "row": {
- * "sFlow": {
- * "agent": [
- * "set",
- * "agent_string"
- * ],
- * "targets": [
- * "set",
- * "targets_string"
- * ]
- * }
- * }
- * }
- * </pre>
- *
- *
- * Create a QoS Row:
- * <pre>
- *
- * Request URL:
- * POST http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/qos/rows
- *
- * JSON:
- * {
- * "parent_uuid": "b109dbcf-47bb-4121-b244-e623b3421d6e",
- * "row": {
- * "QoS": {
- * "type": "linux-htb"
- * }
- * }
- * }
- * </pre>
- *
- *
- * Create a Queue Row:
- * <pre>
- *
- * Request URL:
- * POST http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/queue/rows
- *
- * {
- * "parent_uuid": "b16eae7d-7e97-46d2-95d1-333d1de4a3d7",
- * "row": {
- * "Queue": {
- * "dscp": [
- * "set",
- * "25"
- * ]
- * }
- * }
- * }
- * </pre>
- *
- *
- * Create a Netflow Row:
- * <pre>
- *
- * Request URL:
- * POST http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/netflow/rows
- *
- * JSON:
- * {
- * "parent_uuid": "b01cd26b-9c63-4216-8cf2-55f7087adab1",
- * "row": {
- * "NetFlow": {
- * "targets": [
- * "set",
- * [
- * "192.168.1.102:9998"
- * ]
- * ],
- * "active_timeout": "0"
- * }
- * }
- * }
- * </pre>
- *
- *
- * Create a Manager Row:
- * <pre>
- *
- * Request URL:
- * POST http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/manager/rows
- *
- * JSON:
- * {
- * "parent_uuid": "8d3fb89b-5fac-4631-a990-f5a4e7f5383a",
- * "row": {
- * "Manager": {
- * "target": "a_string",
- * "is_connected": true,
- * "state": "active"
- * }
- * }
- * }
- * </pre>
- * @throws IOException
- * @throws ExecutionException
- * @throws InterruptedException
- */
-
- @Path("/node/{nodeType}/{nodeId}/tables/{tableName}/rows")
- @POST
- @StatusCodes({ @ResponseCode(code = 201, condition = "Row Inserted successfully"),
- @ResponseCode(code = 400, condition = "Invalid data passed"),
- @ResponseCode(code = 401, condition = "User not authorized to perform this operation")})
- @Consumes({ MediaType.APPLICATION_JSON})
- public Response addRow(@PathParam("nodeType") String nodeType, @PathParam("nodeId") String nodeId,
- @PathParam("tableName") String tableName, JsonNode rowJson) throws IOException, InterruptedException, ExecutionException {
-
- if (!NorthboundUtils.isAuthorized(getUserName(), "default", Privilege.WRITE, this)) {
- throw new UnauthorizedException("User is not authorized to perform this operation");
- }
-
- OvsdbConfigurationService
- ovsdbTable = (OvsdbConfigurationService)ServiceHelper.getGlobalInstance(OvsdbConfigurationService.class,
- this);
- if (ovsdbTable == null) {
- throw new ServiceUnavailableException("OVS Configuration Service " + RestMessages.SERVICEUNAVAILABLE.toString());
- }
-
- OvsdbConnectionService
- connectionService = (OvsdbConnectionService)ServiceHelper.getGlobalInstance(OvsdbConnectionService.class, this);
- Node node = connectionService.getNode(nodeId);
-
- OvsdbClient client = connectionService.getConnection(node).getClient();
- OvsdbRow localRow = OvsdbRow.fromJsonNode(client, OvsVswitchdSchemaConstants.DATABASE_NAME, rowJson);
- String bckCompatibleTableName = this.getBackwardCompatibleTableName(client, OvsVswitchdSchemaConstants.DATABASE_NAME, tableName);
-
- if (localRow == null) {
- return Response.status(Response.Status.BAD_REQUEST).build();
- }
-
- StatusWithUuid
- statusWithUuid = ovsdbTable.insertRow(node, bckCompatibleTableName, localRow.getParentUuid(), localRow.getRow());
-
- if (statusWithUuid.isSuccess()) {
- UUID uuid = statusWithUuid.getUuid();
- return Response.status(Response.Status.CREATED)
- .header("Location", String.format("%s/%s", _uriInfo.getAbsolutePath().toString(),
- uuid.toString()))
- .entity(uuid.toString())
- .build();
- }
- return NorthboundUtils.getResponse(
- new org.opendaylight.controller.sal.utils.Status(
- org.opendaylight.controller.sal.utils.StatusCode.SUCCESS));
- }
-
- /**
- * Read a Row
- *
- * @param nodeType type of node e.g OVS
- * @param nodeId ID of the node
- * @param tableName name of the ovsdb table
- * @param rowUuid UUID of the row being read
- *
- * @return Row corresponding to the UUID.
- *
- * <br>
- * Examples:
- * <br>
- * <pre>
- * Get a specific Bridge Row:
- * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/bridge/rows/6f4c602c-026f-4390-beea-d50d6d448100
- *
- * Get a specific Port Row:
- * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/port/rows/6f4c602c-026f-4390-beea-d50d6d448100
- *
- * Get a specific Interface Row:
- * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/interface/rows/6f4c602c-026f-4390-beea-d50d6d448100
- *
- * Get a specific Controller Row:
- * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/controller/rows/6f4c602c-026f-4390-beea-d50d6d448100
- *
- * Get a specific SSL Row:
- * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/SSL/rows/6f4c602c-026f-4390-beea-d50d6d448100
- *
- * Get a specific sFlow Row:
- * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/sflow/rows/6f4c602c-026f-4390-beea-d50d6d448100
- *
- * Get a specific QoS Row:
- * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/qos/rows/6f4c602c-026f-4390-beea-d50d6d448100
- *
- * Get a specific Queue Row:
- * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/queue/rows/6f4c602c-026f-4390-beea-d50d6d448100
- *
- * Get a specific Netflow Row:
- * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/netflow/rows/6f4c602c-026f-4390-beea-d50d6d448100
- *
- * Get a specific Manager Row:
- * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/manager/rows/6f4c602c-026f-4390-beea-d50d6d448100
- * </pre>
- */
-
- @Path("/node/{nodeType}/{nodeId}/tables/{tableName}/rows/{rowUuid}")
- @GET
- @StatusCodes({ @ResponseCode(code = 200, condition = "Row Updated successfully"),
- @ResponseCode(code = 400, condition = "Invalid data passed"),
- @ResponseCode(code = 401, condition = "User not authorized to perform this operation")})
- @Produces({ MediaType.APPLICATION_JSON})
- @TypeHint(Row.class)
- public Row getRow(@PathParam("nodeType") String nodeType, @PathParam("nodeId") String nodeId,
- @PathParam("tableName") String tableName, @PathParam("rowUuid") String rowUuid) {
-
- if (!NorthboundUtils.isAuthorized(getUserName(), "default", Privilege.WRITE, this)) {
- throw new UnauthorizedException("User is not authorized to perform this operation");
- }
-
- OvsdbConfigurationService
- ovsdbTable = (OvsdbConfigurationService)ServiceHelper.getGlobalInstance(OvsdbConfigurationService.class,
- this);
- if (ovsdbTable == null) {
- throw new ServiceUnavailableException("UserManager " + RestMessages.SERVICEUNAVAILABLE.toString());
- }
-
- OvsdbConnectionService
- connectionService = (OvsdbConnectionService)ServiceHelper.getGlobalInstance(OvsdbConnectionService.class, this);
- Node node = connectionService.getNode(nodeId);
- OvsdbClient client = connectionService.getConnection(node).getClient();
- String bckCompatibleTableName = this.getBackwardCompatibleTableName(client, OvsVswitchdSchemaConstants.DATABASE_NAME, tableName);
-
- Row row;
- try {
- row = ovsdbTable.getRow(node, bckCompatibleTableName, rowUuid);
- } catch (Exception e) {
- throw new BadRequestException(e.getMessage());
- }
- return row;
- }
-
- /**
- * Read all Rows of a table
- *
- * @param nodeType type of node e.g OVS
- * @param nodeId ID of the node
- * @param tableName name of the ovsdb table
- *
- * @return All the Rows of a table
- *
- * <br>
- * Examples:
- * <br>
- * <pre>
- * Get all Bridge Rows:
- * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/bridge/rows
- *
- * Get all Port Rows:
- * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/port/rows
- *
- * Get all Interface Rows:
- * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/interface/rows
- *
- * Get all Controller Rows:
- * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/controller/rows
- *
- * Get all SSL Rows:
- * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/SSL/rows
- *
- * Get all sFlow Rows:
- * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/sflow/rows
- *
- * Get all QoS Rows:
- * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/qos/rows
- *
- * Get all Queue Rows:
- * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/queue/rows
- *
- * Get all Netflow Rows:
- * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/netflow/rows
- *
- * Get all Manager Rows:
- * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/manager/rows
- *
- * Get all Open vSwitch Rows:
- * GET http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/open_vswitch/rows
- * </pre>
- */
-
- @Path("/node/{nodeType}/{nodeId}/tables/{tableName}/rows")
- @GET
- @StatusCodes({ @ResponseCode(code = 200, condition = "Row Updated successfully"),
- @ResponseCode(code = 400, condition = "Invalid data passed"),
- @ResponseCode(code = 401, condition = "User not authorized to perform this operation")})
- @Produces({ MediaType.APPLICATION_JSON})
- @TypeHint(OvsdbRows.class)
- public OvsdbRows getAllRows(@PathParam("nodeType") String nodeType, @PathParam("nodeId") String nodeId,
- @PathParam("tableName") String tableName) {
- if (!NorthboundUtils.isAuthorized(getUserName(), "default", Privilege.WRITE, this)) {
- throw new UnauthorizedException("User is not authorized to perform this operation");
- }
-
- OvsdbConfigurationService
- ovsdbTable = (OvsdbConfigurationService)ServiceHelper.getGlobalInstance(OvsdbConfigurationService.class,
- this);
- if (ovsdbTable == null) {
- throw new ServiceUnavailableException("UserManager " + RestMessages.SERVICEUNAVAILABLE.toString());
- }
-
- OvsdbConnectionService
- connectionService = (OvsdbConnectionService)ServiceHelper.getGlobalInstance(OvsdbConnectionService.class, this);
- Node node = connectionService.getNode(nodeId);
- OvsdbClient client = connectionService.getConnection(node).getClient();
- String bckCompatibleTableName = this.getBackwardCompatibleTableName(client, OvsVswitchdSchemaConstants.DATABASE_NAME, tableName);
- Map<String, Row> rows;
- try {
- rows = ovsdbTable.getRows(node, bckCompatibleTableName);
- } catch (Exception e) {
- throw new BadRequestException(e.getMessage());
- }
- return new OvsdbRows(rows);
- }
-
- /*
- /**
- * Update a Row
- *
- * @param nodeType type of node e.g OVS
- * @param nodeId ID of the node
- * @param tableName name of the ovsdb table
- * @param rowUuid UUID of the row being updated
- * @param row the {@link OVSDBRow} Row that is being updated
- *
- * @return Response as dictated by the HTTP Response Status code
- *
- * <br>
- * Examples:
- * <br>
- * Update the Bridge row to add a controller
- * <pre>
- *
- * Request URL:
- * PUT http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/bridge/rows/b01cd26b-9c63-4216-8cf2-55f7087adab1
- *
- * JSON:
- * {
- * "row": {
- * "Bridge": {
- * "controller": [
- * "set",
- * [
- * [
- * "uuid",
- * "a566e8b4-fc38-499b-8623-6087d5b36b72"
- * ]
- * ]
- * ]
- * }
- * }
- * }
- * </pre>
- */
-
- @Path("/node/{nodeType}/{nodeId}/tables/{tableName}/rows/{rowUuid}")
- @PUT
- @StatusCodes({ @ResponseCode(code = 200, condition = "Row Updated successfully"),
- @ResponseCode(code = 400, condition = "Invalid data passed"),
- @ResponseCode(code = 401, condition = "User not authorized to perform this operation")})
- @Consumes({ MediaType.APPLICATION_JSON})
- public Response updateRow(@PathParam("nodeType") String nodeType, @PathParam("nodeId") String nodeId,
- @PathParam("tableName") String tableName, @PathParam("rowUuid") String rowUuid,
- JsonNode rowJson) {
-
- if (!NorthboundUtils.isAuthorized(getUserName(), "default", Privilege.WRITE, this)) {
- throw new UnauthorizedException("User is not authorized to perform this operation");
- }
-
- OvsdbConfigurationService
- ovsdbTable = (OvsdbConfigurationService)ServiceHelper.getGlobalInstance(OvsdbConfigurationService.class,
- this);
- if (ovsdbTable == null) {
- throw new ServiceUnavailableException("OVS Configuration Service " + RestMessages.SERVICEUNAVAILABLE.toString());
- }
-
- OvsdbConnectionService
- connectionService = (OvsdbConnectionService)ServiceHelper.getGlobalInstance(OvsdbConnectionService.class, this);
- Node node = connectionService.getNode(nodeId);
- OvsdbClient client = connectionService.getConnection(node).getClient();
- String bckCompatibleTableName = this.getBackwardCompatibleTableName(client, OvsVswitchdSchemaConstants.DATABASE_NAME, tableName);
- OvsdbRow localRow = OvsdbRow.fromJsonNode(client, OvsVswitchdSchemaConstants.DATABASE_NAME, rowJson);
-
- if (localRow == null) {
- return Response.status(Response.Status.BAD_REQUEST).build();
- }
-
- ovsdbTable.updateRow(node, bckCompatibleTableName, localRow.getParentUuid(), rowUuid, localRow.getRow());
- return NorthboundUtils.getResponse(
- new org.opendaylight.controller.sal.utils.Status(
- org.opendaylight.controller.sal.utils.StatusCode.SUCCESS));
- }
-
- /**
- * Delete a row
- *
- * @param nodeType type of node e.g OVS
- * @param nodeId ID of the node
- * @param tableName name of the ovsdb table
- * @param uuid UUID of the Row to be removed
- *
- * @return Response as dictated by the HTTP Response Status code
- *
- * <br>
- * Examples:
- * <br>
- * <pre>
- * Delete a specific Bridge Row:
- * DELETE http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/bridge/rows/6f4c602c-026f-4390-beea-d50d6d448100
- *
- * Delete a specific Port Row:
- * DELETE http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/port/rows/6f4c602c-026f-4390-beea-d50d6d448100
- *
- * Delete a specific Interface Row:
- * DELETE http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/interface/rows/6f4c602c-026f-4390-beea-d50d6d448100
- *
- * Delete a specific Controller Row:
- * DELETE http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/controller/rows/6f4c602c-026f-4390-beea-d50d6d448100
- *
- * Delete a specific SSL Row:
- * DELETE http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/SSL/rows/6f4c602c-026f-4390-beea-d50d6d448100
- *
- * Delete a specific sFlow Row:
- * DELETE http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/sflow/rows/6f4c602c-026f-4390-beea-d50d6d448100
- *
- * Delete a specific QoS Row:
- * DELETE http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/qos/rows/6f4c602c-026f-4390-beea-d50d6d448100
- *
- * Delete a specific Queue Row:
- * DELETE http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/queue/rows/6f4c602c-026f-4390-beea-d50d6d448100
- *
- * Delete a specific Netflow Row:
- * DELETE http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/netflow/rows/6f4c602c-026f-4390-beea-d50d6d448100
- *
- * Delete a specific Manager Row:
- * DELETE http://localhost:8080/ovsdb/nb/v2/node/OVS/HOST1/tables/manager/rows/6f4c602c-026f-4390-beea-d50d6d448100
- * </pre>
- */
-
- @Path("/node/{nodeType}/{nodeId}/tables/{tableName}/rows/{uuid}")
- @DELETE
- @StatusCodes({ @ResponseCode(code = 204, condition = "User Deleted Successfully"),
- @ResponseCode(code = 401, condition = "User not authorized to perform this operation"),
- @ResponseCode(code = 404, condition = "The userName passed was not found"),
- @ResponseCode(code = 500, condition = "Internal Server Error : Removal of user failed"),
- @ResponseCode(code = 503, condition = "Service unavailable") })
- public Response removeRow(@PathParam("nodeType") String nodeType, @PathParam("nodeId") String nodeId,
- @PathParam("tableName") String tableName, @PathParam("uuid") String uuid) {
- if (!NorthboundUtils.isAuthorized(getUserName(), "default", Privilege.WRITE, this)) {
- throw new UnauthorizedException("User is not authorized to perform this operation");
- }
-
- OvsdbConfigurationService
- ovsdbTable = (OvsdbConfigurationService)ServiceHelper.getGlobalInstance(OvsdbConfigurationService.class,
- this);
- if (ovsdbTable == null) {
- throw new ServiceUnavailableException("OVS Configuration Service " + RestMessages.SERVICEUNAVAILABLE.toString());
- }
-
- OvsdbConnectionService
- connectionService = (OvsdbConnectionService)ServiceHelper.getGlobalInstance(OvsdbConnectionService.class, this);
- Node node = connectionService.getNode(nodeId);
- OvsdbClient client = connectionService.getConnection(node).getClient();
- String bckCompatibleTableName = this.getBackwardCompatibleTableName(client, OvsVswitchdSchemaConstants.DATABASE_NAME, tableName);
-
- Status status = ovsdbTable.deleteRow(node, bckCompatibleTableName, uuid);
- if (status.isSuccess()) {
- return Response.noContent().build();
- }
- return NorthboundUtils.getResponse(
- new org.opendaylight.controller.sal.utils.Status(
- org.opendaylight.controller.sal.utils.StatusCode.SUCCESS));
- }
-
- private String getBackwardCompatibleTableName(OvsdbClient client, String databaseName, String tableName) {
- DatabaseSchema dbSchema = client.getDatabaseSchema(databaseName);
- if (dbSchema == null || tableName == null) {
- return tableName;
- }
- for (String dbTableName : dbSchema.getTables()) {
- if (dbTableName.equalsIgnoreCase(tableName)) {
- return dbTableName;
- }
- }
- return tableName;
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2014, 2015 Red Hat, 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
- */
-
-package org.opendaylight.ovsdb.northbound;
-
-import org.opendaylight.controller.northbound.commons.exception.UnauthorizedException;
-import org.opendaylight.controller.northbound.commons.utils.NorthboundUtils;
-import org.opendaylight.controller.sal.authorization.Privilege;
-
-import javax.ws.rs.Path;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.SecurityContext;
-import javax.ws.rs.core.UriInfo;
-
-/**
-* OVSDB Northbound V3 REST API
-*/
-
-@Path("/v3/")
-public class OvsdbNorthboundV3 {
- @Context
- private UriInfo _uriInfo;
- private String username;
-
- @Context
- public void setSecurityContext(SecurityContext context) {
- if (context != null && context.getUserPrincipal() != null) {
- username = context.getUserPrincipal().getName();
- }
- }
-
- protected String getUserName() {
- return username;
- }
-
- @Path("node")
- public NodeResource getNode(){
- if (!NorthboundUtils.isAuthorized(getUserName(), "default", Privilege.WRITE, this)) {
- throw new UnauthorizedException("User is not authorized to perform this operation");
- }
- return new NodeResource();
- }
-
-}
+++ /dev/null
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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
- */
-
-package org.opendaylight.ovsdb.northbound;
-
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.concurrent.ExecutionException;
-
-import org.opendaylight.ovsdb.lib.OvsdbClient;
-import org.opendaylight.ovsdb.lib.notation.Row;
-import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
-import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
-public class OvsdbRow {
- private static final Logger LOG = LoggerFactory.getLogger(OvsdbRow.class);
- private static final String PARENTUUID = "parent_uuid";
- private static final String PARENTTABLE = "parent_table";
- private static final String PARENTCOLUMN = "parent_column";
- private static final String ROW = "row";
-
- private String parentUuid;
- private String parentTable;
- private String parentColumn;
- private String tableName;
- private Row<GenericTableSchema> row;
-
- public OvsdbRow() {
- }
-
- public OvsdbRow(String parentUuid, String tableName, Row<GenericTableSchema> row) {
- this.parentUuid = parentUuid;
- this.tableName = tableName;
- this.row = row;
- }
-
- public OvsdbRow(String parentTable, String parentUuid, String parentColumn, String tableName, Row<GenericTableSchema> row) {
- this.parentTable = parentTable;
- this.parentColumn = parentColumn;
- this.parentUuid = parentUuid;
- this.tableName = tableName;
- this.row = row;
- }
-
- public static OvsdbRow fromJsonNode(OvsdbClient client, String dbName, JsonNode json) {
- JsonNode parentUuidNode = json.get(PARENTUUID);
- String parentUuid = null;
- if (parentUuidNode != null) {
- parentUuid = parentUuidNode.asText();
- }
- JsonNode parentTableNode = json.get(PARENTTABLE);
- String parentTable = null;
- if (parentTableNode != null) {
- parentTable = parentTableNode.asText();
- }
- JsonNode parentColumnNode = json.get(PARENTCOLUMN);
- String parentColumn = null;
- if (parentColumnNode != null) {
- parentColumn = parentColumnNode.asText();
- }
- JsonNode rowNode = json.get(ROW);
- if (rowNode == null) {
- return null;
- }
- Iterator<String> fieldNames = rowNode.fieldNames();
- if (fieldNames.hasNext()) {
- String tableName = fieldNames.next();
- try {
- Row<GenericTableSchema> row = getRow(client, dbName, tableName, rowNode.get(tableName));
- return new OvsdbRow(parentTable, parentUuid, parentColumn, tableName, row);
- } catch (InterruptedException | ExecutionException | IOException e) {
- LOG.error("Error retrieving the row for {}", tableName, e);
- return null;
- }
- }
- return null;
- }
-
- public static Row<GenericTableSchema> getRow(OvsdbClient client, String dbName, String tableName, JsonNode rowJson) throws InterruptedException, ExecutionException, IOException {
- DatabaseSchema dbSchema = client.getSchema(dbName).get();
- GenericTableSchema schema = dbSchema.table(tableName, GenericTableSchema.class);
- return schema.createRow((ObjectNode)rowJson);
- }
-
- public String getParentTable() {
- return parentTable;
- }
-
- public String getParentUuid() {
- return parentUuid;
- }
-
- public String getParentColumn() {
- return parentColumn;
- }
-
- public String getTableName() {
- return tableName;
- }
-
- public Row<GenericTableSchema> getRow() {
- return row;
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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
- */
-
-package org.opendaylight.ovsdb.northbound;
-
-import java.util.Map;
-
-import org.opendaylight.ovsdb.lib.notation.Row;
-
-@Deprecated
-public class OvsdbRows {
- Map<String, Row> rows;
-
- public OvsdbRows(Map<String, Row> rows) {
- super();
- this.rows = rows;
- }
-
- public Map<String, Row> getRows() {
- return rows;
- }
-
- public void setRows(Map<String, Row> rows) {
- this.rows = rows;
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2014, 2015 Red Hat, 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
- */
-
-package org.opendaylight.ovsdb.northbound;
-
-import com.fasterxml.jackson.databind.SerializationFeature;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Map;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.opendaylight.controller.northbound.commons.RestMessages;
-import org.opendaylight.controller.northbound.commons.exception.BadRequestException;
-import org.opendaylight.controller.northbound.commons.exception.ServiceUnavailableException;
-import org.opendaylight.ovsdb.lib.OvsdbClient;
-import org.opendaylight.ovsdb.lib.notation.Row;
-import org.opendaylight.ovsdb.lib.notation.UUID;
-import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
-import org.opendaylight.ovsdb.plugin.api.OvsVswitchdSchemaConstants;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-/**
- * Northbound interface for OVSDB Rows
- */
-public class RowResource {
-
- String nodeId;
- String databaseName;
- String tableName;
- ObjectMapper objectMapper;
-
- public RowResource(String nodeId, String databaseName, String tableName) {
- this.nodeId = nodeId;
- this.databaseName = databaseName;
- this.tableName = tableName;
- objectMapper = new ObjectMapper();
- objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
- }
-
- private OvsdbRow getOvsdbRow (InputStream stream) throws IOException {
- StringBuilder rowNodeStrBuilder = new StringBuilder();
- BufferedReader in = new BufferedReader(new InputStreamReader(stream));
- String line = null;
- while ((line = in.readLine()) != null) {
- rowNodeStrBuilder.append(line);
- }
- JsonNode jsonNode = objectMapper.readTree(rowNodeStrBuilder.toString());
- OvsdbClient client = NodeResource.getOvsdbClient(nodeId, this);
- return OvsdbRow.fromJsonNode(client, OvsVswitchdSchemaConstants.DATABASE_NAME, jsonNode);
- }
-
- @GET
- @Produces(MediaType.APPLICATION_JSON)
- public Response getRows() throws JsonProcessingException {
- OvsdbConfigurationService
- ovsdbTable = (OvsdbConfigurationService)ServiceHelper.getGlobalInstance(OvsdbConfigurationService.class,
- this);
- if (ovsdbTable == null) {
- throw new ServiceUnavailableException("Ovsdb ConfigurationService " + RestMessages.SERVICEUNAVAILABLE.toString());
- }
-
- Node node = NodeResource.getOvsdbNode(nodeId, this);
- Map<UUID,Row<GenericTableSchema>> rows = null;
- try {
- rows = ovsdbTable.getRows(node, databaseName, tableName);
- } catch (Exception e) {
- throw new BadRequestException(e.getMessage());
- }
- String response = objectMapper.writeValueAsString(rows);
- return Response.status(Response.Status.OK)
- .entity(response)
- .build();
- }
-
- @POST
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public Response createRow(InputStream stream) throws IOException {
- OvsdbRow localRow = this.getOvsdbRow(stream);
- if (localRow == null) {
- return Response.status(Response.Status.BAD_REQUEST).build();
- }
- OvsdbConfigurationService
- ovsdbTable = (OvsdbConfigurationService)ServiceHelper.getGlobalInstance(OvsdbConfigurationService.class,
- this);
- if (ovsdbTable == null) {
- throw new ServiceUnavailableException("OVS Configuration Service " + RestMessages.SERVICEUNAVAILABLE.toString());
- }
-
- Node node = NodeResource.getOvsdbNode(nodeId, this);
- Row row = ovsdbTable.insertTree(node, OvsVswitchdSchemaConstants.DATABASE_NAME, tableName,
- localRow.getParentTable(), new UUID(localRow.getParentUuid()), localRow.getParentColumn(),
- localRow.getRow());
- String response = objectMapper.writeValueAsString(row);
- return Response.status(Response.Status.CREATED)
- .entity(response)
- .build();
- }
-
- @GET
- @Path("{id}")
- @Produces(MediaType.APPLICATION_JSON)
- public Response getRowDetails(@PathParam("id") String id) throws JsonProcessingException {
- OvsdbConfigurationService
- ovsdbTable = (OvsdbConfigurationService)ServiceHelper.getGlobalInstance(OvsdbConfigurationService.class,
- this);
- if (ovsdbTable == null) {
- throw new ServiceUnavailableException("Ovsdb ConfigurationService " + RestMessages.SERVICEUNAVAILABLE.toString());
- }
-
- Node node = NodeResource.getOvsdbNode(nodeId, this);
- Row<GenericTableSchema> row = null;
- try {
- row = ovsdbTable.getRow(node, databaseName, tableName, new UUID(id));
- } catch (Exception e) {
- throw new BadRequestException(e.getMessage());
- }
- String response = objectMapper.writeValueAsString(row);
- return Response.status(Response.Status.OK)
- .entity(response)
- .build();
- }
-
- @PUT
- @Path("{id}")
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public Response updateRow(@PathParam("id") String id, InputStream stream) throws IOException{
- OvsdbRow localRow = this.getOvsdbRow(stream);
- if (localRow == null) {
- return Response.status(Response.Status.BAD_REQUEST).build();
- }
- OvsdbConfigurationService ovsdbTable = (OvsdbConfigurationService)ServiceHelper.getGlobalInstance(OvsdbConfigurationService.class,
- this);
- if (ovsdbTable == null) {
- throw new ServiceUnavailableException("OVS Configuration Service " + RestMessages.SERVICEUNAVAILABLE.toString());
- }
-
- Node node = NodeResource.getOvsdbNode(nodeId, this);
- Row<GenericTableSchema> row = ovsdbTable.updateRow(node, databaseName, tableName, new UUID(id), localRow.getRow(), true);
- String response = objectMapper.writeValueAsString(row);
- return Response.status(Response.Status.OK)
- .entity(response)
- .build();
- }
-
- @DELETE
- @Path("{id}")
- @Consumes(MediaType.APPLICATION_JSON)
- public Response deleteRow(@PathParam("id") String id){
- OvsdbConfigurationService
- ovsdbTable = (OvsdbConfigurationService)ServiceHelper.getGlobalInstance(OvsdbConfigurationService.class,
- this);
- if (ovsdbTable == null) {
- throw new ServiceUnavailableException("Ovsdb ConfigurationService " + RestMessages.SERVICEUNAVAILABLE.toString());
- }
-
- Node node = NodeResource.getOvsdbNode(nodeId, this);
- try {
- ovsdbTable.deleteRow(node, databaseName, tableName, new UUID(id));
- } catch (Exception e) {
- throw new BadRequestException(e.getMessage());
- }
- return Response.status(Response.Status.OK)
- .build();
-
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2014, 2015 Red Hat, 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
- */
-
-package org.opendaylight.ovsdb.northbound;
-
-import com.fasterxml.jackson.databind.SerializationFeature;
-import java.util.Set;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.opendaylight.ovsdb.lib.OvsdbClient;
-import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
-import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
-import org.opendaylight.ovsdb.lib.schema.TableSchema;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-/**
- * Northbound interface for OVSDB tables
- */
-public class TableResource {
- ObjectMapper objectMapper;
- String databaseName;
- String nodeId;
-
- TableResource(String nodeId, String databaseName){
- this.nodeId = nodeId;
- this.databaseName = databaseName;
- objectMapper = new ObjectMapper();
- objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
- }
-
- private DatabaseSchema getDatabaseSchema (String databaseName) {
- OvsdbClient client = NodeResource.getOvsdbClient(nodeId, this);
- return client.getDatabaseSchema(databaseName);
- }
-
- @GET
- @Produces(MediaType.APPLICATION_JSON)
- public Response getTables() throws JsonProcessingException {
- DatabaseSchema dbSchema = this.getDatabaseSchema(databaseName);
- if (dbSchema == null) {
- return Response.noContent().build();
- }
- String response = objectMapper.writeValueAsString(dbSchema.getTables());
- return Response.status(Response.Status.OK)
- .entity(response)
- .build();
- }
-
- @GET
- @Path("{name}")
- @Produces(MediaType.APPLICATION_JSON)
- public Response getTableDetails(@PathParam("name") String name) throws JsonProcessingException {
- String csTableName = this.caseSensitiveTableName(databaseName, name);
- DatabaseSchema dbSchema = this.getDatabaseSchema(databaseName);
- if (dbSchema == null) {
- return Response.noContent().build();
- }
- TableSchema<GenericTableSchema> tableSchema = dbSchema.table(csTableName, GenericTableSchema.class);
- String response = objectMapper.writeValueAsString(tableSchema);
- return Response.status(Response.Status.OK)
- .entity(response)
- .build();
- }
-
- @Path("{name}/row")
- public RowResource getDatabaseTables(@PathParam("name") String name){
- return new RowResource(nodeId, databaseName, name);
- }
-
- private String caseSensitiveTableName (String databaseName, String ciTableName) {
- DatabaseSchema dbSchema = this.getDatabaseSchema(databaseName);
- if (dbSchema == null) {
- return ciTableName;
- }
- Set<String> tables = dbSchema.getTables();
- if (tables == null) {
- return ciTableName;
- }
- for (String tableName : tables) {
- if (tableName.equalsIgnoreCase(ciTableName)) {
- return tableName;
- }
- }
- return ciTableName;
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
- version="3.0">
- <servlet>
- <servlet-name>OVSDB</servlet-name>
- <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
- <init-param>
- <param-name>javax.ws.rs.Application</param-name>
- <param-value> org.opendaylight.controller.northbound.commons.NorthboundApplication</param-value>
- </init-param>
- <init-param>
- <param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
- <param-value>true</param-value>
- </init-param>
- <load-on-startup>1</load-on-startup>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>OVSDB</servlet-name>
- <url-pattern>/*</url-pattern>
- </servlet-mapping>
- <filter>
- <filter-name>CorsFilter</filter-name>
- <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
- <init-param>
- <param-name>cors.allowed.origins</param-name>
- <param-value>*</param-value>
- </init-param>
- <init-param>
- <param-name>cors.allowed.methods</param-name>
- <param-value>GET,POST,HEAD,OPTIONS,PUT,DELETE</param-value>
- </init-param>
- <init-param>
- <param-name>cors.allowed.headers</param-name>
- <param-value>Content-Type,X-Requested-With,accept,authorization, origin,Origin,Access-Control-Request-Method,Access-Control-Request-Headers</param-value>
- </init-param>
- <init-param>
- <param-name>cors.exposed.headers</param-name>
- <param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value>
- </init-param>
- <init-param>
- <param-name>cors.support.credentials</param-name>
- <param-value>true</param-value>
- </init-param>
- <init-param>
- <param-name>cors.preflight.maxage</param-name>
- <param-value>10</param-value>
- </init-param>
- </filter>
- <filter-mapping>
- <filter-name>CorsFilter</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
-
- <security-constraint>
- <web-resource-collection>
- <web-resource-name>NB api</web-resource-name>
- <url-pattern>/*</url-pattern>
- <http-method>POST</http-method>
- <http-method>GET</http-method>
- <http-method>PUT</http-method>
- <http-method>PATCH</http-method>
- <http-method>DELETE</http-method>
- <http-method>HEAD</http-method>
- </web-resource-collection>
- <auth-constraint>
- <role-name>System-Admin</role-name>
- <role-name>Network-Admin</role-name>
- </auth-constraint>
- </security-constraint>
-
- <security-role>
- <role-name>System-Admin</role-name>
- </security-role>
- <security-role>
- <role-name>Network-Admin</role-name>
- </security-role>
-
- <login-config>
- <auth-method>BASIC</auth-method>
- <realm-name>opendaylight</realm-name>
- </login-config>
-</web-app>
+++ /dev/null
-/*
- * Copyright (C) 2015 Red Hat, Inc.
- *
- * 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
- *
- * Authors : Sam Hague
- */
-package org.opendaylight.ovsdb.northbound;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.fail;
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.when;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.google.common.collect.Lists;
-import java.util.List;
-import javax.ws.rs.core.Response;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.opendaylight.controller.northbound.commons.exception.ResourceNotFoundException;
-import org.opendaylight.controller.northbound.commons.exception.ServiceUnavailableException;
-import org.opendaylight.ovsdb.plugin.api.Connection;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService;
-import org.opendaylight.ovsdb.plugin.impl.ConnectionServiceImpl;
-import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(ServiceHelper.class)
-public class NodeResourceTest {
- private static final String OVS = "OVS";
- private static final String IDENTIFIER = "192.168.120.31:45001";
- private static final String IDENTIFIER2 = "192.168.120.31:45002";
- private static final String OVS_IDENTIFIER = OVS + "|" + IDENTIFIER;
- private static final String OVS_IDENTIFIER2 = OVS + "|" + IDENTIFIER2;
- private static final String BAD_IDENTIFIER = "BAD" + "|" + IDENTIFIER;
-
- @Test
- public void testGetOvsdbNode () {
- ConnectionServiceImpl connectionService = new ConnectionServiceImpl();
- Connection connection = new Connection(IDENTIFIER, null);
- connectionService.putOvsdbConnection(IDENTIFIER, connection);
-
- PowerMockito.mockStatic(ServiceHelper.class);
- when(ServiceHelper.getGlobalInstance(eq(OvsdbConnectionService.class), anyObject()))
- .thenReturn(null)
- .thenReturn(connectionService)
- .thenReturn(connectionService);
-
- try {
- NodeResource.getOvsdbNode(IDENTIFIER, this);
- fail("Expected an ServiceUnavailableException to be thrown");
- } catch (ServiceUnavailableException e) {
- assertSame(ServiceUnavailableException.class, e.getClass());
- }
-
- try {
- NodeResource.getOvsdbNode(BAD_IDENTIFIER, this);
- fail("Expected an ResourceNotFoundException to be thrown");
- } catch (ResourceNotFoundException e) {
- assertSame(ResourceNotFoundException.class, e.getClass());
- }
-
- Node node = NodeResource.getOvsdbNode(OVS_IDENTIFIER, this);
- assertNotNull("Node " + OVS_IDENTIFIER + " is null", node);
- }
-
- @Test
- public void testGetOvsdbConnection () {
- ConnectionServiceImpl connectionService = new ConnectionServiceImpl();
- Connection connection = new Connection(IDENTIFIER, null);
- connectionService.putOvsdbConnection(IDENTIFIER, connection);
-
- PowerMockito.mockStatic(ServiceHelper.class);
- when(ServiceHelper.getGlobalInstance(eq(OvsdbConnectionService.class), anyObject()))
- .thenReturn(null)
- .thenReturn(connectionService)
- .thenReturn(connectionService);
-
- try {
- NodeResource.getOvsdbConnection(IDENTIFIER, this);
- fail("Expected an ServiceUnavailableException to be thrown");
- } catch (ServiceUnavailableException e) {
- assertSame(ServiceUnavailableException.class, e.getClass());
- }
-
- try {
- NodeResource.getOvsdbConnection(BAD_IDENTIFIER, this);
- fail("Expected an ResourceNotFoundException to be thrown");
- } catch (ResourceNotFoundException e) {
- assertSame(ResourceNotFoundException.class, e.getClass());
- }
-
- Connection testConnection = NodeResource.getOvsdbConnection(IDENTIFIER, this);
- assertNotNull("Connection " + OVS_IDENTIFIER + " is null", testConnection);
- }
-
- @Test
- public void testGetNodes () {
- ConnectionServiceImpl connectionService = new ConnectionServiceImpl();
-
- PowerMockito.mockStatic(ServiceHelper.class);
- when(ServiceHelper.getGlobalInstance(eq(OvsdbConnectionService.class), anyObject()))
- .thenReturn(connectionService)
- .thenReturn(connectionService)
- .thenReturn(connectionService);
-
- NodeResource nodeResource = new NodeResource();
-
- // Check getNodes when there are no nodes
- try {
- Response response = nodeResource.getNodes();
- assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
- assertNotNull("entity should not be null", response.getEntity());
- String id = "";
- List<String> ids = Lists.newArrayList();
- ids.add(id);
- assertEquals("there should be no nodes", ids.toString(), response.getEntity());
- } catch (JsonProcessingException ex) {
- fail("Exception should not have been caught");
- }
-
- // Check getNodes when there is a node
- Connection connection = new Connection(IDENTIFIER, null);
- connectionService.putOvsdbConnection(IDENTIFIER, connection);
-
- try {
- Response response = nodeResource.getNodes();
- assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
- assertNotNull("entity should not be null", response.getEntity());
- String id = "\"" + OVS_IDENTIFIER + "\"";
- List<String> ids = Lists.newArrayList();
- ids.add(id);
- assertEquals(OVS_IDENTIFIER + " should be found", ids.toString(), response.getEntity());
- } catch (JsonProcessingException ex) {
- fail("Exception should not have been caught");
- }
-
- // Check getNodes when there are multiple nodes
- connection = new Connection(IDENTIFIER2, null);
- connectionService.putOvsdbConnection(IDENTIFIER2, connection);
-
- try {
- Response response = nodeResource.getNodes();
- assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
- assertNotNull("entity should not be null", response.getEntity());
- String id = "\"" + OVS_IDENTIFIER + "\"";
- String id2 = "\"" + OVS_IDENTIFIER2 + "\"";
- List<String> ids = Lists.newArrayList();
- ids.add(id);
- ids.add(id2);
- assertEquals(OVS_IDENTIFIER + " and " + OVS_IDENTIFIER2 + " should be found",
- ids.toString().replaceAll("\\s",""), response.getEntity());
- } catch (JsonProcessingException ex) {
- fail("Exception should not have been caught");
- }
- }
-}
+++ /dev/null
-/*
-* Copyright (C) 2014 Red Hat, Inc.
-*
-* 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
-*
-* Authors : Sam Hague
-*/
-package org.opendaylight.ovsdb.northbound;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.fail;
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.security.Principal;
-import javax.ws.rs.core.SecurityContext;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.opendaylight.controller.northbound.commons.exception.UnauthorizedException;
-import org.opendaylight.controller.northbound.commons.utils.NorthboundUtils;
-import org.opendaylight.controller.sal.authorization.Privilege;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(NorthboundUtils.class)
-public class OvsdbNorthboundV3Test {
- private static final String USER = "admin";
-
- @Test
- public void testSetSecurityContext () {
- SecurityContext securityContext = mock(SecurityContext.class);
- Principal principal = mock(Principal.class);
-
- when(securityContext.getUserPrincipal()).thenReturn(null)
- .thenReturn(principal);
- when(principal.getName()).thenReturn(USER);
-
- OvsdbNorthboundV3 ovsdbNorthboundV3 = new OvsdbNorthboundV3();
-
- // Check if SecurityContext is null
- ovsdbNorthboundV3.setSecurityContext(null);
- String userName = ovsdbNorthboundV3.getUserName();
- assertNull(userName);
-
- // Check if user has no Principal
- ovsdbNorthboundV3.setSecurityContext(securityContext);
- userName = ovsdbNorthboundV3.getUserName();
- assertNull(userName);
-
- // Success case
- ovsdbNorthboundV3.setSecurityContext(securityContext);
- userName = ovsdbNorthboundV3.getUserName();
- assertEquals(USER, userName);
- }
-
- @Test
- public void testGetNode () {
- PowerMockito.mockStatic(NorthboundUtils.class);
- when(NorthboundUtils.isAuthorized(anyString(), eq("default"), eq(Privilege.WRITE), anyObject()))
- .thenReturn(false)
- .thenReturn(true);
-
- OvsdbNorthboundV3 ovsdbNorthboundV3 = new OvsdbNorthboundV3();
-
- // Check for unauthorized user
- try {
- NodeResource nodeResource = ovsdbNorthboundV3.getNode();
- fail("Expected an UnauthorizedException to be thrown");
- } catch (UnauthorizedException e) {
- assertSame(UnauthorizedException.class, e.getClass());
- }
-
- // Success case
- NodeResource nodeResource = ovsdbNorthboundV3.getNode();
- assertNotNull(nodeResource);
- }
-}
<url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
</scm>
<properties>
- <skip.integrationtest>true</skip.integrationtest>
<sonar-jacoco-listeners.version>2.4</sonar-jacoco-listeners.version>
<root.directory>${env.PWD}</root.directory>
<sonar.jacoco.itReportPath>${root.directory}/target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
</plugins>
</build>
<profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <properties>
+ <skipITs>true</skipITs>
+ </properties>
+ </profile>
<profile>
<id>integrationtest</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
- <skip.integrationtest>false</skip.integrationtest>
+ <skipITs>false</skipITs>
</properties>
</profile>
</profiles>
portSecurityRule,vmIp.getIpAddress(), write,
Constants.PROTO_PORT_PREFIX_MATCH_PRIORITY);
break;
+ case MatchUtils.ICMP:
+ egressAclIcmp(dpid, segmentationId, attachedMac,
+ portSecurityRule, vmIp.getIpAddress(),write,
+ Constants.PROTO_PORT_PREFIX_MATCH_PRIORITY);
+ break;
default:
LOG.error("programPortSecurityAcl: Protocol not supported", portSecurityRule);
break;
egressAclUdp(dpid, segmentationId, attachedMac,
portSecurityRule, null, write, Constants.PROTO_PORT_PREFIX_MATCH_PRIORITY);
break;
+ case MatchUtils.ICMP:
+ egressAclIcmp(dpid, segmentationId, attachedMac,
+ portSecurityRule, null, write, Constants.PROTO_PORT_PREFIX_MATCH_PRIORITY);
+ break;
default:
LOG.error("programPortSecurityAcl: Protocol not supported", portSecurityRule);
}
syncFlow(flowId, nodeBuilder, matchBuilder, protoPortMatchPriority, write, false);
}
+
+ /**
+ * Creates a egress match with src macaddress. If dest address is specified
+ * destination specific match will be created. Otherwise a match with a
+ * CIDR will be created.
+ * @param dpidLong the dpid
+ * @param segmentationId the segmentation id
+ * @param srcMac the source mac address.
+ * @param portSecurityRule the security rule in the SG
+ * @param dstAddress the source IP address
+ * @param write add or delete
+ * @param protoPortMatchPriority the protocol match priority
+ */
+ private void egressAclIcmp(Long dpidLong, String segmentationId, String srcMac,
+ NeutronSecurityRule portSecurityRule, String dstAddress,
+ boolean write, Integer protoPortMatchPriority) {
+ MatchBuilder matchBuilder = new MatchBuilder();
+ String flowId = "Egress_ICMP" + segmentationId + "_" + srcMac + "_";
+ matchBuilder = MatchUtils.createEtherMatchWithType(matchBuilder,srcMac,null);
+ matchBuilder = MatchUtils.createICMPv4Match(matchBuilder,
+ portSecurityRule.getSecurityRulePortMin().shortValue(),
+ portSecurityRule.getSecurityRulePortMax().shortValue());
+ if (null != dstAddress) {
+ flowId = flowId + dstAddress;
+ matchBuilder = MatchUtils.addRemoteIpPrefix(matchBuilder,null,
+ MatchUtils.iPv4PrefixFromIPv4Address(dstAddress));
+ } else if (null != portSecurityRule.getSecurityRuleRemoteIpPrefix()) {
+ flowId = flowId + portSecurityRule.getSecurityRuleRemoteIpPrefix();
+ matchBuilder = MatchUtils.addRemoteIpPrefix(matchBuilder,null,
+ new Ipv4Prefix(portSecurityRule.getSecurityRuleRemoteIpPrefix()));
+ }
+ String nodeName = Constants.OPENFLOW_NODE_PREFIX + dpidLong;
+ NodeBuilder nodeBuilder = createNodeBuilder(nodeName);
+ syncFlow(flowId, nodeBuilder, matchBuilder, protoPortMatchPriority, write, false);
+
+ }
+
/**
* Creates a egress match with src macaddress. If dest address is specified
* destination specific match will be created. Otherwise a match with a
ingressAclUdp(dpid, segmentationId, attachedMac, portSecurityRule,vmIp.getIpAddress(),
write, Constants.PROTO_PORT_PREFIX_MATCH_PRIORITY);
break;
+ case MatchUtils.ICMP:
+ ingressAclIcmp(dpid, segmentationId, attachedMac, portSecurityRule, vmIp.getIpAddress(),
+ write, Constants.PROTO_PORT_PREFIX_MATCH_PRIORITY);
+ break;
default:
LOG.error("programPortSecurityAcl: Protocol not supported", portSecurityRule);
break;
ingressAclUdp(dpid, segmentationId, attachedMac,
portSecurityRule, null, write, Constants.PROTO_PORT_PREFIX_MATCH_PRIORITY);
break;
+ case MatchUtils.ICMP:
+ ingressAclIcmp(dpid, segmentationId, attachedMac, portSecurityRule, null,
+ write, Constants.PROTO_PORT_PREFIX_MATCH_PRIORITY);
+ break;
default:
LOG.error("programPortSecurityAcl: Protocol not supported", portSecurityRule);
}
}
+ /**
+ * Creates a ingress match to the dst macaddress. If src address is specified
+ * source specific match will be created. Otherwise a match with a CIDR will
+ * be created.
+ * @param dpidLong the dpid
+ * @param segmentationId the segmentation id
+ * @param dstMac the destination mac address.
+ * @param portSecurityRule the security rule in the SG
+ * @param srcAddress the destination IP address
+ * @param write add or delete
+ * @param protoPortMatchPriority the protocol match priority
+ */
+ private void ingressAclIcmp(Long dpidLong, String segmentationId, String dstMac,
+ NeutronSecurityRule portSecurityRule, String srcAddress,
+ boolean write, Integer protoPortMatchPriority) {
+
+ MatchBuilder matchBuilder = new MatchBuilder();
+ FlowBuilder flowBuilder = new FlowBuilder();
+ String flowId = "ingressAclICMP" + segmentationId + "_" + dstMac;
+ matchBuilder = MatchUtils.createEtherMatchWithType(matchBuilder,null,dstMac);
+ matchBuilder = MatchUtils.createICMPv4Match(matchBuilder,
+ portSecurityRule.getSecurityRulePortMin().shortValue(),
+ portSecurityRule.getSecurityRulePortMax().shortValue());
+ if (null != srcAddress) {
+ flowId = flowId + srcAddress;
+ matchBuilder = MatchUtils.addRemoteIpPrefix(matchBuilder,
+ MatchUtils.iPv4PrefixFromIPv4Address(srcAddress), null);
+
+ } else if (null != portSecurityRule.getSecurityRuleRemoteIpPrefix()) {
+ flowId = flowId + portSecurityRule.getSecurityRuleRemoteIpPrefix();
+ matchBuilder = MatchUtils.addRemoteIpPrefix(matchBuilder,
+ new Ipv4Prefix(portSecurityRule.getSecurityRuleRemoteIpPrefix()),null);
+ }
+ String nodeName = Constants.OPENFLOW_NODE_PREFIX + dpidLong;
+ NodeBuilder nodeBuilder = createNodeBuilder(nodeName);
+ flowId = flowId + "_Permit_";
+ syncFlow(flowId, nodeBuilder, matchBuilder, protoPortMatchPriority, write, false);
+ }
+
public void ingressACLTcpSyn(Long dpidLong, String segmentationId, String attachedMac, boolean write,
Integer securityRulePortMin, Integer protoPortMatchPriority) {
verify(commitFuture, times(2)).get();
}
+ /**
+ * Test ICMP add with code, type and CIDR selected.
+ */
+ @Test
+ public void testProgramPortSecurityACLRuleAddIcmp1() throws Exception {
+ when(portSecurityRule.getSecurityRuleProtocol()).thenReturn("icmp");
+ when(portSecurityRule.getSecurityRulePortMax()).thenReturn(50);
+ when(portSecurityRule.getSecurityRulePortMin()).thenReturn(50);
+ when(portSecurityRule.getSecurityRuleRemoteIpPrefix()).thenReturn("0.0.0.0/24");
+
+ egressAclServiceSpy.programPortSecurityAcl(Long.valueOf(1554), "2", MAC_ADDRESS, 124, securityGroup,neutronSrcIpList,true);
+
+ verify(writeTransaction, times(2)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), eq(true));
+ verify(writeTransaction, times(1)).submit();
+ verify(commitFuture, times(1)).get();
+ }
+
+ /**
+ * Test ICMP remove with code, type and CIDR selected.
+ */
+ @Test
+ public void testProgramPortSecurityACLRuleRemoveIcmp1() throws Exception {
+ when(portSecurityRule.getSecurityRuleProtocol()).thenReturn("icmp");
+ when(portSecurityRule.getSecurityRulePortMax()).thenReturn(50);
+ when(portSecurityRule.getSecurityRulePortMin()).thenReturn(50);
+ when(portSecurityRule.getSecurityRuleRemoteIpPrefix()).thenReturn("0.0.0.0/24");
+
+ egressAclServiceSpy.programPortSecurityAcl(Long.valueOf(1554), "2", MAC_ADDRESS, 124, securityGroup,neutronSrcIpList,false);
+
+ verify(writeTransaction, times(1)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
+ verify(writeTransaction, times(1)).submit();
+ verify(commitFuture, times(1)).get();
+ }
+
+ /**
+ * Test ICMP add with code, type and remote SG selected.
+ */
+ @Test
+ public void testProgramPortSecurityACLRuleAddIcmp2() throws Exception {
+ when(portSecurityRule.getSecurityRuleProtocol()).thenReturn("icmp");
+ when(portSecurityRule.getSecurityRulePortMax()).thenReturn(50);
+ when(portSecurityRule.getSecurityRulePortMin()).thenReturn(50);
+ when(portSecurityRule.getSecurityRuleRemoteIpPrefix()).thenReturn("0.0.0.0/24");
+ when(portSecurityRule.getSecurityRemoteGroupID()).thenReturn("85cc3048-abc3-43cc-89b3-377341426ac5");
+
+ egressAclServiceSpy.programPortSecurityAcl(Long.valueOf(1554), "2", MAC_ADDRESS, 124, securityGroup,neutronSrcIpList,true);
+
+ verify(writeTransaction, times(4)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), eq(true));
+ verify(writeTransaction, times(2)).submit();
+ verify(commitFuture, times(2)).get();
+ }
+
+ /**
+ * Test ICMP remove with code, type and remote SG selected.
+ */
+ @Test
+ public void testProgramPortSecurityACLRuleRemoveIcmp2() throws Exception {
+ when(portSecurityRule.getSecurityRuleProtocol()).thenReturn("icmp");
+ when(portSecurityRule.getSecurityRulePortMax()).thenReturn(50);
+ when(portSecurityRule.getSecurityRulePortMin()).thenReturn(50);
+ when(portSecurityRule.getSecurityRuleRemoteIpPrefix()).thenReturn("0.0.0.0/24");
+ when(portSecurityRule.getSecurityRemoteGroupID()).thenReturn("85cc3048-abc3-43cc-89b3-377341426ac5");
+
+ egressAclServiceSpy.programPortSecurityAcl(Long.valueOf(1554), "2", MAC_ADDRESS, 124, securityGroup,neutronSrcIpList,false);
+
+ verify(writeTransaction, times(2)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
+ verify(writeTransaction, times(2)).submit();
+ verify(commitFuture, times(2)).get();
+ }
+
/**
* Test IPv4 invalid ether type test case.
*/
verify(commitFuture, times(2)).get();
}
+ /**
+ * Test ICMP add with code, type and CIDR selected.
+ */
+ @Test
+ public void testProgramPortSecurityACLRuleAddIcmp1() throws Exception {
+ when(portSecurityRule.getSecurityRuleProtocol()).thenReturn("icmp");
+ when(portSecurityRule.getSecurityRulePortMax()).thenReturn(50);
+ when(portSecurityRule.getSecurityRulePortMin()).thenReturn(50);
+ when(portSecurityRule.getSecurityRuleRemoteIpPrefix()).thenReturn("0.0.0.0/24");
+
+ ingressAclServiceSpy.programPortSecurityAcl(Long.valueOf(1554), "2", MAC_ADDRESS, 124, securityGroup,neutronSrcIpList,true);
+
+ verify(writeTransaction, times(2)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), eq(true));
+ verify(writeTransaction, times(1)).submit();
+ verify(commitFuture, times(1)).get();
+ }
+
+ /**
+ * Test ICMP remove with code, type and CIDR selected.
+ */
+ @Test
+ public void testProgramPortSecurityACLRuleRemoveIcmp1() throws Exception {
+ when(portSecurityRule.getSecurityRuleProtocol()).thenReturn("icmp");
+ when(portSecurityRule.getSecurityRulePortMax()).thenReturn(50);
+ when(portSecurityRule.getSecurityRulePortMin()).thenReturn(50);
+ when(portSecurityRule.getSecurityRuleRemoteIpPrefix()).thenReturn("0.0.0.0/24");
+
+ ingressAclServiceSpy.programPortSecurityAcl(Long.valueOf(1554), "2", MAC_ADDRESS, 124, securityGroup,neutronSrcIpList,false);
+
+ verify(writeTransaction, times(1)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
+ verify(writeTransaction, times(1)).submit();
+ verify(commitFuture, times(1)).get();
+ }
+
+ /**
+ * Test ICMP add with code, type and remote SG selected.
+ */
+ @Test
+ public void testProgramPortSecurityACLRuleAddIcmp2() throws Exception {
+ when(portSecurityRule.getSecurityRuleProtocol()).thenReturn("icmp");
+ when(portSecurityRule.getSecurityRulePortMax()).thenReturn(50);
+ when(portSecurityRule.getSecurityRulePortMin()).thenReturn(50);
+ when(portSecurityRule.getSecurityRuleRemoteIpPrefix()).thenReturn("0.0.0.0/24");
+ when(portSecurityRule.getSecurityRemoteGroupID()).thenReturn("85cc3048-abc3-43cc-89b3-377341426ac5");
+
+ ingressAclServiceSpy.programPortSecurityAcl(Long.valueOf(1554), "2", MAC_ADDRESS, 124, securityGroup,neutronSrcIpList,true);
+
+ verify(writeTransaction, times(4)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), eq(true));
+ verify(writeTransaction, times(2)).submit();
+ verify(commitFuture, times(2)).get();
+ }
+
+ /**
+ * Test ICMP remove with code, type and remote SG selected.
+ */
+ @Test
+ public void testProgramPortSecurityACLRuleRemoveIcmp2() throws Exception {
+ when(portSecurityRule.getSecurityRuleProtocol()).thenReturn("icmp");
+ when(portSecurityRule.getSecurityRulePortMax()).thenReturn(50);
+ when(portSecurityRule.getSecurityRulePortMin()).thenReturn(50);
+ when(portSecurityRule.getSecurityRuleRemoteIpPrefix()).thenReturn("0.0.0.0/24");
+ when(portSecurityRule.getSecurityRemoteGroupID()).thenReturn("85cc3048-abc3-43cc-89b3-377341426ac5");
+
+ ingressAclServiceSpy.programPortSecurityAcl(Long.valueOf(1554), "2", MAC_ADDRESS, 124, securityGroup,neutronSrcIpList,false);
+
+ verify(writeTransaction, times(2)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
+ verify(writeTransaction, times(2)).submit();
+ verify(commitFuture, times(2)).get();
+ }
+
/**
* Test IPv4 invalid ether type test case.
*/
</dependency>
</dependencies>
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <properties>
+ <skipITs>true</skipITs>
+ </properties>
+ </profile>
+ <profile>
+ <id>integrationtest</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <properties>
+ <skipITs>false</skipITs>
+ </properties>
+ </profile>
+ </profiles>
</project>
*/
@Override
public int canCreateNetwork(NeutronNetwork network) {
- if (network.isShared()) {
- LOG.error(" Network shared attribute not supported ");
+ if (network.isShared() && !network.getRouterExternal()) {
+ LOG.error("Shared attribute is only supported on external networks");
return HttpURLConnection.HTTP_NOT_ACCEPTABLE;
}
@Override
public int canUpdateNetwork(NeutronNetwork delta,
NeutronNetwork original) {
- if (delta.isShared()) {
- LOG.error(" Network shared attribute not supported ");
+ if (delta.isShared() && !delta.getRouterExternal()) {
+ LOG.error("Shared attribute is only supported on external networks");
return HttpURLConnection.HTTP_NOT_ACCEPTABLE;
}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (C) 2014 Red Hat, 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.ovsdb</groupId>
- <artifactId>commons</artifactId>
- <version>1.4.0-SNAPSHOT</version>
- <relativePath>../commons/parent</relativePath>
- </parent>
-
- <artifactId>plugin-mdsal-adapter</artifactId>
- <version>1.2.1-SNAPSHOT</version>
- <packaging>bundle</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.dependencymanager</artifactId>
- </dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
- <!-- Yang Models -->
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>concepts</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.mdsal</groupId>
- <artifactId>yang-binding</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-common</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>ietf-inet-types</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller.model</groupId>
- <artifactId>model-inventory</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.openflowplugin.model</groupId>
- <artifactId>model-flow-service</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.mdsal.model</groupId>
- <artifactId>yang-ext</artifactId>
- </dependency>
- <!-- Controller Dependencies -->
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-binding-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-common-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.ovsdb</groupId>
- <artifactId>library</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.ovsdb</groupId>
- <artifactId>plugin</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.ovsdb</groupId>
- <artifactId>schema.openvswitch</artifactId>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <version>2.4.0</version>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Import-Package>
- org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.*,
- org.opendaylight.controller.sal.binding.api,
- org.opendaylight.ovsdb.plugin.api,
- org.apache.felix.dm,
- org.slf4j,
- org.eclipse.osgi.framework.console,
- org.osgi.framework,
- javax.net.ssl,
- *
- </Import-Package>
- <Embed-Transitive>true</Embed-Transitive>
- <Bundle-Activator>
- org.opendaylight.ovsdb.plugin.md.Activator
- </Bundle-Activator>
- </instructions>
- <manifestLocation>${project.basedir}/META-INF</manifestLocation>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-maven-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-checkstyle-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.jacoco</groupId>
- <artifactId>jacoco-maven-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-
-</project>
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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
- */
-
-package org.opendaylight.ovsdb.plugin.md;
-
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService;
-import org.opendaylight.ovsdb.plugin.api.OvsdbInventoryListener;
-
-import org.apache.felix.dm.Component;
-
-/**
- * OSGi Bundle Activator for the Neutron providers
- */
-public class Activator extends ComponentActivatorAbstractBase {
- /**
- * Function called when the activator starts just after some
- * initializations are done by the
- * ComponentActivatorAbstractBase.
- */
- @Override
- public void init() {
- }
-
- /**
- * Function called when the activator stops just before the
- * cleanup done by ComponentActivatorAbstractBase.
- *
- */
- @Override
- public void destroy() {
- }
-
- /**
- * Function that is used to communicate to dependency manager the
- * list of known implementations for services inside a container.
- *
- * @return An array containing all the CLASS objects that will be
- * instantiated in order to get an fully working implementation
- * Object
- */
- @Override
- public Object[] getImplementations() {
- Object[] res = {OvsdbBindingAwareProviderImpl.class,
- OvsdbInventoryManager.class };
- return res;
- }
-
- /**
- * Function that is called when configuration of the dependencies
- * is required.
- *
- * @param c dependency manager Component object, used for
- * configuring the dependencies exported and imported
- * @param imp Implementation class that is being configured,
- * needed as long as the same routine can configure multiple
- * implementations
- * @param containerName The containerName being configured, this allow
- * also optional per-container different behavior if needed, usually
- * should not be the case though.
- */
- @Override
- public void configureInstance(Component c, Object imp,
- String containerName) {
-
- if (imp.equals(OvsdbBindingAwareProviderImpl.class)) {
- c.setInterface(OvsdbBindingAwareProvider.class.getName(), null);
- c.add(createServiceDependency()
- .setService(BindingAwareBroker.class)
- .setRequired(true));
- }
-
- if (imp.equals(OvsdbInventoryManager.class)) {
- c.setInterface(OvsdbInventoryListener.class.getName(), null);
- c.add(createServiceDependency()
- .setService(OvsdbBindingAwareProvider.class)
- .setRequired(true));
- c.add(createServiceDependency()
- .setService(OvsdbConfigurationService.class)
- .setRequired(true));
- }
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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
- */
-
-package org.opendaylight.ovsdb.plugin.md;
-
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.sal.binding.api.NotificationService;
-
-/**
- * Created by dave on 01/08/2014.
- */
-public interface OvsdbBindingAwareProvider {
- public DataBroker getDataBroker();
- public NotificationService getNotificationService();
-}
+++ /dev/null
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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
- */
-
-package org.opendaylight.ovsdb.plugin.md;
-
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.sal.binding.api.AbstractBindingAwareProvider;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.controller.sal.binding.api.NotificationService;
-
-import org.apache.felix.dm.Component;
-import org.osgi.framework.BundleContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class OvsdbBindingAwareProviderImpl extends AbstractBindingAwareProvider implements OvsdbBindingAwareProvider {
-
- private DataBroker dataBroker;
- private NotificationProviderService notificationService;
-
- static final Logger logger = LoggerFactory.getLogger(OvsdbBindingAwareProvider.class);
-
- private BundleContext bc;
- private volatile BindingAwareBroker broker;
-
- void init(Component c) {
- this.bc = c.getDependencyManager().getBundleContext();
- broker.registerProvider(this, this.bc);
- logger.info("OVSDB MD-SAL Inventory Adapter Registered With the MD-SAL");
- }
-
- void destroy() {
- this.dataBroker = null;
- this.notificationService = null;
- }
-
- @Override
- public void onSessionInitiated(BindingAwareBroker.ProviderContext providerContext) {
- this.dataBroker = providerContext.getSALService(DataBroker.class);
- this.notificationService = providerContext.getSALService(NotificationProviderService.class);
- }
-
- @Override
- public DataBroker getDataBroker() {
- return this.dataBroker;
- }
-
- @Override
- public NotificationService getNotificationService() {
- return this.notificationService;
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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
- */
-
-package org.opendaylight.ovsdb.plugin.md;
-
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
-import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.utils.HexEncode;
-import org.opendaylight.ovsdb.lib.notation.Row;
-import org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService;
-import org.opendaylight.ovsdb.plugin.api.OvsdbInventoryListener;
-import org.opendaylight.ovsdb.schema.openvswitch.Bridge;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.ovsdb.node.inventory.rev140731.OvsdbCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.ovsdb.node.inventory.rev140731.OvsdbCapableNodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.ovsdb.node.inventory.rev140731.OvsdbManagedNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.ovsdb.node.inventory.rev140731.OvsdbManagedNodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.ovsdb.node.inventory.rev140731.nodes.node.OvsdbBridge;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.ovsdb.node.inventory.rev140731.nodes.node.OvsdbBridgeBuilder;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.net.InetAddress;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.ExecutionException;
-
-/**
- * Handle OVSDB Inventory Updates and create the necessary entries in the MD-SAL config datastore
- */
-public class OvsdbInventoryManager implements OvsdbInventoryListener {
-
- // Dependencies injected by OSGi
- private volatile OvsdbBindingAwareProvider provider;
- private volatile OvsdbConfigurationService ovsdbConfigurationService;
-
- static final String OVS_NODE_PREFIX = "openvswitch:";
- static final String OPENFLOW_NODE_PREFIX = "openflow:";
-
- static final Logger LOGGER = LoggerFactory.getLogger(OvsdbInventoryManager.class);
-
-
- /**
- * Called by the framework when the bundle is started
- */
- public void start() {
- //ToDo: Add existing nodes from inventory
- //This case is required for surviving controller reboot
- }
-
- /**
- * When an AD-SAL node is added by the OVSDB Inventory Service, Add an MD-SAL node
- *
- * @param node The AD-SAL node
- * @param address The {@link java.net.InetAddress} of the Node
- * @param port The ephemeral port number used by this connection
- */
- @Override
- public synchronized void nodeAdded(org.opendaylight.controller.sal.core.Node node,
- InetAddress address,
- int port) {
- DataBroker dataBroker = provider.getDataBroker();
- Preconditions.checkNotNull(dataBroker);
-
- NodeId nodeId = new NodeId(OVS_NODE_PREFIX + node.getNodeIDString());
- NodeKey nodeKey = new NodeKey(nodeId);
-
- OvsdbCapableNode ovsdbNode = new OvsdbCapableNodeBuilder()
- .setIpAddress(Utils.convertIpAddress(address))
- .setPort(new PortNumber(port))
- .setManagedNodes(new ArrayList<NodeId>())
- .build();
-
- Node newNode = new NodeBuilder()
- .setId(nodeId)
- .setKey(nodeKey)
- .addAugmentation(OvsdbCapableNode.class, ovsdbNode)
- .build();
-
- InstanceIdentifier<Node> path = InstanceIdentifier.builder(Nodes.class)
- .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, nodeKey)
- .toInstance();
-
- WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
- tx.put(LogicalDatastoreType.CONFIGURATION, path, newNode, true);
- try {
- tx.submit().get();
- LOGGER.debug("Removed Node {}", path.toString());
- } catch (InterruptedException | ExecutionException e) {
- LOGGER.error(e.getMessage(), e);
- }
- }
-
- /**
- * When an AD-SAL node is removed by the OVSDB Inventory Service, Remove the MD-SAL node
- *
- * @param node The AD-SAL node
- */
- @Override
- public synchronized void nodeRemoved(org.opendaylight.controller.sal.core.Node node) {
- DataBroker dataBroker = provider.getDataBroker();
- Preconditions.checkNotNull(dataBroker);
-
- NodeId nodeId = new NodeId(new NodeId(OVS_NODE_PREFIX + node.getNodeIDString()));
- NodeKey nodeKey = new NodeKey(nodeId);
-
- InstanceIdentifier<Node> path = InstanceIdentifier.builder(Nodes.class)
- .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, nodeKey)
- .toInstance();
-
- WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
- tx.delete(LogicalDatastoreType.CONFIGURATION, path);
- try {
- tx.submit().get();
- LOGGER.debug("Removed Node {}", path.toString());
- } catch (InterruptedException | ExecutionException e) {
- LOGGER.error(e.getMessage(), e);
- }
- }
-
- /**
- * Handle OVSDB row removed When a Bridge row is removed, the OpenFlow Node is deleted The parent OVSDB node is
- * updated and the OpenFlow node removed from it's managed-nodes list
- *
- * @param node The AD-SAL node
- * @param tableName The name of modified table
- * @param uuid The UUID of the deleted row
- * @param row The deleted Row
- */
- @Override
- public synchronized void rowRemoved(org.opendaylight.controller.sal.core.Node node,
- String tableName,
- String uuid,
- Row row,
- Object context) {
- if (tableName.equalsIgnoreCase(ovsdbConfigurationService.getTableName(node, Bridge.class))) {
- LOGGER.debug("OVSDB Bridge Row removed on node {}", node.toString());
- DataBroker dataBroker = provider.getDataBroker();
- Preconditions.checkNotNull(dataBroker);
-
- Bridge bridge = ovsdbConfigurationService.getTypedRow(node, Bridge.class, row);
- Set<String> dpidString = bridge.getDatapathIdColumn().getData();
- Long dpid = HexEncode.stringToLong((String) dpidString.toArray()[0]);
-
- NodeId openflowNodeId = new NodeId(OPENFLOW_NODE_PREFIX + dpid.toString());
- NodeKey openflowNodeKey = new NodeKey(openflowNodeId);
-
- InstanceIdentifier<Node> openflowNodePath = InstanceIdentifier.builder(Nodes.class)
- .child(Node.class, openflowNodeKey)
- .toInstance();
-
- NodeId ovsdbNodeId = new NodeId(OVS_NODE_PREFIX + node.getNodeIDString());
- NodeKey ovsdbNodeKey = new NodeKey(ovsdbNodeId);
-
- InstanceIdentifier<OvsdbCapableNode> ovsdbNodePath = InstanceIdentifier.builder(Nodes.class)
- .child(Node.class, ovsdbNodeKey)
- .augmentation(OvsdbCapableNode.class)
- .toInstance();
-
- // Read the current OVSDB Node from the DataStore
- ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();
- OvsdbCapableNode ovsdbNode;
- try {
- Optional<OvsdbCapableNode> data = tx.read(LogicalDatastoreType.CONFIGURATION, ovsdbNodePath).get();
- if (!data.isPresent()) {
- LOGGER.error("OVSDB node not updated. Parent node for {} does not exist", ovsdbNodePath.toString());
- return;
- }
- ovsdbNode = data.get();
- } catch (InterruptedException | ExecutionException e) {
- LOGGER.error("OVSDB node not updated. Parent node for {} does not exist", ovsdbNodePath.toString());
- return;
- }
-
- // Update the list of Nodes
- List<NodeId> managedNodesList = ovsdbNode.getManagedNodes();
- managedNodesList.remove(openflowNodeId);
-
- // Write changes to DataStore
- OvsdbCapableNode updatedNode = new OvsdbCapableNodeBuilder(ovsdbNode)
- .setManagedNodes(managedNodesList)
- .build();
- tx.delete(LogicalDatastoreType.CONFIGURATION, openflowNodePath);
- tx.put(LogicalDatastoreType.CONFIGURATION, ovsdbNodePath, updatedNode);
-
- try {
- tx.submit().get();
- LOGGER.debug("Transaction success for delete of {} and update of {}",
- openflowNodePath.toString(),
- ovsdbNodePath.toString());
- } catch (InterruptedException | ExecutionException e) {
- LOGGER.error(e.getMessage(), e);
- }
- }
- }
-
- /**
- * Handle OVSDB row updates When a Bridge row is updated and it contains a DPID then add a new OpenFlow node to the
- * inventory A relationship is created between the OpenFlow and OVSDB nodes
- *
- * @param node The AD-SAL node
- * @param tableName The name of the updated table
- * @param uuid The UUID of the updated row
- * @param old The old contents of the row
- * @param row The updated Row
- */
- @Override
- public synchronized void rowUpdated(org.opendaylight.controller.sal.core.Node node,
- String tableName,
- String uuid,
- Row old,
- Row row) {
- LOGGER.debug("OVSDB Bridge Row updated on node {}", node.toString());
- if (tableName.equalsIgnoreCase(ovsdbConfigurationService.getTableName(node, Bridge.class))) {
- DataBroker dataBroker = provider.getDataBroker();
- Bridge bridge = ovsdbConfigurationService.getTypedRow(node, Bridge.class, row);
-
- Set<String> dpidString = bridge.getDatapathIdColumn().getData();
- Long dpid;
- try {
- dpid = HexEncode.stringToLong((String) dpidString.toArray()[0]);
- } catch (ArrayIndexOutOfBoundsException e) {
- return;
- }
-
- NodeId openflowNodeId = new NodeId(OPENFLOW_NODE_PREFIX + dpid.toString());
- NodeKey openflowNodeKey = new NodeKey(openflowNodeId);
-
- InstanceIdentifier<OvsdbManagedNode> openflowNodepath = InstanceIdentifier.builder(Nodes.class)
- .child(Node.class, openflowNodeKey)
- .augmentation(OvsdbManagedNode.class)
- .toInstance();
-
- NodeId ovsdbNodeId = new NodeId(OVS_NODE_PREFIX + node.getNodeIDString());
- NodeKey ovsdbNodeKey = new NodeKey(ovsdbNodeId);
-
- InstanceIdentifier<OvsdbCapableNode> ovsdbNodePath = InstanceIdentifier.builder(Nodes.class)
- .child(Node.class, ovsdbNodeKey)
- .augmentation(OvsdbCapableNode.class)
- .toInstance();
-
- // Create an OvsdbBridge object using the information from the update
- OvsdbBridge ovsdbBridge = new OvsdbBridgeBuilder()
- .setBridgeName(bridge.getName())
- .setBridgeUuid(uuid)
- .setManagedBy(ovsdbNodeId)
- .build();
-
- // Add the bridge to the OvsdbManagedNode
- OvsdbManagedNode ovsdbManagedNode = new OvsdbManagedNodeBuilder()
- .setOvsdbBridge(ovsdbBridge)
- .build();
-
- // Read the current OVSDB Node from the DataStore
- ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();
- OvsdbCapableNode ovsdbNode;
- try {
- Optional<OvsdbCapableNode> data = tx.read(LogicalDatastoreType.CONFIGURATION, ovsdbNodePath).get();
- if (!data.isPresent()) {
- LOGGER.error("OVSDB node not updated. Parent node for {} does not exist", ovsdbNodePath.toString());
- return;
- }
- ovsdbNode = data.get();
- } catch (InterruptedException | ExecutionException e) {
- throw new RuntimeException("Node does not exist");
- }
-
- // Update the list of Nodes
- List<NodeId> managedNodesList = ovsdbNode.getManagedNodes();
- managedNodesList.add(openflowNodeId);
-
- // Create a delta object
- OvsdbCapableNode updatedNode = new OvsdbCapableNodeBuilder(ovsdbNode)
- .setManagedNodes(managedNodesList)
- .build();
-
- // Create parent if we get to this node before openflowplugin
- tx.put(LogicalDatastoreType.CONFIGURATION, openflowNodepath, ovsdbManagedNode, true);
- tx.put(LogicalDatastoreType.CONFIGURATION, ovsdbNodePath, updatedNode);
-
- try {
- tx.submit().get();
- LOGGER.debug("Transaction success for addition of {} and update of {}",
- openflowNodepath.toString(),
- ovsdbNodePath.toString());
- } catch (InterruptedException | ExecutionException e) {
- LOGGER.error(e.getMessage(), e);
- }
- }
- }
-
- @Override
- public synchronized void rowAdded(org.opendaylight.controller.sal.core.Node node,
- String tableName,
- String uuid,
- Row row) {
- // noop
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2013, 2015 Red Hat, 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
- */
-
-package org.opendaylight.ovsdb.plugin.md;
-
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Address;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.net.Inet4Address;
-import java.net.InetAddress;
-
-/**
- * Utilities to convert Java types to the types specified in the Yang models
- */
-public final class Utils {
-
- static final Logger logger = LoggerFactory.getLogger(Utils.class);
-
- /**
- * Returns a {@link org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress}
- * from a @{link java.net.InetAddress}
- */
- public static IpAddress convertIpAddress(InetAddress inetAddress){
-
- if (inetAddress instanceof Inet4Address){
- Ipv4Address ipv4Address = new Ipv4Address(inetAddress.getHostAddress());
- return new IpAddress(ipv4Address);
- }
- else {
- Ipv6Address ipv6Address = new Ipv6Address(inetAddress.getHostAddress());
- return new IpAddress(ipv6Address);
- }
- }
-}
+++ /dev/null
-module ovsdb-node-inventory {
- namespace "urn:opendaylight:ovsdb-node-inventory";
- prefix "ovsdbinv";
-
- import opendaylight-inventory {
- prefix inv;
- revision-date "2013-08-19";
- }
-
- import yang-ext {
- prefix ext;
- revision-date "2013-07-09";
- }
-
- import ietf-inet-types {
- prefix inet;
- revision-date "2010-09-24";
- }
-
- import flow-node-inventory {
- prefix flowcapable;
- revision-date "2013-08-19";
- }
-
- revision "2014-07-31" {
- description "Initial revision of the OVSDB Inventory model";
- }
-
- grouping ovsdb-bridge-attributes {
- leaf bridge-uuid {
- description "The unique identifier of the bridge";
- type string;
- }
-
- leaf bridge-name {
- description "The name of the bridge";
- type string;
- }
-
- leaf managed-by {
- description "The OVSDB which this bridge belongs to";
- type inv:node-id;
- }
- }
-
- grouping ovsdb-node-attributes {
- leaf ip-address {
- description "The IP Address of an OVSDB node";
- type inet:ip-address;
- }
-
- leaf port {
- description "The port that an OVSDB node is connected on";
- type inet:port-number;
- }
-
- leaf-list managed-nodes {
- type inv:node-id;
- }
- }
-
- augment /inv:nodes/inv:node {
- ext:augment-identifier "ovsdb-managed-node";
- // when "/inv:nodes/inv:node/flowcapable:manufacturer = '*'";
- container ovsdb-bridge {
- uses ovsdb-bridge-attributes;
- }
- }
-
- augment /inv:nodes/inv:node {
- ext:augment-identifier "ovsdb-capable-node";
- uses ovsdb-node-attributes;
- }
-
-}
+++ /dev/null
-package org.opendaylight.ovsdb.plugin.md;
-
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-import java.net.Inet4Address;
-import java.net.Inet6Address;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-
-public class UtilsTest {
-
- static final String IPV4_ADDRESS = "10.10.10.10";
- static final String IPV6_ADDRESS = "2001:db8:0:0:0:ff00:42:8329";
-
- @Test
- public void testConvertIpAddress() throws UnknownHostException {
-
- InetAddress addressV4 = Inet4Address.getByName(IPV4_ADDRESS);
- InetAddress addressV6 = Inet6Address.getByName(IPV6_ADDRESS);
-
- IpAddress ipAddresV4 = Utils.convertIpAddress(addressV4);
- IpAddress ipAddresV6 = Utils.convertIpAddress(addressV6);
-
- Assert.assertEquals(IPV4_ADDRESS, ipAddresV4.getIpv4Address().getValue());
- Assert.assertEquals(IPV6_ADDRESS, ipAddresV6.getIpv6Address().getValue());
- }
-}
\ No newline at end of file
<module>karaf</module>
<!-- OVSDB Components -->
<module>southbound</module>
- <module>northbound</module>
<module>openstack</module>
<module>ovsdb-artifacts</module>
<module>schemas</module>
<module>utils</module>
<module>ovsdb-ui</module>
<module>hwvtepsouthbound</module>
- <!-- Integration Tests -->
- <module>integrationtest</module>
</modules>
<build>
+++ /dev/null
-{
- "id": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "name": "OVSDB Northbound APIs",
- "description": "Northbound APIs exposed by ovsdb.northbound bundle",
- "order": [
- "1aaa544a-7d79-3159-84b5-89574ff7f3e2",
- "190627e6-ef20-863f-998b-e019034874c4",
- "d70a4755-d62a-dfcd-e363-dbe931af99a0"
- ],
- "folders": [
- {
- "id": "f0bc8237-daf6-5584-4011-1549618623b5",
- "name": "01 BRIDGE",
- "description": "",
- "order": [
- "085fa6c6-1d5b-8afb-4e4a-56cafe5e8bd0",
- "aed6c263-4d42-ca35-669f-33a00c3d9c82",
- "6f5b8f9a-3e66-16b0-7a16-62a96313eab5",
- "7e41f2e4-6797-64f0-ebd2-b4b634b6a559",
- "2ced04cd-b934-9a0a-576d-8640b6a0b80e"
- ],
- "collection_name": "OVSDB Northbound APIs",
- "collection_id": "b4485302-3406-776b-fb0c-94d74c76dc36"
- },
- {
- "id": "d5c6f3fa-0354-d2db-a2e8-4cb29ade5580",
- "name": "02 PORT",
- "description": "",
- "order": [
- "2990bcf5-976b-413a-f732-9a21d26d2146",
- "618382e3-a833-04d1-f917-c40e70c176cb",
- "39cdc358-7c75-d1cc-34ff-081e74254748",
- "4945fedc-a9c9-5b38-478f-df9ea0d1248a"
- ],
- "collection_name": "OVSDB Northbound APIs",
- "collection_id": "b4485302-3406-776b-fb0c-94d74c76dc36"
- },
- {
- "id": "10aeabc5-bd4b-b64f-31b6-82cbe9c7e9de",
- "name": "03 INTERFACE",
- "description": "",
- "order": [
- "a37af20f-0e43-3fe1-9f3b-c42a264fa3a1",
- "4b21a8b1-1703-bc2c-8716-7dcdab57300a",
- "0753fa84-8a0e-7727-1d45-5b5eb8c74de0"
- ],
- "collection_name": "OVSDB Northbound APIs",
- "collection_id": "b4485302-3406-776b-fb0c-94d74c76dc36"
- },
- {
- "id": "704ce201-08b0-59b4-eba0-c0a22d14d64a",
- "name": "04 CONTROLLER",
- "description": "",
- "order": [
- "7fc7d8cd-244d-58a0-febf-9814729b9422",
- "646be7a5-a484-329a-1039-02b53e1b05fc",
- "d239a9ea-8247-3d47-0d3a-2a1063c0177a"
- ],
- "collection_name": "OVSDB Northbound APIs",
- "collection_id": "b4485302-3406-776b-fb0c-94d74c76dc36"
- },
- {
- "id": "c49bb77a-920b-9653-232b-6a35fae3229f",
- "name": "05 SSL",
- "description": "",
- "order": [
- "3c4a6bb9-30e8-fdf1-1cf3-a3e187537924",
- "6c1b9611-b195-c64c-684f-a639e7ae3946",
- "989d5e9c-47a9-206a-c225-dc0e796f096a"
- ],
- "collection_name": "OVSDB Northbound APIs",
- "collection_id": "b4485302-3406-776b-fb0c-94d74c76dc36"
- },
- {
- "id": "7d339efa-b5a2-ecb5-1639-7c99ab2beb08",
- "name": "06 sFlow",
- "description": "",
- "order": [
- "88f1ec23-5471-97a8-2633-c89c51c20071",
- "9b2eaefc-5cc0-958a-0926-2b18fea54b88",
- "5eab776e-dd13-2a7f-90c3-fabc4d98d481"
- ],
- "collection_name": "OVSDB Northbound APIs",
- "collection_id": "b4485302-3406-776b-fb0c-94d74c76dc36"
- },
- {
- "id": "75c166a9-e5de-c7bd-59b4-20e512c89ef4",
- "name": "07 Qos",
- "description": "",
- "order": [
- "5e1f52b7-3295-9485-377f-6988c401a8cd",
- "d565f3fb-4a9a-3e61-9e8e-87324427c979",
- "40323a39-f07f-695a-2428-e888dd9c7cf1",
- "c3c1dd3a-1f8e-947d-f729-2eef56795fef"
- ],
- "collection_name": "OVSDB Northbound APIs",
- "collection_id": "b4485302-3406-776b-fb0c-94d74c76dc36"
- },
- {
- "id": "ebb04a01-9318-78ba-7d7d-590688434f35",
- "name": "08 Queue",
- "description": "",
- "order": [
- "b1af09ee-f6b9-cddd-9087-6d8dc5b958a4",
- "d32420de-40fd-d407-59c5-e1c3b8ea359c",
- "2d670425-e1ae-c615-1fe1-b27c0ddf4c43",
- "9d887d97-a323-a847-a163-ca6e62ad96fe"
- ],
- "collection_name": "OVSDB Northbound APIs",
- "collection_id": "b4485302-3406-776b-fb0c-94d74c76dc36"
- },
- {
- "id": "dc13be48-4ea4-7d32-63df-d367c6df6e70",
- "name": "09 NetFlow",
- "description": "",
- "order": [
- "c7ab23bd-2d49-71a0-7a40-31ee0f44b2b0",
- "76c04544-3be0-e330-75e1-509919d781f0",
- "f8d9b165-7fa7-e0bd-b634-b45d550a3114"
- ],
- "collection_name": "OVSDB Northbound APIs",
- "collection_id": "b4485302-3406-776b-fb0c-94d74c76dc36"
- },
- {
- "id": "1fe328ce-a0f2-2512-36b2-21c854081873",
- "name": "10 Manager",
- "description": "",
- "order": [
- "3d34de25-8015-98e5-957b-eb3cef69175f",
- "1aaa544a-7d79-3159-84b5-89574ff7f3e2",
- "baab428a-b056-bd23-906d-290933aee25f"
- ],
- "collection_name": "OVSDB Northbound APIs",
- "collection_id": "b4485302-3406-776b-fb0c-94d74c76dc36"
- },
- {
- "id": "40018e32-d0ca-4a2f-5f06-bff5c95382f8",
- "name": "11 IPFIX",
- "description": "",
- "order": [
- "a01a045e-e642-8e39-f2cc-baf37ec5dfc5",
- "485249a8-94d2-b61b-a6b9-addfe8fb1495",
- "8f74bdb1-1f10-69f4-da1d-cd878df784e5"
- ],
- "collection_name": "OVSDB Northbound APIs",
- "collection_id": "b4485302-3406-776b-fb0c-94d74c76dc36"
- }
- ],
- "timestamp": 1384305639019,
- "synced": false,
- "requests": [
- {
- "id": "0753fa84-8a0e-7727-1d45-5b5eb8c74de0",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/interface/rows/45bf1633-1411-4c92-87f8-b1492eed2ff6",
- "data": "",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "dataMode": "raw",
- "method": "DELETE",
- "version": 2,
- "time": 1385442001088,
- "name": "DELETE interface row given UUID",
- "description": "package org.opendaylight.ovsdb.plugin\n\nclass ConfigurationService\n\nMethod: deleteInterfaceRow()",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "085fa6c6-1d5b-8afb-4e4a-56cafe5e8bd0",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/bridge/rows",
- "data": [],
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "dataMode": "params",
- "method": "GET",
- "version": 2,
- "time": 1384863804932,
- "name": "GET all bridge rows",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "190627e6-ef20-863f-998b-e019034874c4",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/open_vswitch/rows",
- "data": [],
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "dataMode": "params",
- "method": "GET",
- "version": 2,
- "time": 1384895597912,
- "name": "GET all open_vswitch rows",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "1aaa544a-7d79-3159-84b5-89574ff7f3e2",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/manager/rows",
- "data": "{\n \"parent_uuid\":\"8d3fb89b-5fac-4631-a990-f5a4e7f5383a\",\n \"row\":{\n \"Manager\":{\n \"target\":\"a_string\",\n \"is_connected\": true,\n \"state\":\"active\"\n }\n }\n}",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "dataMode": "raw",
- "method": "POST",
- "version": 2,
- "time": 1384920841537,
- "name": "INSERT a Manager Row",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "2990bcf5-976b-413a-f732-9a21d26d2146",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/port/rows",
- "data": [],
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "dataMode": "params",
- "method": "GET",
- "version": 2,
- "time": 1384863858721,
- "name": "GET all port rows",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "2ced04cd-b934-9a0a-576d-8640b6a0b80e",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/bridge/rows/66ad493c-23cf-45e7-b5a5-1901fb3165f4",
- "pathVariables": {},
- "method": "PUT",
- "data": "{\n \"row\":{\n \"Bridge\":{\n \"netflow\": [\"55f5d382-17fd-4c42-850d-02c282a67c20\",\"60db8cde-26e6-4bf9-bb08-cd1da68d1fcc\"]\n \n }\n }\n}",
- "dataMode": "raw",
- "version": 2,
- "time": 1386202840003,
- "name": "Update (PUT) Bridge table",
- "description": "Please note that the UUID used here must be one of the existing UUID of a Row in Bridge Table.\n\nAlso the Update must be done ONLY on the fields that needs update. Should NOT send all the immutable fields again. Update will fail in that case.",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "2d670425-e1ae-c615-1fe1-b27c0ddf4c43",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/queue/rows/cd1d39f2-0e8d-4164-a5ab-926329cd1c61",
- "pathVariables": {},
- "method": "DELETE",
- "data": "",
- "dataMode": "raw",
- "version": 2,
- "time": 1386291032110,
- "name": "DELETE a Queue row given a UUID (ROOT TABLE)",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "39cdc358-7c75-d1cc-34ff-081e74254748",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/port/rows/2f93780e-ce56-4cce-9f7c-579be7996651",
- "data": "",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "dataMode": "raw",
- "method": "DELETE",
- "version": 2,
- "time": 1385084358582,
- "name": "DELETE port row given UUID",
- "description": "package org.opendaylight.ovsdb.plugin\n\nclass ConfigurationService\n\nMethod: deletePortRow()",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "3c4a6bb9-30e8-fdf1-1cf3-a3e187537924",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/SSL/rows",
- "pathVariables": {},
- "method": "GET",
- "data": [],
- "dataMode": "params",
- "version": 2,
- "time": 1385766024370,
- "name": "GET all SSL row",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "3d34de25-8015-98e5-957b-eb3cef69175f",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/manager/rows",
- "data": [],
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "dataMode": "params",
- "method": "GET",
- "version": 2,
- "time": 1384920805653,
- "name": "GET all manager rows",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "40323a39-f07f-695a-2428-e888dd9c7cf1",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/qos/rows/739f3929-3a3e-45b1-88ea-afc09df0ca5c",
- "pathVariables": {},
- "method": "DELETE",
- "data": "",
- "dataMode": "raw",
- "version": 2,
- "time": 1386292478840,
- "name": "DELETE a QoS row given a UUID (ROOT TABLE)",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "485249a8-94d2-b61b-a6b9-addfe8fb1495",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/ipfix/rows",
- "pathVariables": {},
- "method": "POST",
- "data": "{\n \"parent_uuid\":\"2e5c0418-e70c-406b-9ad9-58585ac10c19\",\n \"row\":{\n \"IPFIX\":{\n \"targets\":[\n \"set\", [\"192.168.56.1:5555\"]]\n }\n }\n}",
- "dataMode": "raw",
- "name": "Insert a IPFIX row",
- "description": "",
- "descriptionFormat": "html",
- "time": 1396821935199,
- "version": 2,
- "responses": [],
- "tests": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "synced": false
- },
- {
- "id": "4945fedc-a9c9-5b38-478f-df9ea0d1248a",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/port/rows/97a82ec9-e85e-4a48-9b77-ca4a41128b90",
- "pathVariables": {},
- "method": "PUT",
- "data": "{\n \"row\":{\n \"Port\":{\n \"qos\": [\n \"ab2b6f2d-5cb4-4dcf-ac1b-c989ae3d76ce\"\n ]\n }\n }\n}",
- "dataMode": "raw",
- "version": 2,
- "time": 1386208729980,
- "name": "Update Port Table",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "4b21a8b1-1703-bc2c-8716-7dcdab57300a",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/interface/rows",
- "pathVariables": {},
- "method": "POST",
- "data": "{\n \"parent_uuid\":\"ea70e5b1-8b21-4caf-a102-0b85b6c63119\",\n \"row\":{\n \"Interface\":{\n \"name\":\"s1-1125-1\",\n \"mac\":[\"00:00:bb:bb:00:01\"],\n \"admin_state\":\"up\"\n }\n }\n}",
- "dataMode": "raw",
- "version": 2,
- "tests": "",
- "time": 1396829465324,
- "name": "Create row: Interface Table",
- "description": "package org.opendaylight.ovsdb.plugin\npublic class ConfigurationService\n\nMethod: insertInterfaceRow\n",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "5e1f52b7-3295-9485-377f-6988c401a8cd",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/qos/rows",
- "pathVariables": {},
- "method": "GET",
- "data": [],
- "dataMode": "params",
- "version": 2,
- "time": 1385833787440,
- "name": "GET all QoS rows",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "5eab776e-dd13-2a7f-90c3-fabc4d98d481",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/sflow/rows/",
- "pathVariables": {},
- "method": "DELETE",
- "data": "",
- "dataMode": "raw",
- "version": 2,
- "time": 1385832734561,
- "name": "DELETE an sFlow row given a UUID",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "618382e3-a833-04d1-f917-c40e70c176cb",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/port/rows",
- "pathVariables": {},
- "method": "POST",
- "data": "{\n \"parent_uuid\":\"6b3072ba-a120-4db9-82f8-a8ce4eae6942\",\n \"row\":{\n \"Port\":{\n \"name\":\"krb1\",\n \"mac\":[\"00:00:00:00:00:01\"],\n \"tag\":[200]\n }\n }\n}",
- "dataMode": "raw",
- "version": 2,
- "tests": "",
- "time": 1396829482311,
- "name": "Create a Port and add it to a Bridge",
- "description": "Please note that the parent_uuid of this HTTP Data is the UUID of the Bridge that was created in the previous step.\n\nWatch out for the return value which is the UUID of the port that was just created. This UUID must be used as the parent_uuid for the interface addition. Also look out for the HTTP headers that is returned and it has a location field that can be used for both DELETE and UPDATE operations later.\n",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "646be7a5-a484-329a-1039-02b53e1b05fc",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/controller/rows/68e97a9a-9f2c-497a-b39b-7f1e37c30c6f",
- "data": "",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "dataMode": "raw",
- "method": "DELETE",
- "version": 2,
- "time": 1385391658840,
- "name": "DELETE controller row given UUID",
- "description": "package org.opendaylight.ovsdb.plugin\n\nclass ConfigurationService\n\nMethod: deleteControllerRow()",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "6c1b9611-b195-c64c-684f-a639e7ae3946",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/SSL/rows",
- "pathVariables": {},
- "method": "POST",
- "data": "{\n \"row\":{\n \"SSL\":{\n \"name\":\"mySSL\",\n \"ca_cert\" : \"ca_cert\",\n \"bootstrap_ca_cert\" : true,\n \"certificate\":\"pieceofpaper\",\n \"private_key\" : \"private\"\n }\n }\n}\n",
- "dataMode": "raw",
- "version": 2,
- "time": 1385766215625,
- "name": "INSERT an SSL row",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "6f5b8f9a-3e66-16b0-7a16-62a96313eab5",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/bridge/rows",
- "pathVariables": {},
- "method": "POST",
- "data": "{\n \"row\":{\n \"Bridge\":{\n \"name\":\"br25\",\n \"datapath_type\":\"OPENFLOW\"\n }\n }\n}",
- "dataMode": "raw",
- "version": 2,
- "tests": "",
- "time": 1396829500172,
- "name": "Create a Bridge",
- "description": "Watch out for the return value which is the UUID of the bridge that was just created.\nThis UUID must be used as the parent_uuid for the port addition.\n\nAlso look out for the HTTP headers that is returned and it has a location field that can be used for both DELETE and UPDATE operations later.",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "76c04544-3be0-e330-75e1-509919d781f0",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/netflow/rows",
- "pathVariables": {},
- "method": "POST",
- "data": "{\n \"parent_uuid\":\"817d2e33-448d-4f2e-b183-7f835e93922f\",\n \"row\" : {\n \"NetFlow\":{\n \"targets\" : [\n \"set\", [\"192.168.1.102:9998\"]],\n \"active_timeout\" : \"0\"\n }\n } \n}",
- "dataMode": "raw",
- "version": 2,
- "tests": "",
- "time": 1396822912058,
- "name": "INSERT a NetFlow row",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "id": "7e41f2e4-6797-64f0-ebd2-b4b634b6a559",
- "name": "DELETE a Bridge row given UUID",
- "description": "Please note that the UUID used here must be one of the existing UUID of a Row in Bridge Table",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/bridge/rows/45677cc9-bed2-4def-9986-b05a9b59f1f4",
- "method": "DELETE",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "data": "",
- "dataMode": "raw",
- "timestamp": 0,
- "version": 2,
- "time": 1384465149749,
- "synced": false
- },
- {
- "id": "7fc7d8cd-244d-58a0-febf-9814729b9422",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/controller/rows",
- "data": [],
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "dataMode": "params",
- "method": "GET",
- "version": 2,
- "time": 1384898533812,
- "name": "GET all controller rows",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "88f1ec23-5471-97a8-2633-c89c51c20071",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/sflow/rows",
- "pathVariables": {},
- "method": "GET",
- "data": [],
- "dataMode": "params",
- "version": 2,
- "time": 1385832695823,
- "name": "GET all sFlow rows",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "8f74bdb1-1f10-69f4-da1d-cd878df784e5",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/ipfix/rows/715fb52c-63bb-495a-8dca-f3f824fbf8fb",
- "pathVariables": {},
- "method": "DELETE",
- "data": "",
- "dataMode": "raw",
- "version": 2,
- "tests": "",
- "time": 1396823075244,
- "name": "DELETE a IPFIX row given a UUID",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "989d5e9c-47a9-206a-c225-dc0e796f096a",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/SSL/rows/6c2a532c-96df-49ce-8f3f-f83c39e47122",
- "pathVariables": {},
- "method": "DELETE",
- "data": "",
- "dataMode": "raw",
- "version": 2,
- "time": 1385766788123,
- "name": "DELETE an SSL row given a UUID",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "9b2eaefc-5cc0-958a-0926-2b18fea54b88",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/sflow/rows",
- "pathVariables": {},
- "method": "POST",
- "data": "{\n \"parent_uuid\": \"a8c88ae9-fc08-498b-8ec8-2fd86627055d\",\n \"row\": {\n \"sFlow\": {\n \"targets\": [\n \"set\",\n [\n \"targets_string\"\n ]\n ]\n }\n }\n}",
- "dataMode": "raw",
- "version": 2,
- "tests": "",
- "time": 1396827237234,
- "name": "INSERT an sFlow row",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "9d887d97-a323-a847-a163-ca6e62ad96fe",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/qos/rows/ab2b6f2d-5cb4-4dcf-ac1b-c989ae3d76ce",
- "pathVariables": {},
- "method": "PUT",
- "data": "{\n \"row\":{\n \"QoS\":{\n \"queues\": {\n \"1\" : { \"val\": \"0fbe6ced-16cf-4a39-8a79-e7c8c31f63a9\"}\n }\n }\n }\n}",
- "dataMode": "raw",
- "version": 2,
- "time": 1386287453591,
- "name": "UPDATE a queue in QOS",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "a01a045e-e642-8e39-f2cc-baf37ec5dfc5",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/ipfix/rows",
- "pathVariables": {},
- "method": "GET",
- "data": [],
- "dataMode": "params",
- "name": "GET all IPFIX rows",
- "description": "",
- "descriptionFormat": "html",
- "time": 1396821857102,
- "version": 2,
- "responses": [],
- "tests": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "synced": false
- },
- {
- "id": "a37af20f-0e43-3fe1-9f3b-c42a264fa3a1",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/interface/rows",
- "data": [],
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "dataMode": "params",
- "method": "GET",
- "version": 2,
- "time": 1384866802408,
- "name": "GET all interface rows",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "id": "aed6c263-4d42-ca35-669f-33a00c3d9c82",
- "name": "GET a bridge row given a UUID",
- "description": "Please note that the UUID used here must be one of the existing UUID of a Row in Bridge Table",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/bridge/rows/45677cc9-bed2-4def-9986-b05a9b59f1f4",
- "method": "GET",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "data": "",
- "dataMode": "raw",
- "timestamp": 0,
- "version": 2,
- "time": 1384465185771,
- "synced": false
- },
- {
- "id": "b1af09ee-f6b9-cddd-9087-6d8dc5b958a4",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/queue/rows",
- "pathVariables": {},
- "method": "GET",
- "data": [],
- "dataMode": "params",
- "version": 2,
- "time": 1385846165644,
- "name": "GET all Queue rows",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "baab428a-b056-bd23-906d-290933aee25f",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/manager/rows/",
- "pathVariables": {},
- "method": "DELETE",
- "data": "",
- "dataMode": "raw",
- "version": 2,
- "time": 1385866190653,
- "name": "DELETE a Manager row given UUID",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "c3c1dd3a-1f8e-947d-f729-2eef56795fef",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/qos/rows/ab2b6f2d-5cb4-4dcf-ac1b-c989ae3d76ce",
- "pathVariables": {},
- "method": "PUT",
- "data": "{\n \"row\":{\n \"QoS\":{\n \"Queues\": {\n \"queue_value\" : \"5afa70b6-7c74-4972-9d98-874e6307807d\"\n }\n }\n }\n}",
- "dataMode": "raw",
- "version": 2,
- "time": 1386212074539,
- "name": "UPDATE a QoS row ",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "c7ab23bd-2d49-71a0-7a40-31ee0f44b2b0",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/netflow/rows",
- "pathVariables": {},
- "method": "GET",
- "data": [],
- "dataMode": "params",
- "version": 2,
- "time": 1385853862100,
- "name": "GET all NetFlow rows",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "d239a9ea-8247-3d47-0d3a-2a1063c0177a",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/controller/rows",
- "pathVariables": {},
- "method": "POST",
- "data": "{\n \"parent_uuid\" : \"a8c88ae9-fc08-498b-8ec8-2fd86627055d\",\n \"row\" : {\n \t\"Controller\": {\n \"target\": \"1.1.1.1\"\n \t}\n\t}\t\n}",
- "dataMode": "raw",
- "version": 2,
- "tests": "",
- "time": 1396828737787,
- "name": "Add Controller to Bridge",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "d32420de-40fd-d407-59c5-e1c3b8ea359c",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/queue/rows",
- "pathVariables": {},
- "method": "POST",
- "data": "{\n \"parent_uuid\": \"c5f7ce39-847c-4a69-bf8a-2a0181898581\",\n \"row\": {\n \"Queue\": {\n \"dscp\" : [\n \"set\",\n [\n 25\n ]\n ]\n }\n }\n}",
- "dataMode": "raw",
- "version": 2,
- "tests": "",
- "time": 1396828046762,
- "name": "INSERT a Queue row",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "d565f3fb-4a9a-3e61-9e8e-87324427c979",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/qos/rows",
- "pathVariables": {},
- "method": "POST",
- "data": "{\n \"parent_uuid\" : \"b109dbcf-47bb-4121-b244-e623b3421d6e\",\n \"row\" : {\n \t\"QoS\": {\n \"type\": \"linux-htb\"\n \t}\n\t}\t\n}",
- "dataMode": "raw",
- "version": 2,
- "time": 1386291627774,
- "name": "INSERT a QoS row",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "d70a4755-d62a-dfcd-e363-dbe931af99a0",
- "url": "http://{{controllerHost}}:{{controllerPort}}/controller/nb/v2/connectionmanager/node/HOST1/address/192.168.1.102/port/6640/",
- "data": [],
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\n",
- "dataMode": "params",
- "method": "PUT",
- "version": 2,
- "time": 1385493381229,
- "name": "Connect controller to OVSDB server",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- },
- {
- "id": "f8d9b165-7fa7-e0bd-b634-b45d550a3114",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "url": "http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v2/node/OVS/HOST1/tables/netflow/rows/60db8cde-26e6-4bf9-bb08-cd1da68d1fcc",
- "pathVariables": {},
- "method": "DELETE",
- "data": "",
- "dataMode": "raw",
- "version": 2,
- "time": 1386202872294,
- "name": "DELETE a NetFlow row given UUID",
- "description": "",
- "collectionId": "b4485302-3406-776b-fb0c-94d74c76dc36",
- "responses": [],
- "synced": false
- }
- ]
-}
\ No newline at end of file
+++ /dev/null
-{
- "id":"4bc6df66-04c6-f750-e6a4-2518f667f85e",
- "name":"OVSDB Northbound v3 APIs",
- "timestamp":1416933391257,
- "requests":[
- {
- "collectionId":"4bc6df66-04c6-f750-e6a4-2518f667f85e",
- "id":"28f2c9fe-06a8-55fa-eb95-ae6d93fc271e",
- "name":"GET node database table Manager info",
- "description":"",
- "url":"http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v3/node/OVS|192.168.120.31:48161/database/Open_vSwitch/table/Manager",
- "method":"GET",
- "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "data":[
-
- ],
- "dataMode":"params",
- "timestamp":0,
- "responses":[
-
- ],
- "version":2
- },
- {
- "collectionId":"4bc6df66-04c6-f750-e6a4-2518f667f85e",
- "id":"2ceafd22-6467-e29b-f5b9-a947196a365d",
- "name":"GET config",
- "description":"",
- "url":"http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v3/config",
- "method":"GET",
- "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "data":[
-
- ],
- "dataMode":"params",
- "timestamp":0,
- "responses":[
-
- ],
- "version":2
- },
- {
- "collectionId":"4bc6df66-04c6-f750-e6a4-2518f667f85e",
- "id":"31423e07-7f63-cace-1d92-eade985c8058",
- "name":"GET node database table list",
- "description":"",
- "url":"http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v3/node/OVS|192.168.120.31:48161/database/Open_vSwitch/table",
- "method":"GET",
- "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "data":[
-
- ],
- "dataMode":"params",
- "timestamp":0,
- "responses":[
-
- ],
- "version":2
- },
- {
- "collectionId":"4bc6df66-04c6-f750-e6a4-2518f667f85e",
- "id":"52f720c9-424b-f48f-65aa-ef9a9bb29f40",
- "name":"GET node",
- "description":"",
- "url":"http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v3/node/OVS|192.168.120.31:48161",
- "method":"GET",
- "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "data":[
-
- ],
- "dataMode":"params",
- "timestamp":0,
- "responses":[
-
- ],
- "version":2
- },
- {
- "collectionId":"4bc6df66-04c6-f750-e6a4-2518f667f85e",
- "id":"9d327275-fd29-6b72-9ac8-3bbd38c5364d",
- "name":"GET node database list",
- "description":"",
- "url":"http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v3/node/OVS|192.168.120.31:48161/database",
- "method":"GET",
- "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "data":[
-
- ],
- "dataMode":"params",
- "timestamp":0,
- "responses":[
-
- ],
- "version":2
- },
- {
- "collectionId":"4bc6df66-04c6-f750-e6a4-2518f667f85e",
- "id":"9f6858b9-198b-5368-7987-9468354ae06b",
- "name":"GET node database table Open-vSwitch rows uuid",
- "description":"",
- "url":"http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v3/node/OVS|192.168.120.31:48161/database/Open_vSwitch/table/Open_vSwitch/row/626d6b88-821f-474c-9680-2b74dfafdcd1",
- "method":"GET",
- "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "data":[
-
- ],
- "dataMode":"params",
- "timestamp":0,
- "responses":[
-
- ],
- "version":2
- },
- {
- "collectionId":"4bc6df66-04c6-f750-e6a4-2518f667f85e",
- "id":"b8fff80d-cb81-280a-2a88-e0b28d4d23d3",
- "name":"GET node database table Open-vSwitch",
- "description":"",
- "url":"http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v3/node/OVS|192.168.120.31:48161/database/Open_vSwitch/table/Open_vSwitch",
- "method":"GET",
- "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "data":[
-
- ],
- "dataMode":"params",
- "timestamp":0,
- "responses":[
-
- ],
- "version":2
- },
- {
- "collectionId":"4bc6df66-04c6-f750-e6a4-2518f667f85e",
- "id":"c508233b-ed4b-c03d-0446-3e206b513203",
- "name":"GET node database table Open-vSwitch rows",
- "description":"",
- "url":"http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v3/node/OVS|192.168.120.31:48161/database/Open_vSwitch/table/Open_vSwitch/row",
- "method":"GET",
- "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "data":[
-
- ],
- "dataMode":"params",
- "timestamp":0,
- "responses":[
-
- ],
- "version":2
- },
- {
- "collectionId":"4bc6df66-04c6-f750-e6a4-2518f667f85e",
- "id":"d8d420f8-826d-af7e-951b-2d29a51c6033",
- "name":"GET node database info",
- "description":"",
- "url":"http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v3/node/OVS|192.168.120.31:48161/database/Open_vSwitch",
- "method":"GET",
- "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "data":[
-
- ],
- "dataMode":"params",
- "timestamp":0,
- "responses":[
-
- ],
- "version":2
- },
- {
- "collectionId":"4bc6df66-04c6-f750-e6a4-2518f667f85e",
- "id":"e650b8cc-d983-f329-be2e-153a5601e34c",
- "name":"GET all nodes",
- "description":"",
- "url":"http://{{controllerHost}}:{{controllerPort}}/ovsdb/nb/v3/node",
- "method":"GET",
- "headers":"Authorization: Basic YWRtaW46YWRtaW4=\nAccept: application/json\nContent-Type: application/json\n",
- "data":[
-
- ],
- "dataMode":"params",
- "timestamp":0,
- "responses":[
-
- ],
- "version":2
- }
- ]
-}
\ No newline at end of file
Contents
--------
-1. localhost.json.postman_environment : Environment that associates address and port to localhost:8080 in templates for the collections below.
+- localhost.json.postman_environment : Environment that associates address and port to localhost:8080 in templates for the collections below.
-2. Mininet_Demo_OVSDB_OF.json.postman_collection : Collection of REST-APIs used in the Mininet demo (http://www.youtube.com/watch?v=8iWhMVlflwE)
+- Mininet_Demo_OVSDB_OF.json.postman_collection : Collection of REST-APIs used in the Mininet demo (http://www.youtube.com/watch?v=8iWhMVlflwE)
-3. OVSDB_Northbound_APIs.json.postman_collection : Collection of REST-APIs detailing on all the ovsdb.northbound APIs.
+- OVSDB_Southbound.postman_collection : Collection of RESTCONF APIs for using the OVSDB MD-SAL Southbound
-4. OVSDB_Southbound.postman_collection : Collection of RESTCONF APIs for using the OVSDB MD-SAL Southbound
+- Neutron-v2.0-LBaaS-API-Examples_July15.json.postman_collection.txt : Collection of REST-APIs to interact with LBaas pool/pool member/loadbalancer.
-5. Neutron-v2.0-LBaaS-API-Examples_July15.json.postman_collection.txt : Collection of REST-APIs to interact with LBaas pool/pool member/loadbalancer.
-
-6. showOvsdbMdsal.py : Dumps mdsal related info from running ODL that is related to ovsdb and netvirt. Use 'showOvsdbMdsal.py -h' for usage
+- showOvsdbMdsal.py : Dumps mdsal related info from running ODL that is related to ovsdb and netvirt. Use 'showOvsdbMdsal.py -h' for usage
type string;
}
}
-
+
list manager-entry {
description "Node managers info";
config false;
description "Uri that user set to connect to the controller";
type inet:uri;
}
- leaf is-connected {
+ leaf connected {
type boolean;
}
+ leaf number_of_connections {
+ type uint32;
+ }
}
}
base interface-type-base;
}
+ identity qos-type-base {
+ description "the base identity for qos";
+ }
+
+ identity qos-type-linux-htb {
+ description "linux hierarchy token bucket classifier";
+ base qos-type-base;
+ }
+
+ identity qos-type-linux-hfsc {
+ description "linux hierarchical fair service curve classifier";
+ base qos-type-base;
+ }
+
grouping ovsdb-port-interface-attributes {
leaf port-uuid {
description "The unique identifier of the OVSDB port";
mandatory true;
}
}
+
+ list port-qos {
+ leaf qos-uuid {
+ description "The unique identifier of the QoS.";
+ type yang:uuid;
+ }
+ leaf qos-type {
+ type identityref {
+ base qos-type-base;
+ }
+ }
+ list queues {
+ key "queue-key";
+ leaf queue-key {
+ type uint64;
+ }
+ list queue-value {
+ leaf queue-uuid {
+ description "The unique identifier of the queue.";
+ type yang:uuid;
+ }
+ leaf dscp {
+ type uint8;
+ }
+ list queues-other-config {
+ description "
+ Configuration for linux-htb QoS:
+
+ other_config : min-rate optional string
+ containing an integer, at least 1.
+ Minimum guaranteed bandwidth, in bit/s.
+
+ other_config : max-rate optional string
+ containing an integer, at least 1.
+ Maximum allowed bandwidth, in bit/s. Optional. If specified, the queue’s rate will not be allowed
+ to exceed the specified value, even if excess bandwidth is available. If unspecified, defaults to no
+ limit.
+
+ other_config : burst optional string
+ containing an integer, at least 1.
+ Burst size, in bits. This is the maximum amount of ‘‘credits’’ that a queue can accumulate while it
+ is idle. Optional. Details of the linux−htb implementation require a minimum burst size, so a
+ too-small burst will be silently ignored.
+
+ other_config : priority optional string.
+ containing an integer, in range 0 to 4,294,967,295.
+ A queue with a smaller priority will receive all the excess bandwidth that it can use before a
+ queue with a larger value receives any. Specific priority values are unimportant; only relative
+ ordering matters. Defaults to 0 if unspecified.
+
+ Configuration for linux-htb QoS:
+
+ other_config : min-rate optional string
+ containing an integer, at least 1.
+ Minimum guaranteed bandwidth, in bit/s.
+
+ other_config : max-rate optional string
+ containing an integer, at least 1.
+ Maximum allowed bandwidth, in bit/s. Optional. If specified, the queue’s rate will not be allowed
+ to exceed the specified value, even if excess bandwidth is available. If unspecified, defaults to no
+ limit..";
+
+ key "queue-other-config-key";
+ leaf queue-other-config-key {
+ type string;
+ }
+ leaf queue-other-config-value {
+ type string;
+ }
+ }
+ }
+ }
+ list qos-external-ids {
+ key "qos-external-id-key";
+ leaf qos-external-id-key {
+ description "qos external-id name/key";
+ type string;
+ mandatory true;
+ }
+ leaf qos-external-id-value {
+ description "qos-external-id value";
+ type string;
+ mandatory true;
+ }
+ }
+ list qos-other-config {
+ description "
+ other_config : max-rate
+ optional string, containing an integer.";
+
+ key "other-config-key";
+ leaf other-config-key {
+ description "qos-other-config name/key";
+ type string;
+ }
+ leaf other-config-value {
+ description "qos-other-config value";
+ type string;
+ }
+ }
+ }
}
augment "/topo:network-topology/topo:topology/topo:node" {
public void onDataChanged(
AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> changes) {
LOG.trace("onDataChanged: {}", changes);
- for (Entry<InstanceIdentifier<?>, DataObject> created : changes.getCreatedData().entrySet()) {
- // TODO validate we have the correct kind of InstanceIdentifier
- if (created.getValue() instanceof OvsdbNodeAugmentation) {
- OvsdbNodeAugmentation ovsdbNode = (OvsdbNodeAugmentation)created.getValue();
- ConnectionInfo key = ovsdbNode.getConnectionInfo();
- InstanceIdentifier<Node> iid = cm.getInstanceIdentifier(key);
- if ( iid != null) {
- LOG.warn("Connection to device {} already exists. Plugin does not allow multiple connections "
- + "to same device, hence dropping the request {}", key, ovsdbNode);
- return;
- }
- }
- }
// Connect first if we have to:
connect(changes);
for (Entry<InstanceIdentifier<?>, DataObject> created : changes.getCreatedData().entrySet()) {
// TODO validate we have the correct kind of InstanceIdentifier
if (created.getValue() instanceof OvsdbNodeAugmentation) {
- try {
- cm.connect((InstanceIdentifier<Node>) created.getKey(),
- (OvsdbNodeAugmentation) created.getValue());
- } catch (UnknownHostException e) {
- LOG.warn("Failed to connect to ovsdbNode", e);
+ OvsdbNodeAugmentation ovsdbNode = (OvsdbNodeAugmentation)created.getValue();
+ ConnectionInfo key = ovsdbNode.getConnectionInfo();
+ InstanceIdentifier<Node> iid = cm.getInstanceIdentifier(key);
+ if ( iid != null) {
+ LOG.warn("Connection to device {} already exists. Plugin does not allow multiple connections "
+ + "to same device, hence dropping the request {}", key, ovsdbNode);
+ } else {
+ try {
+ cm.connect((InstanceIdentifier<Node>) created.getKey(),
+ (OvsdbNodeAugmentation) created.getValue());
+ } catch (UnknownHostException e) {
+ LOG.warn("Failed to connect to ovsdbNode", e);
+ }
}
}
}
public class SouthboundMapper {
private static final Logger LOG = LoggerFactory.getLogger(SouthboundMapper.class);
+ private static final String N_CONNECTIONS_STR = "n_connections";
private static NodeId createNodeId(OvsdbConnectionInstance client) {
NodeKey key = client.getInstanceIdentifier().firstKeyOf(Node.class, NodeKey.class);
final Manager manager) {
if (manager != null && manager.getTargetColumn() != null) {
+ long numberOfConnections = 0;
final String targetString = (String)manager.getTargetColumn().getData();
+
+ final Map<String, String> statusAttributeMap = manager.getStatusColumn().getData();
+ if (statusAttributeMap.containsKey(N_CONNECTIONS_STR)) {
+ String numberOfConnectionValueStr = statusAttributeMap.get(N_CONNECTIONS_STR);
+ numberOfConnections = Integer.parseInt(numberOfConnectionValueStr);
+ } else {
+ final boolean isConnected = manager.getIsConnectedColumn().getData();
+ if (isConnected) {
+ numberOfConnections = 1;
+ }
+ }
managerEntries.add(new ManagerEntryBuilder()
.setTarget(new Uri(targetString))
- .setIsConnected(manager.getIsConnectedColumn().getData()).build());
+ .setNumberOfConnections(numberOfConnections)
+ .setConnected(manager.getIsConnectedColumn().getData()).build());
}
}
private Map<UUID, OpenVSwitch> oldOpenVSwitchRows;
private Map<UUID, Manager> removedManagerRows;
private Map<UUID, OpenVSwitch> updatedOpenVSwitchRows;
+ private Map<UUID, Manager> updatedManagerRows;
public OvsdbManagersRemovedCommand(OvsdbConnectionInstance key,
TableUpdates updates, DatabaseSchema dbSchema) {
super(key, updates, dbSchema);
updatedOpenVSwitchRows = TyperUtils.extractRowsUpdated(OpenVSwitch.class, getUpdates(), getDbSchema());
oldOpenVSwitchRows = TyperUtils.extractRowsOld(OpenVSwitch.class, getUpdates(), getDbSchema());
+ updatedManagerRows = TyperUtils.extractRowsUpdated(Manager.class, getUpdates(), getDbSchema());
removedManagerRows = TyperUtils.extractRowsRemoved(Manager.class,
getUpdates(), getDbSchema());
}
if (openVSwitch.getManagerOptionsColumn() == null
|| !openVSwitch.getManagerOptionsColumn().getData().contains(managerUuid)) {
Manager manager = removedManagerRows.get(managerUuid);
- if (manager != null && manager.getTargetColumn() != null) {
- InstanceIdentifier<ManagerEntry> iid = ovsdbNodeIid
- .augmentation(OvsdbNodeAugmentation.class)
- .child(ManagerEntry.class,
- new ManagerEntryKey(
- new Uri(manager.getTargetColumn().getData())));
- result.add(iid);
+ if (!checkIfManagerPresentInUpdatedManagersList(manager)) {
+ if (manager != null && manager.getTargetColumn() != null) {
+ InstanceIdentifier<ManagerEntry> iid = ovsdbNodeIid
+ .augmentation(OvsdbNodeAugmentation.class)
+ .child(ManagerEntry.class,
+ new ManagerEntryKey(
+ new Uri(manager.getTargetColumn().getData())));
+ result.add(iid);
+ }
+
}
}
}
return result;
}
+ private boolean checkIfManagerPresentInUpdatedManagersList(Manager removedManager) {
+ for (Map.Entry<UUID, Manager> updatedManager : updatedManagerRows.entrySet()) {
+ if (updatedManager.getValue().getTargetColumn().getData()
+ .equals(removedManager.getTargetColumn().getData())) {
+ return true;
+ }
+ }
+ return false;
+ }
}
import org.opendaylight.ovsdb.southbound.OvsdbConnectionInstance;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ManagedNodeEntry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ManagerEntry;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class OvsdbNodeRemoveCommand extends AbstractTransactionCommand {
private static final Logger LOG = LoggerFactory.getLogger(OvsdbNodeRemoveCommand.class);
+ private static final long ONE_CONNECTED_MANAGER = 1;
+ private static final long ONE_ACTIVE_CONNECTION_IN_PASSIVE_MODE = 1;
public OvsdbNodeRemoveCommand(OvsdbConnectionInstance key,TableUpdates updates,DatabaseSchema dbSchema) {
super(key,updates,dbSchema);
if (ovsdbNodeOptional.isPresent()) {
Node ovsdbNode = ovsdbNodeOptional.get();
OvsdbNodeAugmentation ovsdbNodeAugmentation = ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class);
- if (ovsdbNodeAugmentation != null) {
- if (ovsdbNodeAugmentation.getManagedNodeEntry() != null) {
- for (ManagedNodeEntry managedNode : ovsdbNodeAugmentation.getManagedNodeEntry()) {
- transaction.delete(LogicalDatastoreType.OPERATIONAL, managedNode.getBridgeRef().getValue());
+ if (checkIfOnlyConnectedManager(ovsdbNodeAugmentation)) {
+ if (ovsdbNodeAugmentation != null) {
+ if (ovsdbNodeAugmentation.getManagedNodeEntry() != null) {
+ for (ManagedNodeEntry managedNode : ovsdbNodeAugmentation.getManagedNodeEntry()) {
+ transaction.delete(
+ LogicalDatastoreType.OPERATIONAL, managedNode.getBridgeRef().getValue());
+ }
+ } else {
+ LOG.debug("{} had no managed nodes", ovsdbNode.getNodeId().getValue());
}
} else {
- LOG.debug("{} had no managed nodes", ovsdbNode.getNodeId().getValue());
+ LOG.warn("{} had no OvsdbNodeAugmentation", ovsdbNode.getNodeId().getValue());
}
+ transaction.delete(LogicalDatastoreType.OPERATIONAL,
+ getOvsdbConnectionInstance().getInstanceIdentifier());
} else {
- LOG.warn("{} had no OvsdbNodeAugmentation", ovsdbNode.getNodeId().getValue());
+ LOG.debug("Other southbound plugin instances in cluster are connected to the device,"
+ + " not deleting OvsdbNode form data store.");
}
- transaction.delete(LogicalDatastoreType.OPERATIONAL,
- getOvsdbConnectionInstance().getInstanceIdentifier());
}
} catch (Exception e) {
LOG.warn("Failure to delete ovsdbNode {}",e);
}
}
+ private boolean checkIfOnlyConnectedManager(OvsdbNodeAugmentation ovsdbNodeAugmentation) {
+ ManagerEntry onlyConnectedManager = null;
+ if (ovsdbNodeAugmentation != null) {
+ int connectedManager = 0;
+ for (ManagerEntry manager : ovsdbNodeAugmentation.getManagerEntry()) {
+ if (manager.isConnected()) {
+ connectedManager++;
+ if (connectedManager > ONE_CONNECTED_MANAGER) {
+ return false;
+ }
+ onlyConnectedManager = manager;
+ }
+ }
+ if (connectedManager == 0) {
+ return true;
+ }
+ }
+ /*When switch is listening in passive mode, this number represent number of active connection to the device
+ This is to handle the controller initiated connection scenario, where all the controller will connect, but
+ switch will have only one manager.
+ */
+ if (onlyConnectedManager.getNumberOfConnections().longValue() > ONE_ACTIVE_CONNECTION_IN_PASSIVE_MODE) {
+ return false;
+ }
+ return true;
+ }
}
MemberModifier.suppress(MemberMatcher.method(OvsdbDataChangeListener.class, "disconnect", AsyncDataChangeEvent.class));
MemberModifier.suppress(MemberMatcher.method(OvsdbDataChangeListener.class, "init", AsyncDataChangeEvent.class));
- //iid not null case
- InstanceIdentifier<Node> iid = mock(InstanceIdentifier.class);
- when(cm.getInstanceIdentifier(any(ConnectionInfo.class))).thenReturn(iid);
-
- ovsdbDataChangeListener.onDataChanged(changes);
- verify(changes).getCreatedData();
- verify(ovsdbNode).getConnectionInfo();
- verify(cm).getInstanceIdentifier(any(ConnectionInfo.class));
- PowerMockito.verifyPrivate(ovsdbDataChangeListener, times(0)).invoke("connect", any(AsyncDataChangeEvent.class));
-
//iid null case
when(cm.getInstanceIdentifier(any(ConnectionInfo.class))).thenReturn(null);
ovsdbDataChangeListener.onDataChanged(changes);
<url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
</scm>
<properties>
- <skip.integrationtest>true</skip.integrationtest>
<sonar-jacoco-listeners.version>2.4</sonar-jacoco-listeners.version>
<root.directory>${env.PWD}</root.directory>
<sonar.jacoco.itReportPath>${root.directory}/target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
</plugins>
</build>
<profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <properties>
+ <skipITs>true</skipITs>
+ </properties>
+ </profile>
<profile>
<id>integrationtest</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
- <skip.integrationtest>false</skip.integrationtest>
+ <skipITs>false</skipITs>
</properties>
</profile>
</profiles>
public static final String TCP = "tcp";
public static final String UDP = "udp";
private static final int TCP_SYN = 0x0002;
+ public static final String ICMP = "icmp";
/**
* Create Ingress Port Match dpidLong, inPort