import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
-import com.google.common.collect.ImmutableBiMap;
import com.google.common.collect.Lists;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
-import java.util.Map;
import java.util.Properties;
import java.util.concurrent.atomic.AtomicBoolean;
import org.junit.Assert;
import org.opendaylight.controller.mdsal.it.base.AbstractMdsalTestBase;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
-import org.opendaylight.ovsdb.openstack.netvirt.api.SecurityServicesManager;
import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
-import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.AbstractServiceInstance;
import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.PipelineOrchestrator;
import org.opendaylight.ovsdb.openstack.netvirt.providers.openflow13.Service;
import org.opendaylight.ovsdb.utils.config.ConfigProperties;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.*;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.BridgeExternalIds;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.BridgeOtherConfigs;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ControllerEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ProtocolEntry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ProtocolEntryBuilder;
+
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfo;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfoBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.InterfaceTypeEntryBuilder;
/**
* Test passive connection mode. The southbound starts in a listening mode waiting for connections on port
- * 6640. This test will wait for incoming connections for {@link NetvirtITConstants.CONNECTION_INIT_TIMEOUT} ms.
+ * 6640. This test will wait for incoming connections for {@link NetvirtITConstants#CONNECTION_INIT_TIMEOUT} ms.
*
* @throws InterruptedException
*/
}
private String connectionInfoToString(final ConnectionInfo connectionInfo) {
- return new String(connectionInfo.getRemoteIp().getValue()) + ":" + connectionInfo.getRemotePort().getValue();
+ return String.valueOf(connectionInfo.getRemoteIp().getValue()) + ":" + connectionInfo.getRemotePort().getValue();
}
private boolean addOvsdbNode(final ConnectionInfo connectionInfo) throws InterruptedException {
} else if (tokens[0].equalsIgnoreCase("ptcp")) {
ConnectionInfo connectionInfo = ovsdbNodeAugmentation.getConnectionInfo();
if (connectionInfo != null && connectionInfo.getLocalIp() != null) {
- controllerIpStr = new String(connectionInfo.getLocalIp().getValue());
+ controllerIpStr = String.valueOf(connectionInfo.getLocalIp().getValue());
controllersStr.add(Constants.OPENFLOW_CONNECTION_PROTOCOL
+ ":" + controllerIpStr + ":" + Constants.OPENFLOW_PORT);
} else {
//Assume.assumeTrue(disconnectOvsdbNode(connectionInfo));
}
- private void setManagedBy(final OvsdbBridgeAugmentationBuilder ovsdbBridgeAugmentationBuilder,
- final ConnectionInfo connectionInfo) {
- InstanceIdentifier<Node> connectionNodePath = SouthboundMapper.createInstanceIdentifier(connectionInfo);
- ovsdbBridgeAugmentationBuilder.setManagedBy(new OvsdbNodeRef(connectionNodePath));
- }
-
- private List<ProtocolEntry> createMdsalProtocols() {
- List<ProtocolEntry> protocolList = new ArrayList<>();
- ImmutableBiMap<String, Class<? extends OvsdbBridgeProtocolBase>> mapper =
- SouthboundConstants.OVSDB_PROTOCOL_MAP.inverse();
- protocolList.add(new ProtocolEntryBuilder().
- setProtocol(mapper.get("OpenFlow13")).build());
- return protocolList;
- }
-
private OvsdbTerminationPointAugmentationBuilder createGenericOvsdbTerminationPointAugmentationBuilder() {
OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointAugmentationBuilder =
new OvsdbTerminationPointAugmentationBuilder();
return result;
}
- /*
- * base method for adding test bridges. Other helper methods used to create bridges should utilize this method.
- *
- * @param connectionInfo
- * @param bridgeIid if passed null, one is created
- * @param bridgeName cannot be null
- * @param bridgeNodeId if passed null, one is created based on <code>bridgeIid</code>
- * @param setProtocolEntries toggles whether default protocol entries are set for the bridge
- * @param failMode toggles whether default fail mode is set for the bridge
- * @param setManagedBy toggles whether to setManagedBy for the bridge
- * @param dpType if passed null, this parameter is ignored
- * @param externalIds if passed null, this parameter is ignored
- * @param otherConfig if passed null, this parameter is ignored
- * @return success of bridge addition
- * @throws InterruptedException
- */
- private boolean addBridge(final ConnectionInfo connectionInfo, InstanceIdentifier<Node> bridgeIid,
- final String bridgeName, NodeId bridgeNodeId, final boolean setProtocolEntries,
- final Class<? extends OvsdbFailModeBase> failMode, final boolean setManagedBy,
- final Class<? extends DatapathTypeBase> dpType,
- final List<BridgeExternalIds> externalIds,
- final List<BridgeOtherConfigs> otherConfigs) throws InterruptedException {
-
- NodeBuilder bridgeNodeBuilder = new NodeBuilder();
- if (bridgeIid == null) {
- bridgeIid = SouthboundMapper.createInstanceIdentifier(connectionInfo, new OvsdbBridgeName(bridgeName));
- }
- if (bridgeNodeId == null) {
- bridgeNodeId = SouthboundMapper.createManagedNodeId(bridgeIid);
- }
- bridgeNodeBuilder.setNodeId(bridgeNodeId);
- OvsdbBridgeAugmentationBuilder ovsdbBridgeAugmentationBuilder = new OvsdbBridgeAugmentationBuilder();
- ovsdbBridgeAugmentationBuilder.setBridgeName(new OvsdbBridgeName(bridgeName));
- if (setProtocolEntries) {
- ovsdbBridgeAugmentationBuilder.setProtocolEntry(createMdsalProtocols());
- }
- if (failMode != null) {
- ovsdbBridgeAugmentationBuilder.setFailMode(failMode);
- }
- if (setManagedBy) {
- setManagedBy(ovsdbBridgeAugmentationBuilder, connectionInfo);
- }
- if (dpType != null) {
- ovsdbBridgeAugmentationBuilder.setDatapathType(dpType);
- }
- if (externalIds != null) {
- ovsdbBridgeAugmentationBuilder.setBridgeExternalIds(externalIds);
- }
- if (otherConfigs != null) {
- ovsdbBridgeAugmentationBuilder.setBridgeOtherConfigs(otherConfigs);
- }
- bridgeNodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class, ovsdbBridgeAugmentationBuilder.build());
- LOG.debug("Built with the intent to store bridge data {}",
- ovsdbBridgeAugmentationBuilder.toString());
- boolean result = mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION,
- bridgeIid, bridgeNodeBuilder.build());
- Thread.sleep(OVSDB_UPDATE_TIMEOUT);
- return result;
- }
-
- private boolean addBridge(final ConnectionInfo connectionInfo, final String bridgeName)
- throws InterruptedException {
-
- return addBridge(connectionInfo, null, bridgeName, null, true,
- SouthboundConstants.OVSDB_FAIL_MODE_MAP.inverse().get("secure"), true, null, null, null);
- }
-
- private OvsdbBridgeAugmentation getBridge(ConnectionInfo connectionInfo) {
- return getBridge(connectionInfo, NetvirtITConstants.BRIDGE_NAME);
- }
-
/**
* Extract the <code>store</code> type data store contents for the particular bridge identified by
* <code>bridgeName</code>.
*
- * @param connectionInfo
- * @param bridgeName
+ * @param connectionInfo The connection information.
+ * @param bridgeName The bridge name.
* @param store defined by the <code>LogicalDatastoreType</code> enumeration
* @return <code>store</code> type data store contents
*/
* extract the <code>LogicalDataStoreType.OPERATIONAL</code> type data store contents for the particular bridge
* identified by <code>bridgeName</code>
*
- * @param connectionInfo
- * @param bridgeName
+ * @param connectionInfo The connection information.
+ * @param bridgeName The bridge name.
* @see <code>NetvirtIT.getBridge(ConnectionInfo, String, LogicalDatastoreType)</code>
* @return <code>LogicalDatastoreType.OPERATIONAL</code> type data store contents
*/
* Extract the node contents from <code>store</code> type data store for the
* bridge identified by <code>bridgeName</code>
*
- * @param connectionInfo
- * @param bridgeName
+ * @param connectionInfo The connection information.
+ * @param bridgeName The bridge name.
* @param store defined by the <code>LogicalDatastoreType</code> enumeration
* @return <code>store</code> type data store contents
*/
return mdsalUtils.read(store, bridgeIid);
}
- /**
- * Extract the node contents from <code>LogicalDataStoreType.OPERATIONAL</code> data store for the
- * bridge identified by <code>bridgeName</code>
- *
- * @param connectionInfo
- * @param bridgeName
- * @return <code>LogicalDatastoreType.OPERATIONAL</code> type data store contents
- */
- private Node getBridgeNode(ConnectionInfo connectionInfo, String bridgeName) {
- return getBridgeNode(connectionInfo, bridgeName, LogicalDatastoreType.OPERATIONAL);
- }
-
- private boolean deleteBridge(ConnectionInfo connectionInfo) throws InterruptedException {
- return deleteBridge(connectionInfo, NetvirtITConstants.BRIDGE_NAME);
- }
-
private boolean deleteBridge(final ConnectionInfo connectionInfo, final String bridgeName)
throws InterruptedException {
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.HashSet;
-import java.util.Set;
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.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.DatapathId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.DatapathTypeBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.DatapathTypeSystem;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.InterfaceTypeBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeName;
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.OvsdbNodeAugmentationBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.ProtocolEntry;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfo;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.common.base.Joiner;
import com.google.common.base.Preconditions;
-import com.google.common.base.Splitter;
-import com.google.common.collect.ImmutableBiMap;
public class SouthboundMapper {
private static final Logger LOG = LoggerFactory.getLogger(SouthboundMapper.class);
public static NodeId createNodeId(IpAddress ip, PortNumber port) {
String uriString = SouthboundConstants.OVSDB_URI_PREFIX + "://"
- + new String(ip.getValue()) + ":" + port.getValue();
+ + String.valueOf(ip.getValue()) + ":" + port.getValue();
Uri uri = new Uri(uriString);
return new NodeId(uri);
}
- public static InetAddress createInetAddress(IpAddress ip) throws UnknownHostException {
- if (ip.getIpv4Address() != null) {
- return InetAddress.getByName(ip.getIpv4Address().getValue());
- } else if (ip.getIpv6Address() != null) {
- return InetAddress.getByName(ip.getIpv6Address().getValue());
- } else {
- throw new UnknownHostException("IP Address has no value");
- }
- }
-
- public static DatapathId createDatapathId(Set<String> dpids) {
- Preconditions.checkNotNull(dpids);
- if (dpids.isEmpty()) {
- return null;
- } else {
- String[] dpidArray = new String[dpids.size()];
- dpids.toArray(dpidArray);
- return createDatapathId(dpidArray[0]);
- }
- }
-
- public static String createDatapathType(OvsdbBridgeAugmentation mdsalbridge) {
- String datapathtype = SouthboundConstants.DATAPATH_TYPE_MAP.get(DatapathTypeSystem.class);
-
- if (mdsalbridge.getDatapathType() != null && !mdsalbridge.getDatapathType().equals(DatapathTypeBase.class)) {
- datapathtype = SouthboundConstants.DATAPATH_TYPE_MAP.get(mdsalbridge.getDatapathType());
- if (datapathtype == null) {
- throw new IllegalArgumentException("Unknown datapath type " + mdsalbridge.getDatapathType().getName());
- }
- }
- return datapathtype;
- }
-
- public static Class<? extends DatapathTypeBase> createDatapathType(String type) {
- Preconditions.checkNotNull(type);
- if (type.isEmpty()) {
- return DatapathTypeSystem.class;
- } else {
- ImmutableBiMap<String, Class<? extends DatapathTypeBase>> mapper =
- SouthboundConstants.DATAPATH_TYPE_MAP.inverse();
- return mapper.get(type);
- }
- }
-
- public static DatapathId createDatapathId(String dpid) {
- Preconditions.checkNotNull(dpid);
- DatapathId datapath;
- if (dpid.matches("^[0-9a-fA-F]{16}")) {
- Splitter splitter = Splitter.fixedLength(2);
- Joiner joiner = Joiner.on(":");
- datapath = new DatapathId(joiner.join(splitter.split(dpid)));
- } else {
- datapath = new DatapathId(dpid);
- }
- return datapath;
- }
-
- public static Set<String> createOvsdbBridgeProtocols(OvsdbBridgeAugmentation ovsdbBridgeNode) {
- Set<String> protocols = new HashSet<>();
- if (ovsdbBridgeNode.getProtocolEntry() != null && ovsdbBridgeNode.getProtocolEntry().size() > 0) {
- for (ProtocolEntry protocol : ovsdbBridgeNode.getProtocolEntry()) {
- if (SouthboundConstants.OVSDB_PROTOCOL_MAP.get(protocol.getProtocol()) != null) {
- protocols.add(SouthboundConstants.OVSDB_PROTOCOL_MAP.get(protocol.getProtocol()));
- } else {
- throw new IllegalArgumentException("Unknown protocol " + protocol.getProtocol());
- }
- }
- }
- return protocols;
- }
-
public static Class<? extends InterfaceTypeBase> createInterfaceType(String type) {
Preconditions.checkNotNull(type);
return SouthboundConstants.OVSDB_INTERFACE_TYPE_MAP.get(type);
}
-
- public static String createOvsdbInterfaceType(Class<? extends InterfaceTypeBase> mdsaltype) {
- Preconditions.checkNotNull(mdsaltype);
- ImmutableBiMap<Class<? extends InterfaceTypeBase>, String> mapper =
- SouthboundConstants.OVSDB_INTERFACE_TYPE_MAP.inverse();
- return mapper.get(mdsaltype);
- }
}
import org.opendaylight.ovsdb.openstack.netvirt.sfc.ISfcClassifierService;
import org.opendaylight.ovsdb.openstack.netvirt.sfc.NshUtils;
import org.opendaylight.ovsdb.openstack.netvirt.sfc.SfcUtils;
-import org.opendaylight.ovsdb.southbound.SouthboundConstants;
import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
import org.opendaylight.ovsdb.utils.servicehelper.ServiceHelper;
import org.opendaylight.sfc.provider.api.SfcProviderRenderedPathAPI;
import org.opendaylight.sfc.provider.api.SfcProviderServiceForwarderAPI;
import org.opendaylight.sfc.provider.api.SfcProviderServiceFunctionAPI;
-import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SfName;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sl.rev140701.data.plane.locator.locator.type.Ip;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.rsp.rev140701.CreateRenderedPathInput;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.rsp.rev140701.CreateRenderedPathInputBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.Acl;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.Ace;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev150317.access.lists.acl.access.list.entries.ace.Matches;
-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.opendaylight.params.xml.ns.yang.netvirt.sfc.acl.rev150105.RedirectToSfc;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.classifier.rev150105.Classifiers;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.netvirt.sfc.classifier.rev150105.classifiers.Classifier;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
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.OvsdbTerminationPointAugmentation;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.Options;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint;
import org.osgi.framework.ServiceReference;
private volatile Southbound southbound;
private volatile ISfcClassifierService sfcClassifierService;
private static final short SFC_TABLE = 150;
- private static final int GPE_PORT = 6633;
- private static final String NETWORK_TYPE_VXLAN = "vxlan";
private MdsalUtils mdsalUtils;
private SfcUtils sfcUtils;
private static final String VXGPE = "vxgpe";
- private static final String TUNNEL_DST = "192.168.120.31";
- private static final String TUNNEL_VNID = "10";
public static final String TUNNEL_ENDPOINT_KEY = "local_ip";
public NetvirtSfcWorkaroundOF13Provider(final DataBroker dataBroker, MdsalUtils mdsalUtils, SfcUtils sfcUtils) {
handleRenderedServicePath(rsp, entry);
}
- private void handleRenderedServicePathOld(RenderedServicePath rsp, Ace entry) {
- LOG.info("handleRenderedServicePath: RSP: {}", rsp);
-
- Matches matches = entry.getMatches();
- if (matches == null) {
- LOG.warn("processAclEntry: matches not found");
- return;
- }
-
- List<RenderedServicePathHop> pathHopList = rsp.getRenderedServicePathHop();
- if (pathHopList.isEmpty()) {
- LOG.warn("handleRenderedServicePath: RSP {} has empty hops!!", rsp.getName());
- return;
- }
- LOG.info("handleRenderedServicePath: pathHopList: {}", pathHopList);
-
- final List<Node> bridgeNodes = nodeCacheManager.getBridgeNodes();
- if (bridgeNodes == null || bridgeNodes.isEmpty()) {
- LOG.warn("handleRenderedServicePath: There are no bridges to process");
- return;
- }
- for (Node bridgeNode : bridgeNodes) {
- OvsdbBridgeAugmentation ovsdbBridgeAugmentation = southbound.getBridge(bridgeNode, "br-int");
- if (ovsdbBridgeAugmentation == null) {
- continue;
- }
- long vxGpeOfPort = getOFPort(bridgeNode, VXGPE);
- if (vxGpeOfPort == 0L) {
- LOG.warn("programAclEntry: Could not identify tunnel port {} -> OF ({}) on {}",
- VXGPE, vxGpeOfPort, bridgeNode);
- continue;
- }
- long dataPathId = southbound.getDataPathId(bridgeNode);
- if (dataPathId == 0L) {
- LOG.warn("programAclEntry: Could not identify datapathId on {}", bridgeNode);
- continue;
- }
-
- // Find the first Hop within an RSP.
- // The classifier flow needs to send all matched traffic to this first hop SFF.
- RenderedServicePathFirstHop firstRspHop = SfcProviderRenderedPathAPI
- .readRenderedServicePathFirstHop(rsp.getName());
-
- LOG.info("handleRenderedServicePath: firstRspHop: {}", firstRspHop);
- LOG.debug("handleRenderedServicePath: First Hop IPAddress = {}, Port = {}",
- firstRspHop.getIp().getIpv4Address().getValue(),
- firstRspHop.getPort().getValue());
-
- NshUtils nshHeader = new NshUtils();
- nshHeader.setNshMetaC1(NshUtils.convertIpAddressToLong(new Ipv4Address(TUNNEL_DST)));
- nshHeader.setNshMetaC2(Long.parseLong(TUNNEL_VNID)); // get from register //get from
- nshHeader.setNshNsp(rsp.getPathId());
-
- RenderedServicePathHop firstHop = pathHopList.get(0);
- RenderedServicePathHop lastHop = pathHopList.get(pathHopList.size()-1);
- ServiceFunction serviceFunction =
- SfcProviderServiceFunctionAPI.readServiceFunction(
- SfName.getDefaultInstance(firstHop.getServiceFunctionName().getValue()));
- if (serviceFunction == null) {
- LOG.warn("programAclEntry: Could not identify ServiceFunction {} on {}",
- firstHop.getServiceFunctionName().getValue(), bridgeNode);
- continue;
- }
-
- nshHeader.setNshNsi(firstHop.getServiceIndex());
- // workaround: bypass sff and got directly to sf
- //nshHeader.setNshTunIpDst(firstRspHop.getIp().getIpv4Address());
- IpAddress sfIpAddress = sfcUtils.getSfIpAddress(serviceFunction);
- String sfDplName = sfcUtils.getSfDplName(serviceFunction);
- //sfcUtils.getSfIp(firstHop.getServiceFunctionName().getValue());
- nshHeader.setNshTunIpDst(sfIpAddress.getIpv4Address());
- nshHeader.setNshTunUdpPort(firstRspHop.getPort());
- LOG.debug("handleRenderedServicePath: NSH Header = {}", nshHeader);
-
- sfcClassifierService.programIngressClassifier(dataPathId, entry.getRuleName(), matches,
- nshHeader, vxGpeOfPort, true);
-
- sfcClassifierService.program_sfEgress(dataPathId, GPE_PORT, true);
- long sfOfPort = getSfPort(bridgeNode, sfDplName);
-
- String sfMac = getMacFromExternalIds(bridgeNode, sfDplName);
- String sfIpString = new String(sfIpAddress.getValue());
- LOG.info("handleRenderedServicePath: sfDplName: {}, sfMac: {}, sfOfPort: {}, sfIpAddress: {}",
- sfDplName, sfMac, sfOfPort, sfIpString);
- if (sfMac != null) { // install if the sf is on this bridge, expand when using multiple bridges
- sfcClassifierService.program_sfIngress(dataPathId, GPE_PORT, sfOfPort, sfIpString, sfDplName, true);
- sfcClassifierService.programStaticArpEntry(dataPathId, 0L, sfMac, sfIpString, true);
- }
-
- short lastServiceindex = (short)((lastHop.getServiceIndex()).intValue() - 1);
- sfcClassifierService.programEgressClassifier(dataPathId, vxGpeOfPort, rsp.getPathId(),
- lastServiceindex, sfOfPort, 0, true);
- sfcClassifierService.programEgressClassifierBypass(dataPathId, vxGpeOfPort, rsp.getPathId(),
- lastServiceindex, sfOfPort, 0, true);
-
- sfcClassifierService.programSfcTable(dataPathId, vxGpeOfPort, SFC_TABLE, true);
- }
- }
-
private void handleRenderedServicePath(RenderedServicePath rsp, Ace entry) {
LOG.info("handleRenderedServicePath: RSP: {}", rsp);
return rsp;
}
- // loop through all ports looking for vxlan types, skip vxgpe, keep the rest
- // first pass we only have two tunnels: one for normal vxlan and the other for gpe
- // so just return the first non-gpe vxlan port
- private long getTunnelOfPort(Node bridgeNode, String vxGpePortName) {
- long port = 0L;
- List<OvsdbTerminationPointAugmentation> ovsdbTerminationPointAugmentations =
- southbound.getTerminationPointsOfBridge(bridgeNode);
- if (!ovsdbTerminationPointAugmentations.isEmpty()) {
- for (OvsdbTerminationPointAugmentation terminationPointAugmentation :
- ovsdbTerminationPointAugmentations) {
- if (terminationPointAugmentation.getInterfaceType() ==
- SouthboundConstants.OVSDB_INTERFACE_TYPE_MAP.get(NETWORK_TYPE_VXLAN)) {
- if (!terminationPointAugmentation.getName().equals(vxGpePortName)) {
- port = terminationPointAugmentation.getOfport();
- break;
- }
- }
- }
- }
- return port;
- }
-
private long getSfPort(Node bridgeNode, String sfPortName) {
- long port = 0L;
- port = getOFPort(bridgeNode, sfPortName);
- return port;
+ return getOFPort(bridgeNode, sfPortName);
}
private long getOFPort(Node bridgeNode, String portName) {
if (ofPort == 0L) {
for (int i = 0; i < 5; i++) {
LOG.info("Looking for ofPort {}, try: {}", portName, i);
- if (ofPort == 0L) {
- TerminationPoint tp = southbound.readTerminationPoint(bridgeNode, null, portName);
- if (tp != null) {
- port = tp.getAugmentation(OvsdbTerminationPointAugmentation.class);
- if (port != null) {
- ofPort = southbound.getOFPort(port);
- break;
- }
+ TerminationPoint tp = southbound.readTerminationPoint(bridgeNode, null, portName);
+ if (tp != null) {
+ port = tp.getAugmentation(OvsdbTerminationPointAugmentation.class);
+ if (port != null) {
+ ofPort = southbound.getOFPort(port);
+ break;
}
}
try {
return ofPort;
}
- private String getMacFromOptions(Node bridgeNode, String portName) {
- String mac = null;
- OvsdbTerminationPointAugmentation port = southbound.extractTerminationPointAugmentation(bridgeNode, portName);
- LOG.info("getMac: portName: {}, bridgeNode: {},,, port: {}", portName, bridgeNode, port);
- if (port != null && port.getOptions() != null) {
- //mac = southbound.getOptionsValue(port.getOptions(), EXTERNAL_ID_VM_MAC);
- for (Options option : port.getOptions()) {
- LOG.info("getMac: option: {}", option);
- if (option.getOption().equals(Constants.EXTERNAL_ID_VM_MAC)) {
- mac = option.getValue();
- break;
- }
- }
- }
- return mac;
- }
-
private String getMacFromExternalIds(Node bridgeNode, String portName) {
String mac = null;
OvsdbTerminationPointAugmentation port = southbound.getTerminationPointOfBridge(bridgeNode, portName);
}
- //private AtomicLong flowCookieInc = new AtomicLong(0x1L);
private BigInteger getCookie(FlowID flowID) {
- String cookieString = new String().format("1110%02d%010d", flowID.value, cookieIndex++);
- //new String().format("1100%02d00%04d", flowID.value, flowCookieInc.getAndIncrement());
- // "1100%02000000d%04d"
+ String cookieString = String.format("1110%02d%010d", flowID.value, cookieIndex++);
return new BigInteger(cookieString, 16);
}
if (write) {
InstructionsBuilder isb = new InstructionsBuilder();
List<Instruction> instructions = Lists.newArrayList();
- InstructionBuilder ib = new InstructionBuilder();
-
- /*List<Action> actionList = Lists.newArrayList();
-
- ActionBuilder ab = new ActionBuilder();
- ab.setAction(ActionUtils.nxMoveNshc2ToTunId());
- ab.setOrder(0);
- ab.setKey(new ActionKey(0));
- actionList.add(ab.build());
-
- ApplyActionsBuilder aab = new ApplyActionsBuilder();
- aab.setAction(actionList);
- ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
- ib.setOrder(instructions.size());
- ib.setKey(new InstructionKey(instructions.size()));
- instructions.add(ib.build());*/
-
- ib = InstructionUtils.createGotoTableInstructions(new InstructionBuilder(), getTable());
+ InstructionBuilder ib = InstructionUtils.createGotoTableInstructions(new InstructionBuilder(), getTable());
ib.setOrder(instructions.size());
ib.setKey(new InstructionKey(instructions.size()));
instructions.add(ib.build());
flowBuilder.setCookie(new FlowCookie(getCookie(FlowID.FLOW_SFARP)));
flowBuilder.setCookieMask(new FlowCookie(getCookie(FlowID.FLOW_SFARP)));
- if (write == true) {
+ if (write) {
InstructionBuilder ib = new InstructionBuilder();
InstructionsBuilder isb = new InstructionsBuilder();
List<Instruction> instructions = Lists.newArrayList();
// Build the Actions to Add the NSH Header
org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nshC1Load =
ActionUtils.nxLoadNshc1RegAction(header.getNshMetaC1());
- org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nshC2Load =
- ActionUtils.nxLoadNshc2RegAction(header.getNshMetaC2());
org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nspLoad =
ActionUtils.nxSetNspAction(header.getNshNsp());
org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action nsiLoad =
int count = actionList.size();
actionList.add(new ActionBuilder()
.setKey(new ActionKey(count)).setOrder(count++).setAction(nshC1Load).build());
- //actionList.add(new ActionBuilder()
- // .setKey(new ActionKey(count)).setOrder(count++).setAction(nshC2Load).build());
actionList.add(new ActionBuilder()
.setKey(new ActionKey(count)).setOrder(count++).setAction(nspLoad).build());
actionList.add(new ActionBuilder()
if (matches.getAceType() instanceof AceIp) {
AceIp aceIp = (AceIp)matches.getAceType();
if (aceIp.getAceIpVersion() instanceof AceIpv4) {
- //AceIpv4 aceIpv4 = (AceIpv4) aceIp.getAceIpVersion();
- //MatchUtils.createSrcL3IPv4Match(matchBuilder, aceIpv4.getSourceIpv4Network());
- //MatchUtils.createDstL3IPv4Match(matchBuilder, aceIpv4.getDestinationIpv4Network());
MatchUtils.createIpProtocolMatch(matchBuilder, aceIp.getProtocol());
MatchUtils.addLayer4Match(matchBuilder, aceIp.getProtocol().intValue(), 0,
- aceIp.getDestinationPortRange().getLowerPort().getValue().intValue());
+ aceIp.getDestinationPortRange().getLowerPort().getValue());
} else {
MatchUtils.createIpProtocolMatch(matchBuilder, aceIp.getProtocol());
MatchUtils.addLayer4Match(matchBuilder, aceIp.getProtocol().intValue(), 0,
- aceIp.getDestinationPortRange().getLowerPort().getValue().intValue());
+ aceIp.getDestinationPortRange().getLowerPort().getValue());
}
} else if (matches.getAceType() instanceof AceEth) {
AceEth aceEth = (AceEth) matches.getAceType();
} else if (tokens[0].equalsIgnoreCase("ptcp")) {
ConnectionInfo connectionInfo = ovsdbNodeAugmentation.getConnectionInfo();
if (connectionInfo != null && connectionInfo.getLocalIp() != null) {
- controllerIpStr = new String(connectionInfo.getLocalIp().getValue());
+ controllerIpStr = String.valueOf(connectionInfo.getLocalIp().getValue());
controllersStr.add(Constants.OPENFLOW_CONNECTION_PROTOCOL
+ ":" + controllerIpStr + ":" + Constants.OPENFLOW_PORT);
} else {
protected abstract T toMd(String uuid);
- protected <T extends org.opendaylight.yangtools.yang.binding.DataObject> T readMd(InstanceIdentifier<T> path) {
- T result = null;
+ protected <B extends org.opendaylight.yangtools.yang.binding.DataObject> B readMd(InstanceIdentifier<B> path) {
+ B result = null;
final ReadOnlyTransaction transaction = getDataBroker().newReadOnlyTransaction();
- CheckedFuture<Optional<T>, ReadFailedException> future = transaction.read(LogicalDatastoreType.CONFIGURATION, path);
+ CheckedFuture<Optional<B>, ReadFailedException> future = transaction.read(LogicalDatastoreType.CONFIGURATION, path);
if (future != null) {
- Optional<T> optional;
try {
- optional = future.checkedGet();
- if (optional.isPresent()) {
- result = optional.get();
- }
+ result = future.checkedGet().orNull();
} catch (ReadFailedException e) {
LOGGER.warn("Failed to read {}", path, e);
}
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.odlparent</groupId>
+ <artifactId>odlparent-lite</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
<groupId>org.opendaylight.ovsdb</groupId>
<artifactId>ovsdb-artifacts</artifactId>
<version>1.2.1-SNAPSHOT</version>
"6e7c88e4-485d-ab9f-4c3a-cc235e022905",
"92ee7422-5b08-6d63-2b95-961ec0e18ffa",
"e92ac963-daaf-0899-c3e8-a00d897be0e2",
+ "88789ac9-9de9-bab3-565b-307774e49f4d",
+ "e25f67e4-3a3f-5da7-f7c8-41b371156719",
+ "f7d33d50-7c8e-69e2-6d60-5c6155c5d210",
+ "233b5ab5-8177-4416-6912-2477520a0654",
"9bc22ca7-049c-af51-7c12-6bf71044b2ec",
"f6d300f7-380a-d090-0d4a-2b2ddefe5104",
"f9f71d74-a49d-b190-d929-b6772ce0ba73",
"22354294-1d01-cebf-180c-d609747be9bc",
"c8e8f3fd-3bfb-aafa-e3ec-a671a942f426",
"d362ddc4-1c5f-67d5-e354-c2a8d2ba9d79",
- "538c71b3-e3e6-f01b-cc4c-d2b686686aa8"
+ "538c71b3-e3e6-f01b-cc4c-d2b686686aa8",
+ "a13e6877-997e-84e1-c8e8-e83ef5e9a002"
],
"owner":0,
"sharedWithTeam":false,
"id":"18032e93-3bc5-9976-4525-fe1e77e98207",
"name":"Delete Specific Config Logical Switch",
"description":"This restconf request delete specific logical switch from the config data store.",
- "url":"http://{{controllerHost}}:8181/restconf/config/network-topology:network-topology/topology/hwvtep:1/node/hwvtep:%2F%2F{{hwvtepNodeIp}}:6640%2Flogicalswitch%2Fls0",
+ "url":"http://{{controllerHost}}:8181/restconf/config/network-topology:network-topology/topology/hwvtep:1/node/hwvtep:%2F%2F{{hwvtepNodeIp}}:6640/logical-switches/ls0",
"method":"DELETE",
"headers":"Authorization: Basic YWRtaW46YWRtaW4=\n",
"data":[],
"id":"538c71b3-e3e6-f01b-cc4c-d2b686686aa8",
"name":"Get Specific Operational Logical Switch",
"description":"This restconf request fetch the operational for specific Logical Switch",
- "url":"http://{{controllerHost}}:8181/restconf/operational/network-topology:network-topology/topology/hwvtep:1/node/hwvtep:%2F%2F{{hwvtepNodeIp}}:6640%2logicalswitch%2ls0",
+ "url":"http://{{controllerHost}}:8181/restconf/operational/network-topology:network-topology/topology/hwvtep:1/node/hwvtep:%2F%2F{{hwvtepNodeIp}}:6640/logical-switches/ls0",
"method":"GET",
"headers":"Authorization: Basic YWRtaW46YWRtaW4=\n",
- "data":"{\n \"network-topology:node\": [\n {\n \"node-id\": \"hwvtep://{{hwvtepNodeIp}}:6640/logicalswitch/ls0\",\n \"hwvtep-node-description\": \"\",\n \"hwvtep-node-name\": \"ls0\",\n \"tunnel-key\": \"10000\"\n }\n ]\n}",
+ "data":[],
"dataMode":"raw",
"timestamp":0,
"version":2,
"id":"9bc22ca7-049c-af51-7c12-6bf71044b2ec",
"name":"Create Specific Config Logical Switch",
"description":"Fire this Restconf request if you want to create a logical switch.",
- "url":"http://{{controllerHost}}:8181/restconf/config/network-topology:network-topology/topology/hwvtep:1/",
+ "url":"http://{{controllerHost}}:8181/restconf/config/network-topology:network-topology/topology/hwvtep:1/node/hwvtep:%2F%2F{{hwvtepNodeIp}}:6640",
"method":"POST",
"headers":"Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "data":"{\n \"network-topology:node\": [\n {\n \"node-id\": \"hwvtep://{{hwvtepNodeIp}}:6640/logicalswitch/ls0\",\n \"hwvtep-node-description\": \"\",\n \"hwvtep-node-name\": \"ls0\",\n \"tunnel-key\": \"10000\",\n \"managed-by\": \"/network-topology:network-topology/network-topology:topology[network-topology:topology-id='hwvtep:1']/network-topology:node[network-topology:node-id='hwvtep://{{hwvtepNodeIp}}:6640']\" \n }\n ]\n}",
+ "data":"{\n \"logical-switches\": [\n {\n \"hwvtep-node-name\": \"ls0\",\n \"hwvtep-node-description\": \"\",\n \"tunnel-key\": \"10000\"\n }\n ]\n}",
"dataMode":"raw",
"timestamp":0,
"version":2,
"url":"http://{{controllerHost}}:8181/restconf/operational/network-topology:network-topology/topology/hwvtep:1/node/hwvtep:%2F%2F{{hwvtepNodeIp}}:6640",
"method":"GET",
"headers":"Authorization: Basic YWRtaW46YWRtaW4=\n",
- "data":"{\n \"network-topology:node\": [\n {\n \"node-id\": \"hwvtep://{{hwvtepNodeIp}}:6640/logicalswitch/ls0\",\n \"hwvtep-node-description\": \"\",\n \"hwvtep-node-name\": \"ls0\",\n \"tunnel-key\": \"10000\"\n }\n ]\n}",
+ "data":[],
"dataMode":"raw",
"timestamp":0,
"version":2,
{
"collectionId":"19f6b1a8-4d54-62f8-6bd6-f52e0b6e40b8",
"id":"f6d300f7-380a-d090-0d4a-2b2ddefe5104",
- "name":"Create Specific Config Logical Switch",
+ "name":"Update Specific Config Logical Switch",
"description":"Fire this request if you want to update specific logical switch.",
- "url":"http://{{controllerHost}}:8181/restconf/config/network-topology:network-topology/topology/hwvtep:1/node/hwvtep:%2F%2F{{hwvtepNodeIp}}:6640%2Flogicalswitch%2Fls0",
+ "url":"http://{{controllerHost}}:8181/restconf/config/network-topology:network-topology/topology/hwvtep:1/node/hwvtep:%2F%2F{{hwvtepNodeIp}}:6640/logical-switches/ls0",
"method":"PUT",
"headers":"Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "data":"{\n \"network-topology:node\": [\n {\n \"node-id\": \"hwvtep://{{hwvtepNodeIp}}:6640/logicalswitch/ls0\",\n \"hwvtep-node-description\": \"\",\n \"hwvtep-node-name\": \"ls0\",\n \"tunnel-key\": \"10000\",\n \"managed-by\": \"/network-topology:network-topology/network-topology:topology[network-topology:topology-id='hwvtep:1']/network-topology:node[network-topology:node-id='hwvtep://{{hwvtepNodeIp}}:6640']\" \n }\n ]\n}",
+ "data":"{\n \"logical-switches\": [\n {\n \"hwvtep-node-name\": \"ls0\",\n \"hwvtep-node-description\": \"\",\n \"tunnel-key\": \"10000\"\n }\n ]\n}",
"dataMode":"raw",
"timestamp":0,
"version":2,
"id":"f9f71d74-a49d-b190-d929-b6772ce0ba73",
"name":"Get Specific Config Logical Switch",
"description":"This restconf request fetch configuration for specific logical switch.",
- "url":"http://{{controllerHost}}:8181/restconf/config/network-topology:network-topology/topology/hwvtep:1/node/hwvtep:%2F%2F{{hwvtepNodeIp}}:6640%2Flogicalswitch%2Fls0",
+ "url":"http://{{controllerHost}}:8181/restconf/config/network-topology:network-topology/topology/hwvtep:1/node/hwvtep:%2F%2F{{hwvtepNodeIp}}:6640/logical-switches/ls0",
"method":"GET",
"headers":"Authorization: Basic YWRtaW46YWRtaW4=\n",
- "data":"{\n \"network-topology:node\": [\n {\n \"node-id\": \"hwvtep://{{hwvtepNodeIp}}:6640/logicalswitch/ls0\",\n \"hwvtep-node-description\": \"\",\n \"hwvtep-node-name\": \"ls0\",\n \"tunnel-key\": \"10000\"\n }\n ]\n}",
+ "data":[],
"dataMode":"raw",
"timestamp":0,
"version":2,
"time":1447335408595
+ },
+ {
+ "collectionId": "19f6b1a8-4d54-62f8-6bd6-f52e0b6e40b8",
+ "id": "88789ac9-9de9-bab3-565b-307774e49f4d",
+ "name": "Create Specific Config Physical Switch",
+ "description": "Fire this Restconf request if you want to create a physical switch.",
+ "url": "http://{{controllerHost}}:8181/restconf/config/network-topology:network-topology/topology/hwvtep:1/",
+ "method": "POST",
+ "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
+ "data": [],
+ "dataMode": "raw",
+ "timestamp": 0,
+ "version": 2,
+ "time": 1447909152443,
+ "preRequestScript": "",
+ "tests": "",
+ "rawModeData": "{\n \"network-topology:node\": [\n {\n \"node-id\": \"hwvtep://{{hwvtepNodeIp}}:6640/physicalswitch/ps0\",\n \"hwvtep-node-name\": \"ps0\",\n \"hwvtep-node-description\": \"\",\n \"management-ips\": [\n {\n \"management-ips-key\": \"{{managementIp}}\"\n }\n ],\n \"tunnel-ips\": [\n {\n \"tunnel-ips-key\": \"{{tunnleIp}}\"\n }\n ],\n \"managed-by\": \"/network-topology:network-topology/network-topology:topology[network-topology:topology-id='hwvtep:1']/network-topology:node[network-topology:node-id='hwvtep://{{hwvtepNodeIp}}:6640']\" \n }\n ]\n}"
+ },
+ {
+ "collectionId": "19f6b1a8-4d54-62f8-6bd6-f52e0b6e40b8",
+ "id": "e25f67e4-3a3f-5da7-f7c8-41b371156719",
+ "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
+ "url": "http://{{controllerHost}}:8181/restconf/config/network-topology:network-topology/topology/hwvtep:1/node/hwvtep:%2F%2F{{hwvtepNodeIp}}:6640%phsicalswitch%2Fps0",
+ "preRequestScript": "",
+ "pathVariables": {},
+ "method": "PUT",
+ "data": [],
+ "dataMode": "raw",
+ "version": 2,
+ "tests": "",
+ "currentHelper": "normal",
+ "helperAttributes": {},
+ "time": 1448552632013,
+ "name": "Update Specific Config Physical Switch",
+ "description": "Fire this Restconf request if you want to update a exsiting physical switch.",
+ "rawModeData": "{\n \"network-topology:node\": [\n {\n \"node-id\": \"hwvtep://{{hwvtepNodeIp}}:6640/physicalswitch/ps0\",\n \"hwvtep-node-name\": \"ps0\",\n \"hwvtep-node-description\": \"\",\n \"management-ips\": [\n {\n \"management-ips-key\": \"{{managementIp}}\"\n }\n ],\n \"tunnel-ips\": [\n {\n \"tunnel-ips-key\": \"{{tunnleIp}}\"\n }\n ],\n \"managed-by\": \"/network-topology:network-topology/network-topology:topology[network-topology:topology-id='hwvtep:1']/network-topology:node[network-topology:node-id='hwvtep://{{hwvtepNodeIp}}:6640']\" \n }\n ]\n}"
+ },
+ {
+ "collectionId": "19f6b1a8-4d54-62f8-6bd6-f52e0b6e40b8",
+ "id": "f7d33d50-7c8e-69e2-6d60-5c6155c5d210",
+ "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
+ "url": "http://{{controllerHost}}:8181/restconf/config/network-topology:network-topology/topology/hwvtep:1/node/hwvtep:%2F%2F{{hwvtepNodeIp}}:6640%phsicalswitch%2Fps0",
+ "preRequestScript": "",
+ "pathVariables": {},
+ "method": "GET",
+ "data": [],
+ "dataMode": "params",
+ "version": 2,
+ "tests": "",
+ "currentHelper": "normal",
+ "helperAttributes": {},
+ "time": 1448548819543,
+ "name": "Get Specific Config Physical Switch",
+ "description": "Fire this Restconf request if you want to get a exsiting physical switch."
+ },
+ {
+ "collectionId": "19f6b1a8-4d54-62f8-6bd6-f52e0b6e40b8",
+ "id": "233b5ab5-8177-4416-6912-2477520a0654",
+ "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
+ "url": "http://{{controllerHost}}:8181/restconf/config/network-topology:network-topology/topology/hwvtep:1/node/hwvtep:%2F%2F{{hwvtepNodeIp}}:6640%phsicalswitch%2Fps0",
+ "preRequestScript": "",
+ "pathVariables": {},
+ "method": "DELETE",
+ "data": [],
+ "dataMode": "raw",
+ "version": 2,
+ "tests": "",
+ "currentHelper": "normal",
+ "helperAttributes": {},
+ "time": 1448552707318,
+ "name": "Delete Specific Config Physical Switch",
+ "description": "Fire this Restconf request if you want to delete a physical switch.",
+ "rawModeData": ""
+ },
+ {
+ "collectionId": "19f6b1a8-4d54-62f8-6bd6-f52e0b6e40b8",
+ "id": "a13e6877-997e-84e1-c8e8-e83ef5e9a002",
+ "name": "Get Specific Operational Physical Switch",
+ "description": "",
+ "url": "http://{{controllerHost}}:8181/restconf/operational/network-topology:network-topology/topology/hwvtep:1/node/hwvtep:%2F%2F{{hwvtepNodeIp}}:6640%2Fphysicalswitch%2Fps0",
+ "method": "GET",
+ "headers": "Authorization: Basic YWRtaW46YWRtaW4=\n",
+ "data": [],
+ "dataMode": "raw",
+ "timestamp": 0,
+ "responses": [],
+ "version": 2,
+ "preRequestScript": "",
+ "tests": "",
+ "rawModeData": ""
}
]
}
public NodeId createNodeId(IpAddress ip, PortNumber port) {
String uriString = SouthboundConstants.OVSDB_URI_PREFIX + "://"
- + new String(ip.getValue()) + ":" + port.getValue();
+ + String.valueOf(ip.getValue()) + ":" + port.getValue();
Uri uri = new Uri(uriString);
return new NodeId(uri);
}
}
public String connectionInfoToString(final ConnectionInfo connectionInfo) {
- return new String(connectionInfo.getRemoteIp().getValue()) + ":" + connectionInfo.getRemotePort().getValue();
+ return String.valueOf(
+ connectionInfo.getRemoteIp().getValue()) + ":" + connectionInfo.getRemotePort().getValue();
}
public boolean addOvsdbNode(final ConnectionInfo connectionInfo) {