.metadata
ordmodels/src/main/java
tests/config.xml
-tests/models
\ No newline at end of file
+tests/models
+
+# Sphinx documentation
+.tox/
+docs/_build/
+
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>0.13.0-SNAPSHOT</version>
+ <version>0.14.0-SNAPSHOT</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-api</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<dependencies>
}
leaf degree-number{
type uint32;
- }
+ }
+ leaf interface-name{
+ type string;
+ }
}
}
}
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>3.1.2</version>
+ <version>3.1.3</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-artifacts</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<packaging>pom</packaging>
<dependencyManagement>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>3.1.2</version>
+ <version>3.1.3</version>
<relativePath />
</parent>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-common</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<dependencyManagement>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>1.8.0-SNAPSHOT</version>
+ <version>1.9.0-SNAPSHOT</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>netconf-artifacts</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.6.0-SNAPSHOT</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal.model</groupId>
<artifactId>mdsal-model-artifacts</artifactId>
- <version>0.13.0-SNAPSHOT</version>
+ <version>0.14.0-SNAPSHOT</version>
<scope>import</scope>
<type>pom</type>
</dependency>
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.packs.CircuitPacksKey;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.degree.ConnectionPorts;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.Interface;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.InterfaceKey;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.OrgOpenroadmDevice;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.Degree;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.DegreeKey;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.Info;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.Protocols;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.SharedRiskGroup;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.SharedRiskGroupKey;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.port.Interfaces;
import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.InterfaceType;
import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OpenROADMOpticalMultiplex;
import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OpticalTransport;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.Protocols1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.lldp.container.Lldp;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.lldp.container.lldp.PortConfig;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.Network;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.NetworkBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.Nodes;
List<Degree> degrees = getDegrees(nodeId, deviceInfo);
List<ConnectionPorts> degreeConPorts = getDegreePorts(degrees);
- List<CpToDegree> cpToDegreeList = getCpToDegreeList(degrees);
+ Map<String, String> interfaceList = getEthInterfaceList(nodeId);
+ List<CpToDegree> cpToDegreeList = getCpToDegreeList(degrees, nodeId, interfaceList);
+ LOG.info("Map looks like this {}",interfaceList);
postPortMapping(deviceInfo, null, deviceInfo.getNodeType().getIntValue(), cpToDegreeList);
return mpBldr.build();
}
- private static CpToDegree createCpToDegreeObject(String circuitPackName, String degreeNumber) {
+ private CpToDegree createCpToDegreeObject(String circuitPackName, String degreeNumber, String nodeId,
+ Map<String, String> interfaceList) {
+ String interfaceName = null;
+ if (interfaceList.get(circuitPackName) != null) {
+ interfaceName = interfaceList.get(circuitPackName);
+ }
return new CpToDegreeBuilder().withKey(new CpToDegreeKey(circuitPackName)).setCircuitPackName(circuitPackName)
- .setDegreeNumber(new Long(degreeNumber)).build();
+ .setDegreeNumber(new Long(degreeNumber)).setInterfaceName(interfaceName).build();
}
private static List<ConnectionPorts> getDegreePorts(List<Degree> degrees) {
.flatMap(degree -> degree.getConnectionPorts().stream()).collect(Collectors.toList());
}
- private List<CpToDegree> getCpToDegreeList(List<Degree> degrees) {
+ private List<CpToDegree> getCpToDegreeList(List<Degree> degrees, String nodeId,
+ Map<String, String> interfaceList) {
List<CpToDegree> cpToDegreeList = new ArrayList<>();
for (Degree degree : degrees) {
if (degree.getCircuitPacks() != null) {
+ LOG.info("Inside CP to degree list");
cpToDegreeList.addAll(degree.getCircuitPacks().stream()
- .map(cp -> createCpToDegreeObject(cp.getCircuitPackName(), degree.getDegreeNumber().toString()))
+ .map(cp -> createCpToDegreeObject(cp.getCircuitPackName() ,
+ degree.getDegreeNumber().toString(), nodeId ,interfaceList))
.collect(Collectors.toList()));
}
}
}
-}
\ No newline at end of file
+ private Map<String, String> getEthInterfaceList(String nodeId) {
+ LOG.info("It is calling get ethernet interface");
+ Map<String, String> cpToInterfaceMap = new HashMap<>();
+ InstanceIdentifier<Lldp> lldpIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+ .child(Protocols.class).augmentation(Protocols1.class).child(Lldp.class);
+ Optional<Lldp> lldpObject = this.deviceTransactionManager.getDataFromDevice(nodeId,
+ LogicalDatastoreType.OPERATIONAL, lldpIID, Timeouts.DEVICE_READ_TIMEOUT,
+ Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+ if (lldpObject.isPresent() && (lldpObject.get().getPortConfig() != null)) {
+ for (PortConfig portConfig : lldpObject.get().getPortConfig()) {
+ if (portConfig.getAdminStatus().equals(PortConfig.AdminStatus.Txandrx)) {
+ InstanceIdentifier<Interface> interfaceIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+ .child(Interface.class, new InterfaceKey(portConfig.getIfName()));
+ Optional<Interface> interfaceObject = this.deviceTransactionManager.getDataFromDevice(nodeId,
+ LogicalDatastoreType.OPERATIONAL, interfaceIID, Timeouts.DEVICE_READ_TIMEOUT,
+ Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+ if (interfaceObject.isPresent() && (interfaceObject.get().getSupportingCircuitPackName() != null)) {
+ String supportingCircuitPackName = interfaceObject.get().getSupportingCircuitPackName();
+ cpToInterfaceMap.put(supportingCircuitPackName, portConfig.getIfName());
+ InstanceIdentifier<CircuitPacks> circuitPacksIID = InstanceIdentifier.create(OrgOpenroadmDevice
+ .class).child(CircuitPacks.class, new CircuitPacksKey(supportingCircuitPackName));
+ Optional<CircuitPacks> circuitPackObject = this.deviceTransactionManager.getDataFromDevice(
+ nodeId, LogicalDatastoreType.OPERATIONAL, circuitPacksIID, Timeouts
+ .DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+ if (circuitPackObject.isPresent() && (circuitPackObject.get().getParentCircuitPack() != null)) {
+ cpToInterfaceMap.put(circuitPackObject.get().getParentCircuitPack().getCircuitPackName() ,
+ portConfig.getIfName());
+ }
+ }
+ }
+ }
+ } else {
+ LOG.warn("Couldnt find port config under LLDP for Node : {}", nodeId);
+ }
+ LOG.info("Processiong is done.. now returning..");
+ return cpToInterfaceMap;
+ }
+
+}
* @param nodeId node ID
* @param circuitPackName Circtuit-Pack name
* @param activate activate or not
+ *
+ * @throws OpenRoadmInterfaceException OpenRoadm Interface Exception
*/
void postEquipmentState(String nodeId, String circuitPackName, boolean activate) throws OpenRoadmInterfaceException;
--- /dev/null
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+# SPDX-License-Identifier: EPL-1.0
+##############################################################################
+# Copyright (c) 2018 The Linux Foundation 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
+##############################################################################
+
+from docs_conf.conf import *
+
--- /dev/null
+project_cfg: opendaylight
+project: Transport PCE
+version: Neon
+
--- /dev/null
+.. _transportpce-dev-guide:
+
+TransportPCE Developer Guide
+============================
+
+Overview
+--------
+
+TransportPCE describes an application running on top of the OpenDaylight
+controller. Its primary function is to control an optical transport
+infrastructure using a non-proprietary South Bound Interface (SBI). It may be
+interconnected with Controllers of different layers (L2, L3 Controller…), a
+higher layer Controller and/or an Orchestrator through non-proprietary
+Application Programing Interfaces (APIs). Control includes the capability to
+configure the optical equipment, and to provision services according to a
+request coming from a higher layer controller and/or an orchestrator.
+This capability may rely on the controller only or it may be delegated to
+distributed (standardized) protocols.
+
+
+Architecture
+------------
+
+TransportPCE modular architecture is described on the next diagram. Each main
+function such as Topology management, Path Calculation Engine (PCE), Service
+handler, Renderer \_responsible for the path configuration through optical
+equipment\_ and Optical Line Management (OLM) is associated with a generic block
+relying on open models, each of them communicating through published APIs.
+
+
+.. figure:: ./images/tpce_architecture.jpg
+ :alt: TransportPCE architecture
+
+ TransportPCE architecture
+
+The current version of transportPCE is dedicated to the control of WDM transport
+infrastructure. OTN layer will be integrated in a later step. The WDM layer is
+built from colorless ROADMs and transponders.
+
+The interest of using a controller to provision automatically services strongly
+relies on its ability to handle end to end optical services that spans through
+the different network domains, potentially equipped with equipment coming from
+different suppliers. Thus, interoperability in the optical layer is a key
+element to get the benefit of automated control.
+
+Initial design of TransportPCE leverages Open ROADM Multi-Source-Agreement (MSA)
+which defines interoperability specifications, consisting of both Optical
+interoperability and Yang data models.
+
+Module description
+~~~~~~~~~~~~~~~~~~
+
+ServiceHandler
+^^^^^^^^^^^^^^
+
+Service Handler handles request coming from a higher level controller or an
+orchestrator through the northbound API, as defined in the Open ROADM service
+model. Current implementation addresses the following rpcs: service-create,
+service–delete, service-reroute.
+It checks the request consistency and trigs path calculation sending rpcs to the
+PCE. If a valid path is returned by the PCE, path configuration is initiated
+relying on Renderer and OLM.
+At the confirmation of a successful service creation, the Service Handler
+updates the service-list in the MD-SAL.
+For service deletion, the Service Handler relies on the Renderer and the OLM to
+delete connections and reset power levels associated with the service.
+The service-list is updated following a successful service deletion.
+
+
+PCE
+^^^^^^^^^^^^^^
+
+The Path Computation Element (PCE) is the component responsible for path
+calculation. An interface allows the Renderer or external components such as an
+orchestrator to request a path computation and get a response from the PCE
+including the computed path(s) in case of success, or errors and indication of
+the reason for the failure in case the request cannot be satisfied. Additional
+parameters can be provided by the PCE in addition to the computed paths if
+requested by the client module. An interface to the Topology Management module
+allows keeping PCE aligned with the latest changes in the topology. Information
+about current and planned services is available in the MD-SAL data store.
+
+Current implementation of PCE allows finding the shortest path, minimizing
+either the hop count (default) or the propagation delay. Wavelength is assigned
+considering a fixed grid of 96 wavelengths. Current PCE handles the following
+constraints as hard constraints:
+
+- **Node exclusion**
+- **SRLG exclusion**
+- **Maximum latency**
+
+
+Topology Management
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+Topology management module builds the Topology according to the Network model
+defined in OpenROADM. The topology is aligned with I2RS model. It includes
+several network layers:
+
+- **CLLI layer corresponds to the locations that host equipment**
+- **Network layer corresponds to a first level of disaggregation where we
+ separate Xponders (transponder, muxponders or switchponders) from ROADMs**
+- **Topology layer introduces a second level of disaggregation where ROADMs
+ Add/Drop modules ("SRGs") are separated from the degrees which includes line
+ amplifiers and WSS that switch wavelengths from one to another degree**
+
+OTN layer which includes OTN elements having or not the ability to switch OTN
+containers from client to line cards is not currently implemented.
+
+Renderer
+^^^^^^^^
+
+The Renderer module, on request coming from the Service Handler through a
+service-implementation-request /service delete rpc, sets/deletes the path
+corresponding to a specific service between A and Z ends.
+It first checks what are the existing interfaces on the ports of the different
+nodes that the path crosses. It then creates missing interfaces. After all
+needed interfaces have been created it sets the connections required in the
+nodes and notifies the Service Handler on the status of the path creation.
+Path is created in 2 steps (from A to Z and Z to A). In case the path between
+A and Z could not be fully created, a rollback function is called to set the
+equipment on the path back to their initial configuration (as they were before
+invoking the Renderer).
+
+OLM
+^^^^^^^^
+
+Optical Line Management module implements two main features: it is responsible
+for setting up the optical power levels on the different interfaces, and is in
+charge of adjusting these settings across the life of the optical
+infrastructure.
+
+After the different connections have been established in the ROADMS, between 2
+Degrees for an express path, or between a SRG and a Degree for an Add or Drop
+path; meaning the devices have set WSS and all other required elements to
+provide path continuity, power setting are provided as attributes of these
+connections. This allows the device to set all complementary elements such as
+VOAs, to guaranty that the signal is launched at a correct power level
+(in accordance to the specifications) in the fiber span. This also applies
+to X-Ponders, as their output power must comply with the specifications defined
+for the Add/Drop ports (SRG) of the ROADM. OLM has the responsibility of
+calculating the right power settings, sending it to the device, and check the
+PM retrieved from the device to verify that the setting was correctly applied
+and the configuration was successfully completed.
+
+Key APIs and Interfaces
+-----------------------
+
+External API
+~~~~~~~~~~~~
+
+North API, interconnecting the Service Handler to higher level applications
+relies on the Service Model defined in the MSA. The Renderer and the OLM are
+developed to allow configuring Open ROADM devices through a southbound
+Netconf/Yang interface and rely on the MSA’s device model.
+
+ServiceHandler Service
+^^^^^^^^^^^^^^^^^^^^^^
+
+- RPC call
+
+ - service-create (given service-name, service-aend, service-zend)
+
+ - service-delete (given service-name)
+
+ - service-reroute (given service-name, service-aend, service-zend)
+
+- Data structure
+
+ - service list : composed of services
+ - service : composed of service-name, topology wich describes the detailed path (list of used resources)
+
+- Notification
+
+ - service-rpc-result : result of service RPC
+ - service-notification : service has been added, modified or removed
+
+Netconf Service
+^^^^^^^^^^^^^^^
+
+- RPC call
+
+ - connect-device : PUT
+ - disconnect-device : DELETE
+ - check-connected-device : GET
+
+- Data Structure
+
+ - node list : composed of netconf nodes in topology-netconf
+
+
+Internal APIs
+~~~~~~~~~~~~~
+
+Internal APIs define REST APIs to interconnect TransportPCE modules :
+
+- Service Handler to PCE
+- PCE to Topology Management
+- Service Handler to Renderer
+- Renderer to OLM
+
+Pce Service
+^^^^^^^^^^^
+
+- RPC call
+
+ - path-computation-request (given service-name, service-aend, service-zend)
+
+ - cancel-resource-reserve (given service-name)
+
+- Notification
+
+ - service-path-rpc-result : result of service RPC
+
+Renderer Service
+^^^^^^^^^^^^^^^^
+
+- RPC call
+
+ - service-implementation-request (given service-name, service-aend, service-zend)
+
+ - service-delete (given service-name)
+
+- Data structure
+
+ - service path list : composed of service paths
+ - service path : composed of service-name, path description giving the list of abstracted elements (nodes, tps, links)
+
+- Notification
+
+ - service-path-rpc-result : result of service RPC
+
+Topology Management Service
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+- Data structure
+
+ - network list : composed of networks(openroadm-topology, netconf-topology)
+ - node list : composed of node-id
+ - link list : composed of link-id
+ - node : composed of roadm, xponder
+ link : composed of links of different types (roadm-to-roadm, express, add-drop ...)
+
+OLM Service
+^^^^^^^^^^^
+
+- RPC call
+
+ - get-pm (given node-id)
+
+ - service-power-setup
+
+ - service-power-turndown
+
+ - service-power-reset
+
+ - calculate-spanloss-base
+
+ - calculate-spanloss-current
+
+
+Running transportPCE project
+----------------------------
+
+To use transportPCE controller, the first step is to connect the controller to optical nodes
+through the NETCONF connector.
+
+.. note::
+
+ In the current version, only optical equipment compliant with open ROADM datamodels are managed
+ by transportPCE.
+
+
+Connecting nodes
+~~~~~~~~~~~~~~~~
+
+To connect a node, use the following JSON RPC
+
+**REST API** : *POST /restconf/config/network-topology:network-topology/topology/topology-netconf/node/<node-id>*
+
+**Sample JSON Data**
+
+.. code:: json
+
+ {
+ "node": [
+ {
+ "node-id": "<node-id>",
+ "netconf-node-topology:tcp-only": "false",
+ "netconf-node-topology:reconnect-on-changed-schema": "false",
+ "netconf-node-topology:host": "<node-ip-address>",
+ "netconf-node-topology:default-request-timeout-millis": "120000",
+ "netconf-node-topology:max-connection-attempts": "0",
+ "netconf-node-topology:sleep-factor": "1.5",
+ "netconf-node-topology:actor-response-wait-time": "5",
+ "netconf-node-topology:concurrent-rpc-limit": "0",
+ "netconf-node-topology:between-attempts-timeout-millis": "2000",
+ "netconf-node-topology:port": "<netconf-port>",
+ "netconf-node-topology:connection-timeout-millis": "20000",
+ "netconf-node-topology:username": "<node-username>",
+ "netconf-node-topology:password": "<node-password>",
+ "netconf-node-topology:keepalive-delay": "300"
+ }
+ ]
+ }
+
+
+Then check that the netconf session has been correctly established between the controller and the
+node. the status of **netconf-node-topology:connection-status** must be **connected**
+
+**REST API** : *GET /restconf/operational/network-topology:network-topology/topology/topology-netconf/node/<node-id>*
+
+
+Node configuration discovery
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Once the controller is connected to the node, transportPCE application automatically launchs a
+discovery of the node configuration datastore and creates **Logical Connection Points** to any
+physical ports related to transmission. All *circuit-packs* inside the node configuration are
+analyzed.
+
+Use the following JSON RPC to check that function internally named *portMapping*.
+
+**REST API** : *GET /restconf/config/portmapping:network*
+
+.. note::
+
+ In ``org-openroadm-device.yang``, two types of optical nodes can be managed:
+ * rdm: ROADM device (optical switch)
+ * xpdr: Xponder device (device that converts client to optical channel interface)
+
+Depending on the kind of open ROADM device connected, different kind of *Logical Connection Points*
+should appear, if the node configuration is not empty:
+
+- DEG<degree-number>-TTP-<port-direction>: created on the line port of a degree on a rdm equipment
+- SRG<srg-number>-PP<port-number>: created on the client port of a srg on a rdm equipment
+- XPDR<number>-CLIENT<port-number>: created on the client port of a xpdr equipment
+- XPDR<number>-NETWORK<port-number>: created on the line port of a xpdr equipment
+
+ For further details on openROADM device models, see `openROADM MSA white paper <https://0201.nccdn.net/1_2/000/000/134/c50/Open-ROADM-MSA-release-2-Device-White-paper-v1-1.pdf>`__.
+
+Optical Network topology
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+Before creating an optical connectivity service, your topology must contain at least two xpdr
+devices connected to two different rdm devices. Normally, the *openroadm-topology* is automatically
+created by transportPCE. Nevertheless, depending on the configuration inside optical nodes, this
+topology can be partial. Check that link of type *ROADMtoROADM* exists between two adjacent rdm
+nodes.
+
+**REST API** : *GET /restconf/config/ietf-network:network/openroadm-topology*
+
+If it is not the case, you need to manually complement the topology with *ROADMtoROADM* link using
+the following REST RPC:
+
+
+**REST API** : *POST /restconf/operations/networkutils:init-roadm-nodes*
+
+**Sample JSON Data**
+
+.. code:: json
+
+ {
+ "networkutils:input": {
+ "networkutils:rdm-a-node": "<node-id-A>",
+ "networkutils:deg-a-num": "<degree-A-number>",
+ "networkutils:termination-point-a": "<Logical-Connection-Point>",
+ "networkutils:rdm-z-node": "<node-id-Z>",
+ "networkutils:deg-z-num": "<degree-Z-number>",
+ "networkutils:termination-point-z": "<Logical-Connection-Point>"
+ }
+ }
+
+*<Logical-Connection-Point> comes from the portMapping function*.
+
+Unidirectional links between xpdr and rdm nodes must be created manually. To that end use the two
+following REST RPCs:
+
+From xpdr to rdm:
+^^^^^^^^^^^^^^^^^
+
+**REST API** : *POST /restconf/operations/networkutils:init-xpdr-rdm-links*
+
+**Sample JSON Data**
+
+.. code:: json
+
+ {
+ "networkutils:input": {
+ "networkutils:links-input": {
+ "networkutils:xpdr-node": "<xpdr-node-id>",
+ "networkutils:xpdr-num": "1",
+ "networkutils:network-num": "<xpdr-network-port-number>",
+ "networkutils:rdm-node": "<rdm-node-id>",
+ "networkutils:srg-num": "<srg-number>",
+ "networkutils:termination-point-num": "<Logical-Connection-Point>"
+ }
+ }
+ }
+
+From rdm to xpdr:
+^^^^^^^^^^^^^^^^^
+
+**REST API** : *POST /restconf/operations/networkutils:init-rdm-xpdr-links*
+
+**Sample JSON Data**
+
+.. code:: json
+
+ {
+ "networkutils:input": {
+ "networkutils:links-input": {
+ "networkutils:xpdr-node": "<xpdr-node-id>",
+ "networkutils:xpdr-num": "1",
+ "networkutils:network-num": "<xpdr-network-port-number>",
+ "networkutils:rdm-node": "<rdm-node-id>",
+ "networkutils:srg-num": "<srg-number>",
+ "networkutils:termination-point-num": "<Logical-Connection-Point>"
+ }
+ }
+ }
+
+
+Creating a service
+~~~~~~~~~~~~~~~~~~
+
+Use the following REST RPC to invoke *service handler* module in order to create a bidirectional
+end-to-end optical connectivity service between two xpdr over an optical network composed of rdm
+nodes.
+
+**REST API** : *POST /restconf/operations/org-openroadm-service:service-create*
+
+**Sample JSON Data**
+
+.. code:: json
+
+ {
+ "input": {
+ "sdnc-request-header": {
+ "request-id": "request-1",
+ "rpc-action": "service-create",
+ "request-system-id": "appname"
+ },
+ "service-name": "test1",
+ "common-id": "commonId",
+ "connection-type": "service",
+ "service-a-end": {
+ "service-rate": "100",
+ "node-id": "<xpdr-node-id>",
+ "service-format": "Ethernet",
+ "clli": "<ccli-name>",
+ "tx-direction": {
+ "port": {
+ "port-device-name": "<xpdr-client-port>",
+ "port-type": "fixed",
+ "port-name": "<xpdr-client-port-number>",
+ "port-rack": "000000.00",
+ "port-shelf": "Chassis#1"
+ },
+ "lgx": {
+ "lgx-device-name": "Some lgx-device-name",
+ "lgx-port-name": "Some lgx-port-name",
+ "lgx-port-rack": "000000.00",
+ "lgx-port-shelf": "00"
+ }
+ },
+ "rx-direction": {
+ "port": {
+ "port-device-name": "<xpdr-client-port>",
+ "port-type": "fixed",
+ "port-name": "<xpdr-client-port-number>",
+ "port-rack": "000000.00",
+ "port-shelf": "Chassis#1"
+ },
+ "lgx": {
+ "lgx-device-name": "Some lgx-device-name",
+ "lgx-port-name": "Some lgx-port-name",
+ "lgx-port-rack": "000000.00",
+ "lgx-port-shelf": "00"
+ }
+ },
+ "optic-type": "gray"
+ },
+ "service-z-end": {
+ "service-rate": "100",
+ "node-id": "<xpdr-node-id>",
+ "service-format": "Ethernet",
+ "clli": "<ccli-name>",
+ "tx-direction": {
+ "port": {
+ "port-device-name": "<xpdr-client-port>",
+ "port-type": "fixed",
+ "port-name": "<xpdr-client-port-number>",
+ "port-rack": "000000.00",
+ "port-shelf": "Chassis#1"
+ },
+ "lgx": {
+ "lgx-device-name": "Some lgx-device-name",
+ "lgx-port-name": "Some lgx-port-name",
+ "lgx-port-rack": "000000.00",
+ "lgx-port-shelf": "00"
+ }
+ },
+ "rx-direction": {
+ "port": {
+ "port-device-name": "<xpdr-client-port>",
+ "port-type": "fixed",
+ "port-name": "<xpdr-client-port-number>",
+ "port-rack": "000000.00",
+ "port-shelf": "Chassis#1"
+ },
+ "lgx": {
+ "lgx-device-name": "Some lgx-device-name",
+ "lgx-port-name": "Some lgx-port-name",
+ "lgx-port-rack": "000000.00",
+ "lgx-port-shelf": "00"
+ }
+ },
+ "optic-type": "gray"
+ },
+ "due-date": "yyyy-mm-ddT00:00:01Z",
+ "operator-contact": "some-contact-info"
+ }
+ }
+
+Most important parameters for this REST RPC are the identification of the two physical client ports
+on xpdr nodes.This RPC invokes the *PCE* module to compute a path over the *openroadm-topology* and
+then invokes *renderer* and *OLM* to implement the end-to-end path into the devices.
+
+
+Deleting a service
+~~~~~~~~~~~~~~~~~~
+
+Use the following REST RPC to invoke *service handler* module in order to delete a given optical
+connectivity service.
+
+**REST API** : *POST /restconf/operations/org-openroadm-service:service-delete*
+
+**Sample JSON Data**
+
+.. code:: json
+
+ {
+ "input": {
+ "sdnc-request-header": {
+ "request-id": "request-1",
+ "rpc-action": "service-delete",
+ "request-system-id": "appname",
+ "notification-url": "http://localhost:8585/NotificationServer/notify"
+ },
+ "service-delete-req-info": {
+ "service-name": "test1",
+ "tail-retention": "no"
+ }
+ }
+ }
+
+Most important parameters for this REST RPC is the *service-name*.
+
+
+Help
+----
+
+- `TransportPCE Wiki <https://wiki.opendaylight.org/view/TransportPCE:Main>`__
+
+- TransportPCE Mailing List
+ (`developer <https://lists.opendaylight.org/mailman/listinfo/transportpce-dev>`__)
--- /dev/null
+.. _transportpce:
+
+###########################
+Transport PCE Documentation
+###########################
+
+.. toctree::
+ :maxdepth: 1
+
+ developer-guide
+ user-guide
--- /dev/null
+lfdocs-conf
--- /dev/null
+.. _transportpce-user-guide:
+
+TransportPCE User Guide
+=======================
+
+Overview
+--------
+
+TransportPCE describes an application running on top of the OpenDaylight
+controller. Its primary function is to control an optical transport
+infrastructure using a non-proprietary South Bound Interface (SBI). It may be
+interconnected with Controllers of different layers (L2, L3 Controller…),
+a higher layer Controller and/or an Orchestrator through non-proprietary
+Application Programing Interfaces (APIs). Control includes the capability to
+configure the optical equipment, and to provision services according to a
+request coming from a higher layer controller and/or an orchestrator.
+This capability may rely on the controller only or it may be delegated to
+distributed (standardized) protocols.
+
+It provides alarm/fault and performance
+monitoring, but this function might be externalized to improve the scalability.
+A Graphical User Interface could be developed in a later step, but is not
+considered as a priority since automated control does not imply user
+interactions at the transport controller level.
+
+TransportPCE modular architecture is described on the next diagram. Each main
+function such as Topology management, Path Calculation Engine (PCE), Service
+handler, Renderer responsible for the path configuration through optical
+equipment and Optical Line Management (OLM) is associated with a generic block
+relying on open models, each of them communicating through published APIs.
+
+.. figure:: ./images/tpce_architecture.jpg
+ :alt: TransportPCE architecture
+
+ TransportPCE architecture
+
+TransportPCE User-Facing Features
+---------------------------------
+- **odl-transportpce**
+
+ - This feature contains all other features/bundles of TransportPCE project.
+ If you install it, it provides all functions that the TransportPCE project
+ can support.
+
+- **odl-transportpce-api**
+
+ - This feature contains all Transportpce project specific models defined in "Service-path".
+ These models complement OpenROADM models describing South and Northbound APIs, and define the
+ data structure used to interconnect the generic blocks/functions described on the previous
+ diagram.
+
+- **odl-transportpce-ordmodels**
+
+ - This feature contains all OpenROADM models : Common, Device, Network and Service models.
+
+- **odl-transportpce-stubmodels**
+
+ - This feature provides function to be able to stub some of TransportPCE modules, pce and
+ renderer (Stubpce and Stubrenderer).
+ Stubs are used for development purposes and required for some of the functionnal tests.
+
+
+How To Start
+------------
+
+Preparing for Installation
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+1. Devices must support the standard OpenROADM Models more precisely versions
+ 1.2.1 and 2.1.
+
+2. Devices must support configuration through NETCONF protocol/API.
+
+
+
+Installation Feature
+~~~~~~~~~~~~~~~~~~~~
+
+Run OpenDaylight and install TransportPCE Service *odl-transportpce* as below::
+
+ feature:install odl-transportpce
+
+For a more detailed overview of the TransportPCE, see the :ref:`transportpce-dev-guide`.
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>3.1.2</version>
+ <version>3.1.3</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>features-transportpce</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<packaging>feature</packaging>
<dependencies>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>3.1.2</version>
+ <version>3.1.3</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>odl-transportpce-api</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<packaging>feature</packaging>
<properties>
- <mdsal.model.version>0.13.0-SNAPSHOT</mdsal.model.version>
- <mdsal.version>1.8.0-SNAPSHOT</mdsal.version>
- <restconf.version>1.8.0-SNAPSHOT</restconf.version>
- <yangtools.version>2.0.7</yangtools.version>
- <netconf.version>1.5.0-SNAPSHOT</netconf.version>
+ <mdsal.model.version>0.14.0-SNAPSHOT</mdsal.model.version>
+ <mdsal.version>1.9.0-SNAPSHOT</mdsal.version>
+ <restconf.version>1.9.0-SNAPSHOT</restconf.version>
+ <yangtools.version>2.0.9</yangtools.version>
+ <netconf.version>1.6.0-SNAPSHOT</netconf.version>
<configfile.directory>etc/opendaylight/karaf</configfile.directory>
</properties>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>3.1.2</version>
+ <version>3.1.3</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>odl-transportpce-ordmodels</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<packaging>feature</packaging>
<properties>
- <mdsal.model.version>0.13.0-SNAPSHOT</mdsal.model.version>
- <mdsal.version>1.8.0-SNAPSHOT</mdsal.version>
- <restconf.version>1.8.0-SNAPSHOT</restconf.version>
- <yangtools.version>2.0.7</yangtools.version>
- <netconf.version>1.5.0-SNAPSHOT</netconf.version>
+ <mdsal.model.version>0.14.0-SNAPSHOT</mdsal.model.version>
+ <mdsal.version>1.9.0-SNAPSHOT</mdsal.version>
+ <restconf.version>1.9.0-SNAPSHOT</restconf.version>
+ <yangtools.version>2.0.9</yangtools.version>
+ <netconf.version>1.6.0-SNAPSHOT</netconf.version>
<configfile.directory>etc/opendaylight/karaf</configfile.directory>
</properties>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>3.1.2</version>
+ <version>3.1.3</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>odl-transportpce-stubmodels</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<packaging>feature</packaging>
<properties>
- <mdsal.model.version>0.13.0-SNAPSHOT</mdsal.model.version>
+ <mdsal.model.version>0.14.0-SNAPSHOT</mdsal.model.version>
<configfile.directory>etc/opendaylight/karaf</configfile.directory>
</properties>
<dependency>
<groupId>org.opendaylight.mdsal.model</groupId>
<artifactId>ietf-inet-types-2013-07-15</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.6.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>3.1.2</version>
+ <version>3.1.3</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>odl-transportpce</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<packaging>feature</packaging>
<properties>
- <mdsal.model.version>0.13.0-SNAPSHOT</mdsal.model.version>
- <mdsal.version>1.8.0-SNAPSHOT</mdsal.version>
- <yangtools.version>2.0.7</yangtools.version>
- <netconf.version>1.5.0-SNAPSHOT</netconf.version>
- <restconf.version>1.8.0-SNAPSHOT</restconf.version>
+ <mdsal.model.version>0.14.0-SNAPSHOT</mdsal.model.version>
+ <mdsal.version>1.9.0-SNAPSHOT</mdsal.version>
+ <yangtools.version>2.0.9</yangtools.version>
+ <netconf.version>1.6.0-SNAPSHOT</netconf.version>
+ <restconf.version>1.9.0-SNAPSHOT</restconf.version>
<configfile.directory>etc/opendaylight/karaf</configfile.directory>
</properties>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>features-aggregator</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<name>${project.artifactId}</name>
<packaging>pom</packaging>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-impl</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<dependencies>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-it</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
<skipITs>true</skipITs>
<karaf.distro.groupId>org.opendaylight.transportpce</karaf.distro.groupId>
<karaf.distro.artifactId>transportpce-karaf</karaf.distro.artifactId>
- <karaf.distro.version>0.2.0-SNAPSHOT</karaf.distro.version>
+ <karaf.distro.version>0.3.0-SNAPSHOT</karaf.distro.version>
<karaf.distro.type>zip</karaf.distro.type>
</properties>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>karaf4-parent</artifactId>
- <version>3.1.2</version>
+ <version>3.1.3</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-karaf</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<name>${project.artifactId}</name>
<packaging>pom</packaging>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>3.1.2</version>
+ <version>3.1.3</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-networkmodel</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<dependencyManagement>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>netconf-artifacts</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.6.0-SNAPSHOT</version>
<scope>import</scope>
<type>pom</type>
</dependency>
*/
package org.opendaylight.transportpce.networkmodel;
+import java.util.List;
import java.util.Optional;
import java.util.concurrent.ExecutionException;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.MountPoint;
import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.transportpce.common.Timeouts;
import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
-import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
import org.opendaylight.transportpce.networkmodel.util.OpenRoadmTopology;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev170929.Direction;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.packs.CircuitPacks;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.packs.CircuitPacksKey;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.Interface;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.OrgOpenroadmDevice;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.Degree;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.DegreeKey;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.Protocols;
import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.Protocols1;
import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.lldp.container.lldp.NbrList;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.Nodes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.NodesKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.CpToDegree;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.CpToDegreeKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.Mapping;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private final OpenRoadmInterfaces openRoadmInterfaces;
public R2RLinkDiscovery(final DataBroker dataBroker, DeviceTransactionManager deviceTransactionManager,
- OpenRoadmTopology openRoadmTopology, OpenRoadmInterfaces openRoadmInterfaces) {
+ OpenRoadmTopology openRoadmTopology, OpenRoadmInterfaces openRoadmInterfaces) {
this.dataBroker = dataBroker;
this.deviceTransactionManager = deviceTransactionManager;
this.openRoadmTopology = openRoadmTopology;
LOG.info("LLDP subtree is present. Device has {} neighbours", nbrList.getIfName().size());
for (IfName ifName : nbrList.getIfName()) {
if (ifName.getRemoteSysName() == null) {
- LOG.error("LLDP subtree is empty in the device for nodeId: {}", nodeId.getValue());
- return false;
- }
- Optional<MountPoint> mps = this.deviceTransactionManager.getDeviceMountPoint(ifName.getRemoteSysName());
- if (!mps.isPresent()) {
- LOG.warn("Neighbouring nodeId: {} is not mounted yet", ifName.getRemoteSysName());
- // The controller raises a warning rather than an error because the first node to
- // mount cannot see its neighbors yet. The link will be detected when processing
- // the neighbor node.
+ LOG.warn("LLDP subtree neighbour is empty for nodeId: {}, ifName: {}",
+ nodeId.getValue(),ifName.getIfName());
} else {
- if (!createR2RLink(nodeId, ifName.getIfName(), ifName.getRemoteSysName(), ifName.getRemotePortId())) {
- LOG.error("Link Creation failed between {} and {} nodes.", nodeId, ifName.getRemoteSysName());
- return false;
+ Optional<MountPoint> mps = this.deviceTransactionManager.getDeviceMountPoint(ifName.getRemoteSysName());
+ if (!mps.isPresent()) {
+ LOG.warn("Neighbouring nodeId: {} is not mounted yet", ifName.getRemoteSysName());
+ // The controller raises a warning rather than an error because the first node to
+ // mount cannot see its neighbors yet. The link will be detected when processing
+ // the neighbor node.
+ } else {
+ if (!createR2RLink(nodeId, ifName.getIfName(), ifName.getRemoteSysName(),
+ ifName.getRemotePortId())) {
+ LOG.error("Link Creation failed between {} and {} nodes.", nodeId, ifName.getRemoteSysName());
+ return false;
+ }
}
}
}
}
public Direction getDegreeDirection(Integer degreeCounter, NodeId nodeId) {
- InstanceIdentifier<Degree> deviceIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(Degree.class,
- new DegreeKey(degreeCounter));
- Optional<Degree> degreeObject = this.deviceTransactionManager.getDataFromDevice(nodeId.getValue(),
- LogicalDatastoreType.OPERATIONAL, deviceIID, Timeouts.DEVICE_READ_TIMEOUT,
- Timeouts.DEVICE_READ_TIMEOUT_UNIT);
- if (degreeObject.isPresent()) {
- Integer connectionPortCount = degreeObject.get().getConnectionPorts().size();
- if (connectionPortCount == 1) {
- return Direction.Bidirectional;
- } else if (connectionPortCount > 1) {
- return Direction.Tx;
- } else {
- return Direction.NotApplicable;
+ InstanceIdentifier<Nodes> nodesIID = InstanceIdentifier.builder(Network.class)
+ .child(Nodes.class, new NodesKey(nodeId.getValue())).build();
+ try (ReadOnlyTransaction readTx = this.dataBroker.newReadOnlyTransaction()) {
+ Optional<Nodes> nodesObject = readTx.read(LogicalDatastoreType.CONFIGURATION, nodesIID)
+ .get().toJavaUtil();
+ if (nodesObject.isPresent() && nodesObject.get().getMapping() != null) {
+ List<Mapping> mappingList = nodesObject.get().getMapping();
+ mappingList = mappingList.stream().filter(mp -> mp.getLogicalConnectionPoint().contains("DEG"
+ + degreeCounter)).collect(Collectors.toList());
+ if (mappingList.size() == 1) {
+ return Direction.Bidirectional;
+ } else if (mappingList.size() > 1) {
+ return Direction.Tx;
+ } else {
+ return Direction.NotApplicable;
+ }
}
- } else {
- LOG.error("Couldnt retrieve Degree object for nodeId: {} and DegreeNumbner: {}", nodeId.getValue(),
- degreeCounter);
- return Direction.NotApplicable;
+ } catch (InterruptedException | ExecutionException e) {
+ LOG.error("Failed getting Mapping data from portMapping",e);
}
+ return Direction.NotApplicable;
}
public boolean createR2RLink(NodeId nodeId, String interfaceName, String remoteSystemName,
- String remoteInterfaceName) {
+ String remoteInterfaceName) {
String srcTpTx = null;
String srcTpRx = null;
String destTpTx = null;
String destTpRx = null;
// Find which degree is associated with ethernet interface
- // portmapping.getDegFromCP(nodeId,interfaceName);
- Integer srcDegId = getDegFromCP(nodeId, interfaceName);
+ Integer srcDegId = getDegFromInterface(nodeId, interfaceName);
if (srcDegId == null) {
LOG.error("Couldnt find degree connected to Ethernet interface for nodeId: {}", nodeId);
return false;
}
// Find degree for which Ethernet interface is created on other end
NodeId destNodeId = new NodeId(remoteSystemName);
- Integer destDegId = getDegFromCP(destNodeId, remoteInterfaceName);
- // portmapping.getDegFromCP(nodeId,interfaceName);
+ Integer destDegId = getDegFromInterface(destNodeId, remoteInterfaceName);
if (destDegId == null) {
LOG.error("Couldnt find degree connected to Ethernet interface for nodeId: {}", nodeId);
return false;
// A->Z
LOG.debug(
"Found a neighbor SrcNodeId: {} , SrcDegId: {} , SrcTPId: {}, DestNodeId:{} , DestDegId: {}, DestTPId: {}",
- nodeId.getValue(), srcDegId, srcTpTx, destNodeId, destDegId, destTpRx);
+ nodeId.getValue(), srcDegId, srcTpTx, destNodeId, destDegId, destTpRx);
InitRoadmNodesInputBuilder r2rlinkBuilderAToZ = new InitRoadmNodesInputBuilder();
r2rlinkBuilderAToZ.setRdmANode(nodeId.getValue()).setDegANum(srcDegId.shortValue())
.setTerminationPointA(srcTpTx).setRdmZNode(destNodeId.getValue()).setDegZNum(destDegId.shortValue())
}
public boolean deleteR2RLink(NodeId nodeId, String interfaceName, String remoteSystemName,
- String remoteInterfaceName) {
+ String remoteInterfaceName) {
String srcTpTx = null;
String srcTpRx = null;
String destTpTx = null;
String destTpRx = null;
// Find which degree is associated with ethernet interface
- // portmapping.getDegFromCP(nodeId,interfaceName);
- Integer srcDegId = getDegFromCP(nodeId, interfaceName);
+ Integer srcDegId = getDegFromInterface(nodeId, interfaceName);
if (srcDegId == null) {
LOG.error("Couldnt find degree connected to Ethernet interface for nodeId: {}", nodeId);
return false;
}
// Find degree for which Ethernet interface is created on other end
NodeId destNodeId = new NodeId(remoteSystemName);
- // portmapping.getDegFromCP(nodeId,interfaceName);
- Integer destDegId = getDegFromCP(destNodeId, remoteInterfaceName);
+ Integer destDegId = getDegFromInterface(destNodeId, remoteInterfaceName);
if (destDegId == null) {
LOG.error("Couldnt find degree connected to Ethernet interface for nodeId: {}", nodeId);
return false;
destTpTx = "DEG" + destDegId + "-TTP-TX";
destTpRx = "DEG" + destDegId + "-TTP-RX";
}
- return this.openRoadmTopology.deleteLink(nodeId.getValue(), destNodeId.getValue(), srcTpTx, destTpRx)
- && this.openRoadmTopology.deleteLink(destNodeId.getValue(), nodeId.getValue(), destTpTx, srcTpRx);
+ return this.openRoadmTopology.deleteLink(nodeId.getValue(), destNodeId.getValue(),
+ srcDegId, destDegId, srcTpTx, destTpRx)
+ && this.openRoadmTopology.deleteLink(destNodeId.getValue(), nodeId.getValue(),
+ destDegId, srcDegId, destTpTx, srcTpRx);
}
- private CpToDegree getCPtoDegreeMapping(NodeId nodeId, String circuitPackName) {
- InstanceIdentifier<CpToDegree> cptoDegMappingIID = InstanceIdentifier.builder(Network.class)
- .child(Nodes.class, new NodesKey(nodeId.getValue()))
- .child(CpToDegree.class, new CpToDegreeKey(circuitPackName)).build();
- LOG.debug("Input parameters are {},{}", nodeId.getValue(), circuitPackName);
+ private Integer getDegFromInterface(NodeId nodeId, String interfaceName) {
+ InstanceIdentifier<Nodes> nodesIID = InstanceIdentifier.builder(Network.class)
+ .child(Nodes.class, new NodesKey(nodeId.getValue())).build();
try (ReadOnlyTransaction readTx = this.dataBroker.newReadOnlyTransaction()) {
- Optional<CpToDegree> cptpDegObject = readTx.read(LogicalDatastoreType.CONFIGURATION, cptoDegMappingIID)
+ Optional<Nodes> nodesObject = readTx.read(LogicalDatastoreType.CONFIGURATION, nodesIID)
.get().toJavaUtil();
- if (cptpDegObject.isPresent()) {
- CpToDegree cpToDeg = cptpDegObject.get();
- LOG.debug("Found mapping for the Circuit Pack {}. Degree: {}", circuitPackName, cpToDeg);
- return cpToDeg;
+ if (nodesObject.isPresent() && nodesObject.get().getCpToDegree() != null) {
+ List<CpToDegree> cpToDeg = nodesObject.get().getCpToDegree();
+ Stream cpToDegStream = cpToDeg.stream().filter(cp -> cp.getInterfaceName() != null)
+ .filter(cp -> cp.getInterfaceName().equals(interfaceName));
+ if (cpToDegStream != null) {
+ Optional<CpToDegree> firstCpToDegree = cpToDegStream.findFirst();
+ if (firstCpToDegree.isPresent() && firstCpToDegree != null) {
+ LOG.debug("Found and returning {}",firstCpToDegree.get().getDegreeNumber().intValue());
+ return firstCpToDegree.get().getDegreeNumber().intValue();
+ } else {
+ LOG.debug("Not found so returning nothing");
+ return null;
+ }
+ } else {
+ LOG.warn("CircuitPack stream couldnt find anything for nodeId: {} and interfaceName: {}",
+ nodeId.getValue(),interfaceName);
+ }
} else {
- LOG.warn("Could not find mapping for Circuit Pack {} for nodeId {}", circuitPackName,
- nodeId.getValue());
+ LOG.warn("Could not find mapping for Interface {} for nodeId {}", interfaceName,
+ nodeId.getValue());
}
} catch (InterruptedException | ExecutionException ex) {
- LOG.error("Unable to read mapping for circuit pack : {} for nodeId {}", circuitPackName, nodeId, ex);
+ LOG.error("Unable to read mapping for Interface : {} for nodeId {}", interfaceName, nodeId, ex);
}
return null;
}
-
- private Integer getDegFromParentCP(NodeId nodeId, String interfaceName, String supportingCircuitPack) {
- InstanceIdentifier<CircuitPacks> circuitPackIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
- .child(CircuitPacks.class, new CircuitPacksKey(supportingCircuitPack));
- Optional<CircuitPacks> circuitPackObject = this.deviceTransactionManager.getDataFromDevice(nodeId.getValue(),
- LogicalDatastoreType.OPERATIONAL, circuitPackIID, Timeouts.DEVICE_READ_TIMEOUT,
- Timeouts.DEVICE_READ_TIMEOUT_UNIT);
- if (!circuitPackObject.isPresent()
- || (circuitPackObject.get().getParentCircuitPack().getCircuitPackName() == null)) {
- LOG.warn("Parent circuitpack not found for NodeId: {} and Interface: {}", nodeId, interfaceName);
- return null;
- }
- String parentCP = circuitPackObject.get().getParentCircuitPack().getCircuitPackName();
- CpToDegree cpToDegree = getCPtoDegreeMapping(nodeId, parentCP);
- if (cpToDegree == null) {
- LOG.error("CP to Degree mapping not found even with parent circuitpack for NodeID: {}" + "and Interface {}",
- nodeId, interfaceName);
- return null;
- } else {
- LOG.debug("CP to degree is {}", cpToDegree.getDegreeNumber());
- return cpToDegree.getDegreeNumber().intValue();
- }
- }
-
- private Integer getDegFromCP(NodeId nodeId, String interfaceName) {
- try {
- java.util.Optional<Interface> interfaceOpt = this.openRoadmInterfaces.getInterface(nodeId.getValue(),
- interfaceName);
- if (!interfaceOpt.isPresent()) {
- LOG.warn("Interface with {} on node {} was not found!", interfaceName, nodeId.getValue());
- return null;
- }
- String supportingCircuitPack = interfaceOpt.get().getSupportingCircuitPackName();
- LOG.debug("Supporting circuitpack name is :{}", interfaceOpt.get().getSupportingCircuitPackName());
- CpToDegree cpToDegree = getCPtoDegreeMapping(nodeId, supportingCircuitPack);
- // Currently devices have different ways to represent connection to Ethernet port
- // and degree port.
- // If Circuit pack is not present under degree tree then read parent CP of given
- // CP (Circuit pack).
- if (cpToDegree != null) {
- return cpToDegree.getDegreeNumber().intValue();
- } else {
- return getDegFromParentCP(nodeId, interfaceName, supportingCircuitPack);
- }
- } catch (OpenRoadmInterfaceException ex) {
- LOG.error("Failed to get source interface {} from node {}!", interfaceName, nodeId, ex);
- return null;
- }
- }
}
}
// This method returns the linkBuilder object for given source and destination.
- public boolean deleteLink(String srcNode, String dstNode, String srcTp, String destTp) {
+ public boolean deleteLink(String srcNode, String dstNode, Integer srcDegId,
+ Integer destDegId ,String srcTp, String destTp) {
LOG.info("deleting link for {}-{}", srcNode, dstNode);
try {
+ LinkId linkId = LinkIdUtil.buildLinkId(srcNode + "-DEG" + srcDegId,
+ srcTp, dstNode + "-DEG" + destDegId, destTp);
+ LOG.info("Link is for the link is {}", linkId.getValue());
InstanceIdentifierBuilder<Link> linkIID = InstanceIdentifier
.builder(Network.class, new NetworkKey(new NetworkId(NetworkUtils.OVERLAY_NETWORK_ID)))
- .augmentation(Network1.class)
- .child(Link.class, new LinkKey(LinkIdUtil.buildLinkId(srcNode, srcTp, dstNode, destTp)));
+ .augmentation(Network1.class).child(Link.class, new LinkKey(linkId));
WriteTransaction wrtx = this.dataBroker.newWriteOnlyTransaction();
wrtx.delete(LogicalDatastoreType.CONFIGURATION, linkIID.build());
+ LOG.info("Deleted");
wrtx.submit().get(1, TimeUnit.SECONDS);
+ LOG.info("Submitted");
} catch (InterruptedException | ExecutionException | TimeoutException e) {
LOG.error(e.getMessage(), e);
return false;
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>0.13.0-SNAPSHOT</version>
+ <version>0.14.0-SNAPSHOT</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-olm</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<dependencyManagement>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>1.8.0-SNAPSHOT</version>
+ <version>1.9.0-SNAPSHOT</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>netconf-artifacts</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.6.0-SNAPSHOT</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>0.13.0-SNAPSHOT</version>
+ <version>0.14.0-SNAPSHOT</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.transportpce.ordmodels</groupId>
<artifactId>transportpce-ordmodels-common</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<dependencyManagement>
<dependency>
<groupId>org.opendaylight.mdsal.model</groupId>
<artifactId>mdsal-model-artifacts</artifactId>
- <version>0.13.0-SNAPSHOT</version>
+ <version>0.14.0-SNAPSHOT</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>0.13.0-SNAPSHOT</version>
+ <version>0.14.0-SNAPSHOT</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.transportpce.ordmodels</groupId>
<artifactId>transportpce-ordmodels-device</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<dependencyManagement>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>netconf-artifacts</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.6.0-SNAPSHOT</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal.model</groupId>
<artifactId>mdsal-model-artifacts</artifactId>
- <version>0.13.0-SNAPSHOT</version>
+ <version>0.14.0-SNAPSHOT</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>0.13.0-SNAPSHOT</version>
+ <version>0.14.0-SNAPSHOT</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.transportpce.ordmodels</groupId>
<artifactId>transportpce-ordmodels-network</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<dependencyManagement>
<dependency>
<groupId>org.opendaylight.mdsal.model</groupId>
<artifactId>mdsal-model-artifacts</artifactId>
- <version>0.13.0-SNAPSHOT</version>
+ <version>0.14.0-SNAPSHOT</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal.model</groupId>
<artifactId>ietf-network-2015-06-08</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.6.0-SNAPSHOT</version>
</dependency-->
</dependencies>
</project>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>0.13.0-SNAPSHOT</version>
+ <version>0.14.0-SNAPSHOT</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-ordmodels</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>netconf-artifacts</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.6.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal.model</groupId>
<artifactId>mdsal-model-artifacts</artifactId>
- <version>0.13.0-SNAPSHOT</version>
+ <version>0.14.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>0.13.0-SNAPSHOT</version>
+ <version>0.14.0-SNAPSHOT</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.transportpce.ordmodels</groupId>
<artifactId>transportpce-ordmodels-service</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<dependencyManagement>
<dependency>
<groupId>org.opendaylight.mdsal.model</groupId>
<artifactId>mdsal-model-artifacts</artifactId>
- <version>0.13.0-SNAPSHOT</version>
+ <version>0.14.0-SNAPSHOT</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>3.1.2</version>
+ <version>3.1.3</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-pce</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<build>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>sal-binding-broker-impl</artifactId>
- <version>1.8.0-SNAPSHOT</version>
+ <version>1.9.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
* expected path computation result
* @param topologyDataPath
* path to topology data file to be used for DataStore population
+ *
+ * @throws Exception exception throws by the function
*/
public PceManyTests(PathComputationRequestInput input,
PathComputationRequestOutput expectedOutput, String topologyDataPath) throws Exception {
/**
* Generate Data for Test 1 result 5-4.
+ * @param wl WaveLength
+ *
* @return output PathComputationRequestOutput data
*/
public static PathComputationRequestOutput getPCE_test_result_54(Long wl) {
"pce:pce-metric": "hop-count"
}
}</code>
+ * @param base Path Computation Request Input base
+ *
* @return input PathComputationRequestInput data
*/
public static PathComputationRequestInput build_diversity_from_request(PathComputationRequestInput base) {
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>3.1.2</version>
+ <version>3.1.3</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-aggregator</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<name>transportpce</name>
<packaging>pom</packaging>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>0.13.0-SNAPSHOT</version>
+ <version>0.14.0-SNAPSHOT</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-renderer</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<dependencyManagement>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>1.8.0-SNAPSHOT</version>
+ <version>1.9.0-SNAPSHOT</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>netconf-artifacts</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.6.0-SNAPSHOT</version>
<scope>import</scope>
<type>pom</type>
</dependency>
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
-
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.configuration.response.common.ConfigurationResponseCommon;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.configuration.response.common.ConfigurationResponseCommonBuilder;
int[] pos = findTheLongestSubstring(nodeID, tpID);
//TODO: do not rely on nodeId to be integer
int id = Integer.parseInt(sortId);
- treeMap.put(id, new NodeIdPair(nodeID.substring(0, pos[0] - 1), tpID));
+ treeMap.put(id, new NodeIdPair(nodeID.substring(0, pos[0] - 1), tpID));
} else if (resourceType.equals("Link")) {
LOG.info("The type is link");
} else {
int[] pos = findTheLongestSubstring(nodeID, tpID);
//TODO: do not rely on nodeId to be integer
int id = Integer.parseInt(sortId);
- treeMap.put(id, new NodeIdPair(nodeID.substring(0, pos[0] - 1), tpID));
+ treeMap.put(id, new NodeIdPair(nodeID.substring(0, pos[0] - 1), tpID));
} else if (resourceType.equals("Link")) {
LOG.info("The type is link");
} else {
*
*
* @return Name of the interface if successful, otherwise return null.
+ * @throws OpenRoadmInterfaceException OpenRoadmInterfaceException
*/
public String createOpenRoadmOtu4Interface(String nodeId, String logicalConnPoint, String supportOchInterface)
}
@Parameterized.Parameters
- public static Collection primeNumbers() {
+ public static Collection createParameters() {
List<Object[]> parameters = new ArrayList<>();
PathDescription pathDescription =
@Test
public void freeWavelengthsTest() throws ExecutionException, InterruptedException {
- WaveLengthServiceUtils.putTerminationPoint1ToDatastore("node1", "node1-" + OpenRoadmInterfacesImpl.TTP_TOKEN,
+ WaveLengthServiceUtils.putTerminationPoint1ToDatastore("node1" + OpenRoadmInterfacesImpl.TTP_TOKEN,
+ OpenRoadmInterfacesImpl.TTP_TOKEN,
this.terminationPoint1, this.deviceTransactionManager);
- WaveLengthServiceUtils.putNode1ToDatastore("node1", this.node1, this.deviceTransactionManager);
+ WaveLengthServiceUtils.putNode1ToDatastore("node1" + OpenRoadmInterfacesImpl.TTP_TOKEN, this.node1,
+ this.deviceTransactionManager);
this.networkModelWavelengthService.freeWavelengths(this.pathDescription);
- Node1 updatedNode1 = WaveLengthServiceUtils.getNode1FromDatastore("node1", this.deviceTransactionManager);
- TerminationPoint1 updatedTerminationPoint1 = WaveLengthServiceUtils.getTerminationPoint1FromDatastore("node1",
- "node1-" + OpenRoadmInterfacesImpl.TTP_TOKEN, this.deviceTransactionManager);
+ Node1 updatedNode1 = WaveLengthServiceUtils.getNode1FromDatastore("node1" + OpenRoadmInterfacesImpl.TTP_TOKEN,
+ this.deviceTransactionManager);
+ TerminationPoint1 updatedTerminationPoint1 =
+ WaveLengthServiceUtils.getTerminationPoint1FromDatastore("node1" + OpenRoadmInterfacesImpl.TTP_TOKEN,
+ OpenRoadmInterfacesImpl.TTP_TOKEN, this.deviceTransactionManager);
switch (updatedTerminationPoint1.getTpType()) {
case DEGREETXRXCTP:
case DEGREETXCTP:
}
@Parameterized.Parameters
- public static Collection primeNumbers() {
+ public static Collection createParameters() {
List<Object[]> parameters = new ArrayList<>();
PathDescription pathDescription =
@Test
public void freeWavelengthsTest() throws ExecutionException, InterruptedException {
WaveLengthServiceUtils
- .putTerminationPoint1ToDatastore("node1", "node1-" + OpenRoadmInterfacesImpl.TTP_TOKEN,
+ .putTerminationPoint1ToDatastore("node1" + OpenRoadmInterfacesImpl.TTP_TOKEN,
+ OpenRoadmInterfacesImpl.TTP_TOKEN,
this.terminationPoint1, this.deviceTransactionManager);
- WaveLengthServiceUtils.putNode1ToDatastore("node1", this.node1, this.deviceTransactionManager);
+ WaveLengthServiceUtils.putNode1ToDatastore("node1" + OpenRoadmInterfacesImpl.TTP_TOKEN, this.node1,
+ this.deviceTransactionManager);
this.networkModelWavelengthService.useWavelengths(this.pathDescription);
- Node1 updatedNode1 = WaveLengthServiceUtils.getNode1FromDatastore("node1", this.deviceTransactionManager);
+ Node1 updatedNode1 = WaveLengthServiceUtils.getNode1FromDatastore("node1" + OpenRoadmInterfacesImpl.TTP_TOKEN,
+ this.deviceTransactionManager);
TerminationPoint1 updatedTerminationPoint1 = WaveLengthServiceUtils
- .getTerminationPoint1FromDatastore("node1", "node1-" + OpenRoadmInterfacesImpl.TTP_TOKEN,
+ .getTerminationPoint1FromDatastore("node1" + OpenRoadmInterfacesImpl.TTP_TOKEN,
+ OpenRoadmInterfacesImpl.TTP_TOKEN,
this.deviceTransactionManager);
switch (updatedTerminationPoint1.getTpType()) {
}
@Parameterized.Parameters
- public static Collection primeNumbers() {
+ public static Collection nodes() {
NodeIdPair same = new NodeIdPair("nodeS", "CLIENT");
return Arrays.asList(new Object[][] {
{ new NodeIdPair("",""), null, false },
@Test
public void equalityTest() {
Assert.assertEquals(this.equality, firstPair.equals(this.secondPair));
- if (this.secondPair != null && this.firstPair.getClass().equals(this.secondPair.getClass())) {
+ if ((this.secondPair != null) && this.firstPair.getClass().equals(this.secondPair.getClass())) {
Assert.assertEquals(this.equality, this.firstPair.hashCode() == this.secondPair.hashCode());
}
}
--- /dev/null
+/*
+ * Copyright © 2018 Orange Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.transportpce.renderer.provisiondevice;
+
+import java.util.ArrayList;
+import org.junit.Assert;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.opendaylight.controller.md.sal.binding.api.MountPoint;
+import org.opendaylight.controller.md.sal.binding.api.MountPointService;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnect;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl;
+import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
+import org.opendaylight.transportpce.common.device.DeviceTransactionManagerImpl;
+import org.opendaylight.transportpce.common.mapping.PortMapping;
+import org.opendaylight.transportpce.common.mapping.PortMappingImpl;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
+import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterfaceFactory;
+import org.opendaylight.transportpce.renderer.stub.MountPointServiceStub;
+import org.opendaylight.transportpce.renderer.utils.CreateOtsOmsDataUtils;
+import org.opendaylight.transportpce.renderer.utils.MountPointUtils;
+import org.opendaylight.transportpce.test.AbstractTest;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.CreateOtsOmsInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.CreateOtsOmsOutput;
+
+public class DeviceRendererServiceImplCreateOtsOmsTest extends AbstractTest {
+
+ private DeviceRendererService deviceRendererService;
+ private CrossConnect crossConnect;
+ private OpenRoadmInterfaces openRoadmInterfaces;
+ private OpenRoadmInterfaceFactory openRoadmInterfaceFactory;
+ private DeviceTransactionManager deviceTransactionManager;
+
+ private void setMountPoint(MountPoint mountPoint) {
+ MountPointService mountPointService = new MountPointServiceStub(mountPoint);
+ this.deviceTransactionManager = new DeviceTransactionManagerImpl(mountPointService, 3000);
+ this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(this.deviceTransactionManager);
+ this.openRoadmInterfaces = Mockito.spy(this.openRoadmInterfaces);
+ PortMapping portMapping = new PortMappingImpl(this.getDataBroker(), this.deviceTransactionManager,
+ this.openRoadmInterfaces);
+ this.openRoadmInterfaceFactory = new OpenRoadmInterfaceFactory(portMapping,
+ this.openRoadmInterfaces);
+ this.crossConnect = new CrossConnectImpl(this.deviceTransactionManager);
+ this.crossConnect = Mockito.spy(this.crossConnect);
+ this.deviceRendererService = new DeviceRendererServiceImpl(this.getDataBroker(),
+ this.deviceTransactionManager, this.openRoadmInterfaceFactory, this.openRoadmInterfaces,
+ this.crossConnect, portMapping);
+ }
+
+ @Test
+ public void testCreateOtsOmsWhenDeviceIsNotMounted() throws OpenRoadmInterfaceException {
+ setMountPoint(null);
+ CreateOtsOmsInput input = CreateOtsOmsDataUtils.buildCreateOtsOms();
+ CreateOtsOmsOutput result = this.deviceRendererService.createOtsOms(input);
+ Assert.assertFalse(result.isSuccess());
+ Assert.assertEquals("node 1 is not mounted on the controller",
+ result.getResult());
+ }
+
+ @Test
+ public void testCreateOtsOmsWhenDeviceIsMountedWithNoMapping() throws OpenRoadmInterfaceException {
+ setMountPoint(MountPointUtils.getMountPoint(new ArrayList<>(), getDataBroker()));
+ CreateOtsOmsInput input = CreateOtsOmsDataUtils.buildCreateOtsOms();
+ CreateOtsOmsOutput result = this.deviceRendererService.createOtsOms(input);
+ Assert.assertFalse(result.isSuccess());
+ }
+
+ @Test
+ public void testCreateOtsOmsWhenDeviceIsMountedWithMapping() throws OpenRoadmInterfaceException {
+ setMountPoint(MountPointUtils.getMountPoint(new ArrayList<>(), getDataBroker()));
+ CreateOtsOmsInput input = CreateOtsOmsDataUtils.buildCreateOtsOms();
+ writePortMapping(input);
+ CreateOtsOmsOutput result = this.deviceRendererService.createOtsOms(input);
+ Assert.assertTrue(result.isSuccess());
+ }
+
+ private void writePortMapping(CreateOtsOmsInput input) {
+ MountPointUtils.writeMapping(
+ input.getNodeId(),
+ input.getLogicalConnectionPoint(),
+ this.deviceTransactionManager
+ );
+ }
+
+}
--- /dev/null
+/*
+ * Copyright © 2018 Orange Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.transportpce.renderer.provisiondevice;
+
+import com.google.common.util.concurrent.ListeningExecutorService;
+import com.google.common.util.concurrent.MoreExecutors;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Executors;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.opendaylight.controller.md.sal.binding.api.MountPoint;
+import org.opendaylight.controller.md.sal.binding.api.MountPointService;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.transportpce.common.ResponseCodes;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnect;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl;
+import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
+import org.opendaylight.transportpce.common.device.DeviceTransactionManagerImpl;
+import org.opendaylight.transportpce.common.mapping.PortMapping;
+import org.opendaylight.transportpce.common.mapping.PortMappingImpl;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
+import org.opendaylight.transportpce.renderer.NetworkModelWavelengthService;
+import org.opendaylight.transportpce.renderer.NetworkModelWavelengthServiceImpl;
+import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterfaceFactory;
+import org.opendaylight.transportpce.renderer.stub.MountPointServiceStub;
+import org.opendaylight.transportpce.renderer.stub.MountPointStub;
+import org.opendaylight.transportpce.renderer.stub.OlmServiceStub;
+import org.opendaylight.transportpce.renderer.utils.ServiceDeleteDataUtils;
+import org.opendaylight.transportpce.renderer.utils.TransactionUtils;
+import org.opendaylight.transportpce.test.AbstractTest;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.service.handler.header.ServiceHandlerHeaderBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceDeleteOutput;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServicePathList;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.path.list.ServicePaths;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.path.list.ServicePathsBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.service.path.list.ServicePathsKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.OlmService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerTurndownOutputBuilder;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+
+public class RendererServiceOperationsImplDeleteTest extends AbstractTest {
+
+ private static final int NUMBER_OF_THREADS = 4;
+ private DeviceTransactionManager deviceTransactionManager;
+ private RendererServiceOperationsImpl rendererServiceOperations;
+ private OpenRoadmInterfaces openRoadmInterfaces;
+ private DeviceRendererService deviceRenderer;
+ private PortMapping portMapping;
+ private CrossConnect crossConnect;
+ private NetworkModelWavelengthService networkModelWavelengthService;
+ private OlmService olmService;
+
+ private void setMountPoint(MountPoint mountPoint) {
+ MountPointService mountPointService = new MountPointServiceStub(mountPoint);
+ this.deviceTransactionManager = new DeviceTransactionManagerImpl(mountPointService, 3000);
+ this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(this.deviceTransactionManager);
+ this.portMapping = new PortMappingImpl(this.getDataBroker(), this.deviceTransactionManager,
+ openRoadmInterfaces);
+ OpenRoadmInterfaceFactory openRoadmInterfaceFactory = new OpenRoadmInterfaceFactory(portMapping,
+ openRoadmInterfaces);
+ this.crossConnect = new CrossConnectImpl(this.deviceTransactionManager);
+ this.crossConnect = Mockito.spy(crossConnect);
+ this.deviceRenderer = new DeviceRendererServiceImpl(this.getDataBroker(),
+ this.deviceTransactionManager, openRoadmInterfaceFactory, openRoadmInterfaces, crossConnect,
+ this.portMapping);
+ }
+
+ @Before
+ public void setUp() {
+ setMountPoint(new MountPointStub(getDataBroker()));
+ this.olmService = new OlmServiceStub();
+ this.olmService = Mockito.spy(this.olmService);
+ ListeningExecutorService executor =
+ MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(NUMBER_OF_THREADS));
+ this.networkModelWavelengthService = new NetworkModelWavelengthServiceImpl(getDataBroker());
+ this.rendererServiceOperations = new RendererServiceOperationsImpl(this.deviceRenderer, olmService,
+ getDataBroker(), this.networkModelWavelengthService);
+
+ }
+
+
+ @Test
+ public void serviceDeleteOperationPp() throws ExecutionException, InterruptedException {
+ writePathDescription();
+ ServiceDeleteInputBuilder serviceDeleteInputBuilder = new ServiceDeleteInputBuilder();
+ serviceDeleteInputBuilder.setServiceName("service 1");
+ serviceDeleteInputBuilder.setServiceHandlerHeader((new ServiceHandlerHeaderBuilder())
+ .setRequestId("request1").build());
+ Mockito.doReturn(true).when(this.crossConnect).deleteCrossConnect(Mockito.anyString(), Mockito.anyString());
+ ServiceDeleteOutput serviceDeleteOutput
+ = this.rendererServiceOperations.serviceDelete(serviceDeleteInputBuilder.build());
+ Assert.assertEquals(ResponseCodes.RESPONSE_OK,
+ serviceDeleteOutput.getConfigurationResponseCommon().getResponseCode());
+ Mockito.verify(this.crossConnect, Mockito.times(2)).deleteCrossConnect(Mockito.any(), Mockito.any());
+ }
+
+ @Test
+ public void serviceDeleteOperationNoDescription() {
+ ServiceDeleteInputBuilder serviceDeleteInputBuilder = new ServiceDeleteInputBuilder();
+ serviceDeleteInputBuilder.setServiceName("service 1");
+ ServiceDeleteOutput serviceDeleteOutput
+ = this.rendererServiceOperations.serviceDelete(serviceDeleteInputBuilder.build());
+ Assert.assertEquals(ResponseCodes.RESPONSE_FAILED,
+ serviceDeleteOutput.getConfigurationResponseCommon().getResponseCode());
+ Mockito.verify(this.crossConnect, Mockito.times(0)).deleteCrossConnect(Mockito.any(), Mockito.any());
+ }
+
+ @Test
+ public void serviceDeleteOperationTearDownFailedAtoZ() throws ExecutionException, InterruptedException {
+ Mockito.doReturn(true).when(this.crossConnect).deleteCrossConnect(Mockito.anyString(), Mockito.anyString());
+ Mockito.doReturn(RpcResultBuilder.success((new ServicePowerTurndownOutputBuilder())
+ .setResult("Failed").build()).buildFuture()).when(this.olmService).servicePowerTurndown(Mockito.any());
+
+ writePathDescription();
+ ServiceDeleteInputBuilder serviceDeleteInputBuilder = new ServiceDeleteInputBuilder();
+ serviceDeleteInputBuilder.setServiceName("service 1");
+ serviceDeleteInputBuilder.setServiceHandlerHeader((new ServiceHandlerHeaderBuilder())
+ .setRequestId("request1").build());
+ ServiceDeleteOutput serviceDeleteOutput
+ = this.rendererServiceOperations.serviceDelete(serviceDeleteInputBuilder.build());
+ Assert.assertEquals(ResponseCodes.RESPONSE_FAILED,
+ serviceDeleteOutput.getConfigurationResponseCommon().getResponseCode());
+ Mockito.verify(this.crossConnect, Mockito.times(0)).deleteCrossConnect(Mockito.eq("node1"), Mockito.any());
+ Mockito.verify(this.crossConnect, Mockito.times(0)).deleteCrossConnect(Mockito.eq("node2"), Mockito.any());
+ }
+
+ @Test
+ public void serviceDeleteOperationTearDownFailedZtoA() throws ExecutionException, InterruptedException {
+ Mockito.doReturn(true).when(this.crossConnect).deleteCrossConnect(Mockito.anyString(), Mockito.anyString());
+ Mockito.when(this.olmService.servicePowerTurndown(Mockito.any()))
+ .thenReturn(RpcResultBuilder.success((new ServicePowerTurndownOutputBuilder())
+ .setResult("Success").build()).buildFuture())
+ .thenReturn(RpcResultBuilder.success((new ServicePowerTurndownOutputBuilder())
+ .setResult("Failed").build()).buildFuture());
+
+ writePathDescription();
+ ServiceDeleteInputBuilder serviceDeleteInputBuilder = new ServiceDeleteInputBuilder();
+ serviceDeleteInputBuilder.setServiceName("service 1");
+ serviceDeleteInputBuilder.setServiceHandlerHeader((new ServiceHandlerHeaderBuilder())
+ .setRequestId("request1").build());
+ ServiceDeleteOutput serviceDeleteOutput =
+ this.rendererServiceOperations.serviceDelete(serviceDeleteInputBuilder.build());
+ Assert.assertEquals(ResponseCodes.RESPONSE_FAILED,
+ serviceDeleteOutput.getConfigurationResponseCommon().getResponseCode());
+ Mockito.verify(this.olmService, Mockito.times(2)).servicePowerTurndown(Mockito.any());
+ Mockito.verify(this.crossConnect, Mockito.times(0)).deleteCrossConnect(Mockito.eq("node1"), Mockito.any());
+ Mockito.verify(this.crossConnect, Mockito.times(0)).deleteCrossConnect(Mockito.eq("node2"), Mockito.any());
+ }
+
+ private void writePathDescription() throws ExecutionException, InterruptedException {
+ ServicePathsBuilder servicePathsBuilder = new ServicePathsBuilder();
+ servicePathsBuilder.setPathDescription(ServiceDeleteDataUtils
+ .createTransactionPathDescription(OpenRoadmInterfacesImpl.PP_TOKEN));
+ servicePathsBuilder.setServiceAEnd(ServiceDeleteDataUtils.getServiceAEndBuild().build())
+ .setServiceZEnd(ServiceDeleteDataUtils.getServiceZEndBuild().build());
+ servicePathsBuilder.withKey(new ServicePathsKey("service 1"));
+ servicePathsBuilder.setServiceHandlerHeader(new ServiceHandlerHeaderBuilder().setRequestId("Request 1")
+ .build());
+ InstanceIdentifier<ServicePaths> servicePathsInstanceIdentifier = InstanceIdentifier.create(
+ ServicePathList.class).child(ServicePaths.class, new ServicePathsKey("service 1"));
+ TransactionUtils.writeTransaction(
+ this.deviceTransactionManager,
+ "node1" + OpenRoadmInterfacesImpl.PP_TOKEN,
+ LogicalDatastoreType.OPERATIONAL,
+ servicePathsInstanceIdentifier,
+ servicePathsBuilder.build());
+ }
+}
--- /dev/null
+/*
+ * Copyright © 2018 Orange Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.transportpce.renderer.provisiondevice;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.opendaylight.controller.md.sal.binding.api.MountPoint;
+import org.opendaylight.controller.md.sal.binding.api.MountPointService;
+import org.opendaylight.transportpce.common.ResponseCodes;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnect;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl;
+import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
+import org.opendaylight.transportpce.common.device.DeviceTransactionManagerImpl;
+import org.opendaylight.transportpce.common.mapping.PortMapping;
+import org.opendaylight.transportpce.common.mapping.PortMappingImpl;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
+import org.opendaylight.transportpce.renderer.NetworkModelWavelengthService;
+import org.opendaylight.transportpce.renderer.NetworkModelWavelengthServiceImpl;
+import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterfaceFactory;
+import org.opendaylight.transportpce.renderer.stub.MountPointServiceStub;
+import org.opendaylight.transportpce.renderer.stub.MountPointStub;
+import org.opendaylight.transportpce.renderer.stub.OlmServiceStub;
+import org.opendaylight.transportpce.renderer.utils.MountPointUtils;
+import org.opendaylight.transportpce.renderer.utils.ServiceDataUtils;
+import org.opendaylight.transportpce.test.AbstractTest;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev161014.PmGranularity;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.types.rev161014.ResourceTypeEnum;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestInput;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.ServiceImplementationRequestOutput;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev170907.olm.get.pm.input.ResourceIdentifierBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.OlmService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.get.pm.output.Measurements;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.get.pm.output.MeasurementsBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.ServicePathOutputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+
+public class RendererServiceOperationsImplTest extends AbstractTest {
+
+ private MountPointService mountPointService;
+ private DeviceTransactionManager deviceTransactionManager;
+ private RendererServiceOperationsImpl rendererServiceOperations;
+ private OpenRoadmInterfaces openRoadmInterfaces;
+ private DeviceRendererService deviceRenderer;
+ private PortMapping portMapping;
+ private OpenRoadmInterfaceFactory openRoadmInterfaceFactory;
+ private CrossConnect crossConnect;
+ private OlmService olmService;
+ private NetworkModelWavelengthService networkModelWavelengthService;
+
+ private void setMountPoint(MountPoint mountPoint) {
+ this.mountPointService = new MountPointServiceStub(mountPoint);
+ this.deviceTransactionManager = new DeviceTransactionManagerImpl(this.mountPointService, 3000);
+ this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(this.deviceTransactionManager);
+ this.openRoadmInterfaces = Mockito.spy(this.openRoadmInterfaces);
+ this.portMapping = new PortMappingImpl(this.getDataBroker(), this.deviceTransactionManager,
+ openRoadmInterfaces);
+ this.openRoadmInterfaceFactory = new OpenRoadmInterfaceFactory(portMapping,
+ openRoadmInterfaces);
+ this.crossConnect = new CrossConnectImpl(this.deviceTransactionManager);
+ }
+
+ @Before
+ public void setUp() throws OpenRoadmInterfaceException {
+ setMountPoint(new MountPointStub(getDataBroker()));
+ this.olmService = new OlmServiceStub();
+ this.networkModelWavelengthService = new NetworkModelWavelengthServiceImpl(getDataBroker());
+ this.deviceRenderer = new DeviceRendererServiceImpl(this.getDataBroker(),
+ this.deviceTransactionManager, openRoadmInterfaceFactory, openRoadmInterfaces, crossConnect, portMapping);
+ Mockito.doNothing().when(this.openRoadmInterfaces).postEquipmentState(Mockito.anyString(),
+ Mockito.anyString(), Mockito.anyBoolean());
+
+ this.olmService = Mockito.spy(this.olmService);
+ this.deviceRenderer = Mockito.spy(this.deviceRenderer);
+ this.rendererServiceOperations = new RendererServiceOperationsImpl(this.deviceRenderer, this.olmService,
+ getDataBroker(), this.networkModelWavelengthService);
+
+ ServicePathOutputBuilder mockOutputBuilder = new ServicePathOutputBuilder().setResult("success")
+ .setSuccess(true);
+ Mockito.doReturn(mockOutputBuilder.build()).when(this.deviceRenderer).setupServicePath(Mockito.any(),
+ Mockito.any());
+ }
+
+ @Test
+ public void serviceImplementationTerminationPointAsResourceTtp() {
+
+ ServiceImplementationRequestInput input = ServiceDataUtils
+ .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.TTP_TOKEN);
+ writePortMapping(input, OpenRoadmInterfacesImpl.TTP_TOKEN);
+ ServicePathOutputBuilder mockOutputBuilder = new ServicePathOutputBuilder().setResult("success")
+ .setSuccess(true);
+ Mockito.doReturn(mockOutputBuilder.build()).when(this.deviceRenderer).setupServicePath(Mockito.any(),
+ Mockito.any());
+ ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+ Assert.assertEquals(ResponseCodes.RESPONSE_OK, result.getConfigurationResponseCommon().getResponseCode());
+
+ }
+
+ @Test
+ public void serviceImplementationTerminationPointAsResourceTtp2() {
+
+ ServiceImplementationRequestInput input = ServiceDataUtils
+ .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.TTP_TOKEN);
+ writePortMapping(input, OpenRoadmInterfacesImpl.TTP_TOKEN);
+ ServicePathOutputBuilder mockOutputBuilder = new ServicePathOutputBuilder().setResult("success")
+ .setSuccess(true);
+ Mockito.doReturn(mockOutputBuilder.build()).when(this.deviceRenderer).setupServicePath(Mockito.any(),
+ Mockito.any());
+ Mockito.doReturn(RpcResultBuilder.failed().buildFuture()).when(this.olmService)
+ .servicePowerSetup(Mockito.any());
+ ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+ Assert.assertEquals(ResponseCodes.RESPONSE_FAILED, result.getConfigurationResponseCommon().getResponseCode());
+
+ }
+
+ @Test
+ public void serviceImplementationTerminationPointAsResourcePp() {
+
+ ServiceImplementationRequestInput input = ServiceDataUtils
+ .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.PP_TOKEN);
+ writePortMapping(input, OpenRoadmInterfacesImpl.PP_TOKEN);
+ ServicePathOutputBuilder mockOutputBuilder = new ServicePathOutputBuilder().setResult("success")
+ .setSuccess(true);
+ Mockito.doReturn(mockOutputBuilder.build()).when(this.deviceRenderer).setupServicePath(Mockito.any(),
+ Mockito.any());
+ ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+ Assert.assertEquals(ResponseCodes.RESPONSE_OK, result.getConfigurationResponseCommon().getResponseCode());
+
+ }
+
+ @Test
+ public void serviceImplementationTerminationPointAsResourceNetwork() {
+
+ ServiceImplementationRequestInput input = ServiceDataUtils
+ .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ writePortMapping(input, OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ ServicePathOutputBuilder mockOutputBuilder = new ServicePathOutputBuilder().setResult("success")
+ .setSuccess(true);
+ Mockito.doReturn(mockOutputBuilder.build()).when(this.deviceRenderer).setupServicePath(Mockito.any(),
+ Mockito.any());
+ ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+ Assert.assertEquals(ResponseCodes.RESPONSE_OK, result.getConfigurationResponseCommon().getResponseCode());
+
+ }
+
+ @Test
+ public void serviceImplementationTerminationPointAsResourceClient() {
+
+ ServiceImplementationRequestInput input = ServiceDataUtils
+ .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.CLIENT_TOKEN);
+ writePortMapping(input, OpenRoadmInterfacesImpl.CLIENT_TOKEN);
+ ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+ Assert.assertEquals(ResponseCodes.RESPONSE_OK, result.getConfigurationResponseCommon().getResponseCode());
+ }
+
+ @Test
+ public void serviceImplementationTerminationPointAsResourceNoMapping() {
+
+ String[] interfaceTokens = {
+ OpenRoadmInterfacesImpl.NETWORK_TOKEN,
+ OpenRoadmInterfacesImpl.CLIENT_TOKEN,
+ OpenRoadmInterfacesImpl.TTP_TOKEN,
+ OpenRoadmInterfacesImpl.PP_TOKEN
+ };
+
+ ServicePathOutputBuilder mockOutputBuilder = new ServicePathOutputBuilder().setResult("failed")
+ .setSuccess(false);
+ Mockito.doReturn(mockOutputBuilder.build()).when(this.deviceRenderer).setupServicePath(Mockito.any(),
+ Mockito.any());
+
+ for (String tpToken : interfaceTokens) {
+ ServiceImplementationRequestInput input = ServiceDataUtils
+ .buildServiceImplementationRequestInputTerminationPointResource(tpToken);
+ ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+ Assert.assertEquals(ResponseCodes.RESPONSE_FAILED,
+ result.getConfigurationResponseCommon().getResponseCode());
+ }
+ }
+
+ private void writePortMapping(ServiceImplementationRequestInput input, String tpToken) {
+ MountPointUtils.writeMapping(
+ input.getServiceAEnd().getNodeId(),
+ input.getServiceAEnd().getNodeId() + "-" + tpToken,
+ this.deviceTransactionManager
+ );
+ MountPointUtils.writeMapping(
+ input.getServiceZEnd().getNodeId(),
+ input.getServiceZEnd().getNodeId() + "-"
+ + input.getServiceAEnd().getNodeId() + "-" + tpToken,
+ this.deviceTransactionManager
+ );
+ MountPointUtils.writeMapping(
+ input.getServiceAEnd().getNodeId(),
+ input.getServiceAEnd().getNodeId() + "-"
+ + input.getServiceZEnd().getNodeId() + "-" + tpToken,
+ this.deviceTransactionManager
+ );
+ MountPointUtils.writeMapping(
+ input.getServiceZEnd().getNodeId(),
+ input.getServiceZEnd().getNodeId() + "-" + tpToken,
+ this.deviceTransactionManager
+ );
+ }
+
+ @Test
+ public void serviceImplementationRollbackAllNecessary() {
+
+ ServiceImplementationRequestInput input = ServiceDataUtils
+ .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ writePortMapping(input, OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ Mockito.doReturn(RpcResultBuilder.failed().buildFuture()).when(this.olmService)
+ .servicePowerSetup(Mockito.any());
+ ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+ Assert.assertEquals(ResponseCodes.RESPONSE_FAILED, result.getConfigurationResponseCommon().getResponseCode());
+
+ }
+
+ private GetPmInput createGetPmInput(String nodeId, String tp) {
+ GetPmInputBuilder getPmIpBldr = new GetPmInputBuilder();
+ getPmIpBldr.setNodeId(nodeId);
+ getPmIpBldr.setGranularity(PmGranularity._15min);
+ ResourceIdentifierBuilder rsrcBldr = new ResourceIdentifierBuilder();
+ rsrcBldr.setResourceName(tp + "-OTU");
+ getPmIpBldr.setResourceIdentifier(rsrcBldr.build());
+ getPmIpBldr.setResourceType(ResourceTypeEnum.Interface);
+ return getPmIpBldr.build();
+ }
+
+ @Test
+ public void serviceImplementationServiceInActive() {
+
+ ServiceImplementationRequestInput input = ServiceDataUtils
+ .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ writePortMapping(input, OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ Measurements measurements = new MeasurementsBuilder().setPmparameterName("FECUncorrectableBlocks")
+ .setPmparameterValue("1").build();
+ List<Measurements> measurementsList = new ArrayList<Measurements>();
+ measurementsList.add(measurements);
+ GetPmOutput getPmOutput = new GetPmOutputBuilder()
+ .setNodeId("node1").setMeasurements(measurementsList).build();
+ Mockito.doReturn(RpcResultBuilder.success(getPmOutput).buildFuture()).when(this.olmService)
+ .getPm(Mockito.any());
+ ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+ Assert.assertEquals(ResponseCodes.RESPONSE_FAILED, result.getConfigurationResponseCommon().getResponseCode());
+
+ }
+
+ @Test
+ public void serviceImplementationServiceInActive2() {
+
+ ServiceImplementationRequestInput input = ServiceDataUtils
+ .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ writePortMapping(input, OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ Measurements measurements = new MeasurementsBuilder().setPmparameterName("FECUncorrectableBlocks")
+ .setPmparameterValue("1").build();
+ List<Measurements> measurementsList = new ArrayList<Measurements>();
+ measurementsList.add(measurements);
+ GetPmOutput getPmOutput = new GetPmOutputBuilder()
+ .setNodeId("node1").setMeasurements(measurementsList).build();
+ GetPmOutput getPmOutput2 = new GetPmOutputBuilder()
+ .setNodeId("node1").setMeasurements(new ArrayList<>()).build();
+
+ Mockito.when(this.olmService.getPm(Mockito.any()))
+ .thenReturn(RpcResultBuilder.success(getPmOutput).buildFuture());
+ ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+ Assert.assertEquals(ResponseCodes.RESPONSE_FAILED, result.getConfigurationResponseCommon().getResponseCode());
+
+ }
+
+ @Test
+ public void serviceImplementationServiceInActive3() {
+
+ ServiceImplementationRequestInput input = ServiceDataUtils
+ .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ writePortMapping(input, OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ Measurements measurements = new MeasurementsBuilder().setPmparameterName("FECUncorrectableBlocks")
+ .setPmparameterValue("1").build();
+ List<Measurements> measurementsList = new ArrayList<Measurements>();
+ measurementsList.add(measurements);
+ GetPmOutput getPmOutput = new GetPmOutputBuilder()
+ .setNodeId("node1").setMeasurements(measurementsList).build();
+ GetPmOutput getPmOutput2 = new GetPmOutputBuilder()
+ .setNodeId("node1").setMeasurements(new ArrayList<>()).build();
+
+ GetPmInput getPmInputZ = createGetPmInput("XPONDER-2-3",
+ OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ GetPmInput getPmInputA = createGetPmInput("XPONDER-1-2",
+ OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+
+ Mockito.when(this.olmService.getPm(Mockito.eq(getPmInputZ)))
+ .thenReturn(RpcResultBuilder.success(getPmOutput2).buildFuture());
+ Mockito.when(this.olmService.getPm(Mockito.eq(getPmInputA)))
+ .thenReturn(RpcResultBuilder.success(getPmOutput).buildFuture());
+ ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+ Assert.assertEquals(ResponseCodes.RESPONSE_FAILED, result.getConfigurationResponseCommon().getResponseCode());
+
+ }
+
+ @Test
+ public void serviceImplementationServiceActive() {
+
+ ServiceImplementationRequestInput input = ServiceDataUtils
+ .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ writePortMapping(input, OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ GetPmOutput getPmOutput = new GetPmOutputBuilder()
+ .setNodeId("node1").setMeasurements(new ArrayList<>()).build();
+ GetPmOutput getPmOutput1 = null;
+ Mockito.when(this.olmService.getPm(Mockito.any())).thenReturn(RpcResultBuilder.success(getPmOutput1)
+ .buildFuture());
+ ServicePathOutputBuilder mockOutputBuilder = new ServicePathOutputBuilder().setResult("success")
+ .setSuccess(true);
+ Mockito.doReturn(mockOutputBuilder.build()).when(this.deviceRenderer).setupServicePath(Mockito.any(),
+ Mockito.any());
+ ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+ Assert.assertEquals(ResponseCodes.RESPONSE_OK, result.getConfigurationResponseCommon().getResponseCode());
+
+ }
+
+ @Test
+ public void serviceImplementationServiceActive2() {
+
+ ServiceImplementationRequestInput input = ServiceDataUtils
+ .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ writePortMapping(input, OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ GetPmOutput getPmOutput = new GetPmOutputBuilder().setMeasurements(new ArrayList<>()).build();
+ Mockito.when(this.olmService.getPm(Mockito.any())).thenReturn(RpcResultBuilder.success(getPmOutput)
+ .buildFuture());
+ ServicePathOutputBuilder mockOutputBuilder = new ServicePathOutputBuilder().setResult("success")
+ .setSuccess(true);
+ Mockito.doReturn(mockOutputBuilder.build()).when(this.deviceRenderer).setupServicePath(Mockito.any(),
+ Mockito.any());
+ ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+ Assert.assertEquals(ResponseCodes.RESPONSE_OK, result.getConfigurationResponseCommon().getResponseCode());
+
+ }
+
+ @Test
+ public void serviceImplementationServiceInActive4() {
+
+ ServiceImplementationRequestInput input = ServiceDataUtils
+ .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ writePortMapping(input, OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ Measurements measurements = new MeasurementsBuilder().setPmparameterName("preFECCorrectedErrors")
+ .setPmparameterValue("1").build();
+ List<Measurements> measurementsList = new ArrayList<Measurements>();
+ measurementsList.add(measurements);
+ GetPmOutput getPmOutput = new GetPmOutputBuilder()
+ .setNodeId("node1").setMeasurements(measurementsList).build();
+
+ Mockito.doReturn(RpcResultBuilder.success(getPmOutput).buildFuture()).when(this.olmService)
+ .getPm(Mockito.any());
+ ServicePathOutputBuilder mockOutputBuilder = new ServicePathOutputBuilder().setResult("success")
+ .setSuccess(true);
+ Mockito.doReturn(mockOutputBuilder.build()).when(this.deviceRenderer).setupServicePath(Mockito.any(),
+ Mockito.any());
+ ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+ Assert.assertEquals(ResponseCodes.RESPONSE_OK, result.getConfigurationResponseCommon().getResponseCode());
+
+ }
+
+ @Test
+ public void serviceImplementationServiceInActive5() {
+
+ ServiceImplementationRequestInput input = ServiceDataUtils
+ .buildServiceImplementationRequestInputTerminationPointResource(OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ writePortMapping(input, OpenRoadmInterfacesImpl.NETWORK_TOKEN);
+ Measurements measurements = new MeasurementsBuilder().setPmparameterName("preFECCorrectedErrors")
+ .setPmparameterValue("112000000000d").build();
+ List<Measurements> measurementsList = new ArrayList<Measurements>();
+ measurementsList.add(measurements);
+ GetPmOutput getPmOutput = new GetPmOutputBuilder()
+ .setNodeId("node1").setMeasurements(measurementsList).build();
+
+ Mockito.doReturn(RpcResultBuilder.success(getPmOutput).buildFuture()).when(this.olmService)
+ .getPm(Mockito.any());
+ ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
+ Assert.assertEquals(ResponseCodes.RESPONSE_FAILED, result.getConfigurationResponseCommon().getResponseCode());
+
+ }
+}
--- /dev/null
+/*
+ * Copyright © 2018 Orange Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.transportpce.renderer.utils;
+
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.CreateOtsOmsInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.CreateOtsOmsInputBuilder;
+
+public final class CreateOtsOmsDataUtils {
+
+ private CreateOtsOmsDataUtils() {
+
+ }
+
+ public static CreateOtsOmsInput buildCreateOtsOms() {
+ CreateOtsOmsInputBuilder builder = new CreateOtsOmsInputBuilder()
+ .setLogicalConnectionPoint("logical point")
+ .setNodeId("node 1");
+ return builder.build();
+ }
+}
}
private MountPointUtils() {
+
}
}
ServiceImplementationRequestInputBuilder builder = new ServiceImplementationRequestInputBuilder()
.setServiceName("service 1").setPathDescription(createPathDescriptionTerminationPointResource(tpId))
.setServiceHandlerHeader(new ServiceHandlerHeaderBuilder().setRequestId("Request 1").build())
- .setServiceAEnd(getServiceAEndBuild().build())
- .setServiceZEnd(getServiceZEndBuild().build());
+ .setServiceAEnd(getServiceAEndBuild(tpId).build())
+ .setServiceZEnd(getServiceZEndBuild(tpId).build());
return builder.build();
}
- public static ServiceImplementationRequestInput buildServiceImplementationRequestInputInvalidResource() {
+ /*public static ServiceImplementationRequestInput buildServiceImplementationRequestInputInvalidResource() {
ServiceImplementationRequestInputBuilder builder = new ServiceImplementationRequestInputBuilder()
.setServiceName("service 1").setPathDescription(createPathDescriptionInvalidResource())
.setServiceHandlerHeader(new ServiceHandlerHeaderBuilder().setRequestId("Request 1").build())
.setServiceAEnd(getServiceAEndBuild().build())
.setServiceZEnd(getServiceZEndBuild().build());
return builder.build();
- }
+ }*/
private static PathDescription createPathDescriptionInvalidResource() {
List<AToZ> atoZList = new ArrayList<AToZ>();
for (String nodeId : nodeIds) {
for (String otherNodeId : nodeIds) {
TerminationPoint terminationPoint = terminationPointBuilder
- .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder().setNodeId(nodeId)
- .setTpId((nodeId.equals(otherNodeId) ? "" : nodeId + "-") + otherNodeId + "-" + tpId).build())
+ .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder().setNodeId(nodeId + '-'
+ + tpId)
+ .setTpId(tpId).build())
.build();
AToZ atoZ = new AToZBuilder().setId(atozId.toString())
.withKey(new AToZKey(atozId.toString())).setResource(new ResourceBuilder()
for (String nodeId : nodeIds) {
for (String otherNodeId : nodeIds) {
TerminationPoint terminationPoint = terminationPointBuilder
- .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder().setNodeId(nodeId)
- .setTpId((nodeId.equals(otherNodeId) ? "" : nodeId + "-") + otherNodeId + "-" + tpId).build())
+ .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder().setNodeId(nodeId + '-'
+ + tpId)
+ .setTpId(tpId).build())
.build();
ZToA ztoA = new ZToABuilder().setId(ztoaId.toString())
.withKey(new ZToAKey(ztoaId.toString())).setResource(new ResourceBuilder()
return builder.build();
}
- public static ServiceAEndBuilder getServiceAEndBuild() {
+ public static ServiceAEndBuilder getServiceAEndBuild(String tpId) {
return new ServiceAEndBuilder()
- .setClli("clli").setServiceFormat(ServiceFormat.OC).setServiceRate((long) 1).setNodeId("XPONDER-1-2")
+ .setClli("clli").setServiceFormat(ServiceFormat.OC).setServiceRate((long) 1).setNodeId("XPONDER-1-2-"
+ + tpId)
.setTxDirection(
new TxDirectionBuilder()
.setPort(new PortBuilder().setPortDeviceName("device name").setPortName("port name")
.build());
}
- public static ServiceZEndBuilder getServiceZEndBuild() {
+ public static ServiceZEndBuilder getServiceZEndBuild(String tpId) {
return new ServiceZEndBuilder()
- .setClli("clli").setServiceFormat(ServiceFormat.OC).setServiceRate((long) 1).setNodeId("XPONDER-2-3")
+ .setClli("clli").setServiceFormat(ServiceFormat.OC).setServiceRate((long) 1).setNodeId("XPONDER-2-3-"
+ + tpId)
.setTxDirection(
new TxDirectionBuilder()
.setPort(new PortBuilder().setPortDeviceName("device name").setPortName("port name")
List<AToZ> atoZList = new ArrayList<AToZ>();
TerminationPointBuilder terminationPointBuilder = new TerminationPointBuilder();
TerminationPoint terminationPoint = terminationPointBuilder
- .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder().setNodeId("node2")
- .setTpId("node2-" + tpId).build()).build();
+ .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder().setNodeId("node2" + tpId)
+ .setTpId(tpId).build()).build();
TerminationPoint terminationPoint2 = terminationPointBuilder
- .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder().setNodeId("node1")
- .setTpId("node1-" + tpId).build()).build();
+ .setTerminationPointIdentifier(new TerminationPointIdentifierBuilder().setNodeId("node1" + tpId)
+ .setTpId(tpId).build()).build();
AToZ atoZ = new AToZBuilder().setId("1").withKey(new AToZKey("1")).setResource(new ResourceBuilder()
.setResource(terminationPoint).build()).build();
AToZ atoZ2 = new AToZBuilder().setId("2").withKey(new AToZKey("2")).setResource(new ResourceBuilder()
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>0.13.0-SNAPSHOT</version>
+ <version>0.14.0-SNAPSHOT</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-servicehandler</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<dependencyManagement>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>1.8.0-SNAPSHOT</version>
+ <version>1.9.0-SNAPSHOT</version>
<scope>import</scope>
<type>pom</type>
</dependency>
/**
* function to check coherency between hard and soft constraints.
+ * @param hard Hard Constraints
+ * @param soft Soft Constraints
+ *
* @return <code> true </code> if coherent
* <code> false </code> else
*/
/**
* Check Compliancy of Service request.
*
+ * @param serviceName
+ * Service Name
+ * @param sdncRequestHeader
+ * sdncRequestHeader
+ * @param conType
+ * Connection type
+ * @param action
+ * RPC Actions
* @param contype
* Boolean to check connection Type
- * @param sndcRequest
- * Boolean to check sndcRequestHeader
+ * @param sdncRequest
+ * Boolean to check sdncRequestHeader
*
* @return true if String ok false if not
*/
public static ComplianceCheckResult check(String serviceName, SdncRequestHeader sdncRequestHeader,
ConnectionType conType, RpcActions action,
- Boolean contype, Boolean sndcRequest) {
+ Boolean contype, Boolean sdncRequest) {
boolean result = true;
String message = "";
if (!checkString(serviceName)) {
result = false;
message = "Service ConnectionType is not set";
}
- if (sndcRequest) {
+ if (sdncRequest) {
if (sdncRequestHeader != null) {
RpcActions serviceAction = sdncRequestHeader.getRpcAction();
String requestId = sdncRequestHeader.getRequestId();
/**
* Check Compliancy of Service TxRx info.
+ * @param serviceEnd Service Endpoint
+ * @param endpointType Endpoint type
*
* @return true if String ok false if not
*/
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>3.1.2</version>
+ <version>3.1.3</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>test-common</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<dependencyManagement>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>1.8.0-SNAPSHOT</version>
+ <version>1.9.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yangtools-artifacts</artifactId>
- <version>2.0.7</version>
+ <version>2.0.9</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>3.1.2</version>
+ <version>3.1.3</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>stubs-aggregator</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<name>${project.artifactId}</name>
<packaging>pom</packaging>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>0.13.0-SNAPSHOT</version>
+ <version>0.14.0-SNAPSHOT</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-stubmodels</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<dependencies>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>0.13.0-SNAPSHOT</version>
+ <version>0.14.0-SNAPSHOT</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-stubpce</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<!-- Ajout Fakepce to add fakepce.xml to target/classes -->
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>1.8.0-SNAPSHOT</version>
+ <version>1.9.0-SNAPSHOT</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>netconf-artifacts</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.6.0-SNAPSHOT</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>0.13.0-SNAPSHOT</version>
+ <version>0.14.0-SNAPSHOT</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.transportpce</groupId>
<artifactId>transportpce-stubrenderer</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.3.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<dependencyManagement>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>1.8.0-SNAPSHOT</version>
+ <version>1.9.0-SNAPSHOT</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>netconf-artifacts</artifactId>
- <version>1.5.0-SNAPSHOT</version>
+ <version>1.6.0-SNAPSHOT</version>
<scope>import</scope>
<type>pom</type>
</dependency>
--- /dev/null
+[tox]
+minversion = 1.6
+envlist =
+ docs
+ docs-linkcheck
+skipsdist = true
+
+[testenv:docs]
+deps = -rdocs/requirements.txt
+commands =
+ sphinx-build -W -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html
+
+[testenv:docs-linkcheck]
+deps = -rdocs/requirements.txt
+commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck
+