revision-date 2018-10-19;
}
+ revision 2020-12-11 {
+ description
+ "Update grouping olm-renderer-input, adding min, max frequencies
+ lower spectral slot number and higher spectral slot number
+ fix center-freq unit";
+ }
revision 2020-06-15 {
description
"Updated grouping olm-renderer-input to enable support for flex-grid";
type uint32;
}
leaf center-freq {
- type org-openroadm-common-types:frequency-GHz;
+ type org-openroadm-common-types:frequency-THz;
}
- leaf slot-width {
+ leaf width {
+ description
+ " Width of nmc";
type org-openroadm-common-types:frequency-GHz;
}
+ leaf min-freq {
+ type org-openroadm-common-types:frequency-THz;
+ }
+ leaf max-freq {
+ type org-openroadm-common-types:frequency-THz;
+ }
+ leaf lower-spectral-slot-number {
+ type uint32;
+ }
+ leaf higher-spectral-slot-number {
+ type uint32;
+ }
list nodes {
key "node-id";
ordered-by user;
import java.util.List;
import java.util.Optional;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.otn.renderer.input.Nodes;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.otn.renderer.input.Nodes;
public interface CrossConnect {
import org.opendaylight.transportpce.common.mapping.MappingUtils;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.OpticalControlMode;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.otn.renderer.input.Nodes;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.otn.renderer.input.Nodes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.org.openroadm.device.container.org.openroadm.device.RoadmConnections;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.org.openroadm.device.container.org.openroadm.device.RoadmConnectionsBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.org.openroadm.device.container.org.openroadm.device.RoadmConnectionsKey;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.otn.renderer.input.Nodes;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.otn.renderer.input.Nodes;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.slf4j.Logger;
import com.google.common.collect.HashBasedTable;
import com.google.common.collect.Table;
+import java.math.BigDecimal;
import java.util.Map;
import org.opendaylight.transportpce.common.ServiceRateConstant;
import org.opendaylight.transportpce.common.StringConstants;
public static final double CENTRAL_FREQUENCY = 193.1;
public static final int NB_SLOTS_100G = 8;
public static final int NB_SLOTS_400G = 14;
+ public static final BigDecimal WIDTH_80 = BigDecimal.valueOf(80);
+ public static final BigDecimal WIDTH_40 = BigDecimal.valueOf(40);
+ public static final BigDecimal SLOT_WIDTH_50 = BigDecimal.valueOf(50);
+ public static final BigDecimal SLOT_WIDTH_87_5 = BigDecimal.valueOf(87.5);
+
/**
* Map for associate service type with nb slots.
*/
public static final long IRRELEVANT_WAVELENGTH_NUMBER = 0;
+ /**
+ * Map to associate width format to slot width.
+ */
+ public static final Map<BigDecimal, BigDecimal> WIDTH_SLOT_WIDTH_MAP = Map.of(
+ WIDTH_40, SLOT_WIDTH_50,
+ WIDTH_80, SLOT_WIDTH_87_5);
+
private GridConstant() {
}
private static Table<Uint32, ModulationFormat, String> initFrequencyWidthTable() {
Table<Uint32, ModulationFormat, String> frequencyWidthTable = HashBasedTable.create();
- frequencyWidthTable.put(ServiceRateConstant.RATE_100, ModulationFormat.DpQpsk, "40");
- frequencyWidthTable.put(ServiceRateConstant.RATE_200, ModulationFormat.DpQpsk, "80");
- frequencyWidthTable.put(ServiceRateConstant.RATE_300, ModulationFormat.DpQam8, "80");
- frequencyWidthTable.put(ServiceRateConstant.RATE_400, ModulationFormat.DpQam16, "80");
+ frequencyWidthTable.put(ServiceRateConstant.RATE_100, ModulationFormat.DpQpsk, String.valueOf(WIDTH_40));
+ frequencyWidthTable.put(ServiceRateConstant.RATE_200, ModulationFormat.DpQpsk, String.valueOf(WIDTH_80));
+ frequencyWidthTable.put(ServiceRateConstant.RATE_300, ModulationFormat.DpQam8, String.valueOf(WIDTH_80));
+ frequencyWidthTable.put(ServiceRateConstant.RATE_400, ModulationFormat.DpQam16, String.valueOf(WIDTH_80));
return frequencyWidthTable;
}
}
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.org.openroadm.device.container.OrgOpenroadmDevice;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.org.openroadm.device.container.org.openroadm.device.RoadmConnections;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.org.openroadm.device.container.org.openroadm.device.RoadmConnectionsKey;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.otn.renderer.input.Nodes;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.otn.renderer.input.Nodes;
import org.opendaylight.yangtools.util.concurrent.FluentFutures;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
.getInstance(),
org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.servicehandler.rev201125.$YangModuleInfoImpl
.getInstance(),
- org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.$YangModuleInfoImpl.getInstance(),
+ org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.$YangModuleInfoImpl.getInstance(),
org.opendaylight.yang.gen.v1.gnpy.gnpy.api.rev190103.$YangModuleInfoImpl.getInstance(),
org.opendaylight.yang.gen.v1.gnpy.gnpy.eqpt.config.rev181119.$YangModuleInfoImpl.getInstance(),
org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.$YangModuleInfoImpl.getInstance(),
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.transportpce.common.crossconnect.CrossConnect;
import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
+import org.opendaylight.transportpce.common.fixedflex.GridConstant;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
import org.opendaylight.transportpce.olm.util.OlmUtils;
}
BigDecimal powerValue = spanLossTx.subtract(BigDecimal.valueOf(9));
powerValue = powerValue.min(BigDecimal.valueOf(2));
- // If slot-width is other than 50GHz then calculate PSD power value
- if (input.getSlotWidth() != null && input.getSlotWidth().getValue().doubleValue() != 50) {
- Double psdPower = 10 * Math.log(input.getSlotWidth().getValue().doubleValue() / 50);
- powerValue = powerValue.add(new BigDecimal(psdPower));
+ //we work at constant power spectral density (50 GHz channel width @-20dBm=37.5GHz)
+ // 87.5 GHz channel width @-20dBm=75GHz
+ if (input.getWidth() != null && GridConstant.WIDTH_80.equals(input.getWidth().getValue())) {
+ powerValue = powerValue.add(BigDecimal.valueOf(3));
}
LOG.info("Power Value is {}", powerValue);
try {
import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.transport.interfaces.rev161014.ots.container.OtsBuilder;
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.common.types.rev200615.PmNamesEnum;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.olm.get.pm.input.ResourceIdentifierBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.PmNamesEnum;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.olm.get.pm.input.ResourceIdentifierBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.NetworkId;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.Networks;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.NodeId;
import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev161014.resource.resource.resource.Shelf;
import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev161014.resource.resource.resource.Srg;
import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.types.rev161014.ResourceTypeEnum;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.olm.get.pm.input.ResourceIdentifier;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.olm.get.pm.input.ResourceIdentifier;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
if (currentPmList.isPresent()) {
String pmExtension = null;
- org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.Location location = null;
- org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.Direction direction = null;
+ org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.Location location = null;
+ org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.Direction direction = null;
if (input.getPmExtension() != null) {
pmExtension = input.getPmExtension();
}
List<org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.get.pm.output.Measurements>
extractWantedMeasurements(CurrentPmlist currentPmList, ResourceTypeEnum resourceTypeEnum,
ResourceIdentifier wantedResourceIdentifier,PmGranularity pmGranularity, PmNamesEnum pmNamesEnum,
- String extension, org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.Location
- location, org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.Direction direction) {
+ String extension, org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.Location
+ location, org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.Direction direction) {
List<org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.get.pm.output.Measurements>
measurements = new ArrayList<>();
for (CurrentPm pm : currentPmList.nonnullCurrentPm().values()) {
private static
List<org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.get.pm.output.Measurements>
extractMeasurements(List<Measurements> measurementsFromDevice, PmNamesEnum pmNamesEnum, String extension,
- org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.Location location,
- org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.Direction direction) {
+ org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.Location location,
+ org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.Direction direction) {
List<org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.get.pm.output.Measurements>
extractedMeasurements = new ArrayList<>();
List<Measurements> pmMeasurements = measurementsFromDevice;
import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev181019.current.pm.list.CurrentPmEntryKey;
import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev181019.current.pm.val.group.Measurement;
import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.types.rev161014.ResourceTypeEnum;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.Direction;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.Location;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.PmNamesEnum;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.olm.get.pm.input.ResourceIdentifier;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.Direction;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.Location;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.PmNamesEnum;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.olm.get.pm.input.ResourceIdentifier;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.Uint16;
import org.slf4j.Logger;
import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev200529.Link1Builder;
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.common.types.rev200615.olm.get.pm.input.ResourceIdentifierBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.olm.renderer.input.Nodes;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.olm.renderer.input.NodesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.olm.get.pm.input.ResourceIdentifierBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.olm.renderer.input.Nodes;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.olm.renderer.input.NodesBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.LinkId;
import org.opendaylight.yangtools.yang.common.Uint32;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.atoz.direction.AToZ;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ztoa.direction.ZToA;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource.resource.resource.TerminationPoint;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.olm.renderer.input.Nodes;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.olm.renderer.input.NodesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.olm.renderer.input.NodesKey;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.olm.renderer.input.Nodes;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.olm.renderer.input.NodesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.olm.renderer.input.NodesKey;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.opendaylight.yangtools.yang.common.Uint32;
public static OtnServicePathInput rendererCreateOtnServiceInput(String serviceName, String serviceType,
String serviceRate, PathDescription pathDescription, boolean asideToZside) {
// If atoZ is set true use A-to-Z direction otherwise use Z-to-A
- List<org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.otn.renderer.input.Nodes> nodes =
+ List<org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.otn.renderer.input.Nodes> nodes =
new ArrayList<>();
NodeLists nodeLists = getNodesListAToZ(pathDescription.getAToZDirection().nonnullAToZ().values().iterator());
if (!asideToZside) {
LOG.info("These are node-lists {}, {}", nodeLists.getList(), nodeLists.getOlmList());
for (Nodes node: nodeLists.getList()) {
nodes.add(
- new org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.otn.renderer.input
+ new org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.otn.renderer.input
.NodesBuilder()
.setNodeId(node.getNodeId())
.setClientTp(node.getSrcTp())
package org.opendaylight.transportpce.renderer;
import java.util.List;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.olm.renderer.input.Nodes;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.olm.renderer.input.Nodes;
public class NodeLists {
import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
import org.opendaylight.transportpce.common.fixedflex.FixedFlexInterface;
import org.opendaylight.transportpce.common.fixedflex.FlexGridInterface;
+import org.opendaylight.transportpce.common.fixedflex.GridConstant;
import org.opendaylight.transportpce.common.mapping.PortMapping;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev201012.network.nodes.Mapping;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev201012.network.nodes.McCapabilities;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev181019.FrequencyGHz;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev181019.FrequencyTHz;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev181019.ModulationFormat;
}
public List<String> createFlexOCH(String nodeId, String logicalConnPoint, Long bitmapIndex,
- BigDecimal centerFreq, BigDecimal slotWidth)
+ BigDecimal centerFreq, BigDecimal width)
throws OpenRoadmInterfaceException {
Mapping portMap = portMapping.getMapping(nodeId, logicalConnPoint);
if (portMap == null) {
List<String> interfacesCreated = new ArrayList<>();
if (logicalConnPoint.contains("DEG")) {
- String mcInterfaceCreated = createMCInterface(nodeId, logicalConnPoint, centerFreq, slotWidth, bitmapIndex);
+ String mcInterfaceCreated = createMCInterface(nodeId, logicalConnPoint, centerFreq, width, bitmapIndex);
interfacesCreated.add(mcInterfaceCreated);
}
- String mcInterfaceCreated = createNMCInterface(nodeId, logicalConnPoint, centerFreq, slotWidth, bitmapIndex);
+ String mcInterfaceCreated = createNMCInterface(nodeId, logicalConnPoint, centerFreq, width, bitmapIndex);
interfacesCreated.add(mcInterfaceCreated);
return interfacesCreated;
}
}
public String createMCInterface(String nodeId, String logicalConnPoint,
- BigDecimal centerFrequency, BigDecimal slotWidth, Long bitmapIndex)
+ BigDecimal centerFrequency, BigDecimal width, Long bitmapIndex)
throws OpenRoadmInterfaceException {
// TODO : Check this method
-
- flexGrid = flexGrid.getFlexWaveMapping(centerFrequency.floatValue(), slotWidth.floatValue());
+ flexGrid = flexGrid.getFlexWaveMapping(centerFrequency.floatValue(),
+ GridConstant.WIDTH_SLOT_WIDTH_MAP.get(width).floatValue());
Mapping portMap = portMapping.getMapping(nodeId, logicalConnPoint);
if (portMap == null) {
}
public String createNMCInterface(String nodeId, String logicalConnPoint,
- BigDecimal centerFrequency, BigDecimal slotWidth, Long bitmapIndex)
+ BigDecimal centerFrequency, BigDecimal width, Long bitmapIndex)
throws OpenRoadmInterfaceException {
LOG.info("This is the central frequency {}", centerFrequency.floatValue());
- LOG.info("This is the slot-width {}", slotWidth.floatValue());
+ LOG.info("This is the nmc width {}", width.floatValue());
// TODO : Check this method
- flexGrid = flexGrid.getFlexWaveMapping(centerFrequency.floatValue(), slotWidth.floatValue());
Mapping portMap = portMapping.getMapping(nodeId, logicalConnPoint);
if (portMap == null) {
throw new OpenRoadmInterfaceException(
String.format(MAPPING_ERROR_EXCEPTION_MESSAGE, nodeId, logicalConnPoint));
}
- LOG.info("Freq Start {} and Freq End {} and center-Freq {}", flexGrid.getStart(),
- flexGrid.getStop(),centerFrequency);
//TODO : Check this method
InterfaceBuilder nmcInterfaceBldr = createGenericInterfaceBuilder(portMap,
NetworkMediaChannelConnectionTerminationPoint.class, logicalConnPoint + "-nmc" + "-" + bitmapIndex);
if (logicalConnPoint.contains("DEG")) {
nmcInterfaceBldr.setSupportingInterface(logicalConnPoint + "-mc" + "-" + bitmapIndex);
}
- NmcCtpBuilder nmcCtpIfBuilder;
- // From the logicalConnPoint, get the substring and for that associated substring find the mc-cap
- String mcLcp = "";
- if (logicalConnPoint.contains("-PP")) {
- mcLcp = logicalConnPoint.substring(0, logicalConnPoint.indexOf("-")) + "-PP";
- }
- else if (logicalConnPoint.contains("-TTP")) {
- mcLcp = logicalConnPoint.substring(0, logicalConnPoint.indexOf("-")) + "-TTP";
- }
- McCapabilities mcCapabilities = portMapping.getMcCapbilities(nodeId, mcLcp);
- if (mcCapabilities == null || mcCapabilities.getSlotWidthGranularity() == null
- || mcCapabilities.getSlotWidthGranularity().getValue() == null) {
- LOG.warn("Port mapping could not find {}", mcLcp);
- LOG.warn("Check the port mapping to verify {}", mcLcp);
- return nmcInterfaceBldr.getName();
- }
- double slotWidthGran = mcCapabilities.getSlotWidthGranularity().getValue().doubleValue();
- // Dead-band is constant (Ref: WP) In GHz
- double deadBand = 8;
- double guardBand = Math.ceil(deadBand / slotWidthGran) * slotWidthGran;
- nmcCtpIfBuilder = new NmcCtpBuilder()
+ NmcCtpBuilder nmcCtpIfBuilder = new NmcCtpBuilder()
.setFrequency(FrequencyTHz.getDefaultInstance(String.valueOf(centerFrequency)))
- .setWidth(FrequencyGHz.getDefaultInstance(String.valueOf(slotWidth.doubleValue() - guardBand)));
+ .setWidth(new FrequencyGHz(width));
// Create Interface1 type object required for adding as augmentation
org.opendaylight.yang.gen.v1.http.org.openroadm.network.media.channel.interfaces.rev181019.Interface1Builder
}
public List<String> createOpenRoadmOchInterface(String nodeId, String logicalConnPoint, Long waveNumber,
- BigDecimal centerFreq, BigDecimal slotWidth)
+ BigDecimal centerFreq, BigDecimal width)
throws OpenRoadmInterfaceException {
switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
return openRoadmInterface121.createOpenRoadmOchInterface(nodeId, logicalConnPoint, waveNumber);
case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1:
return openRoadmInterface221.createFlexOCH(nodeId, logicalConnPoint, waveNumber,
- centerFreq, slotWidth);
+ centerFreq, width);
default:
return null;
}
}
public String createOpenRoadmOchInterface(String nodeId, String logicalConnPoint, Long waveNumber,
- OchAttributes.ModulationFormat format, BigDecimal centerFreq, BigDecimal slotWidth)
+ OchAttributes.ModulationFormat format, BigDecimal centerFreq, BigDecimal width)
throws OpenRoadmInterfaceException {
switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
return openRoadmInterface121.createOpenRoadmOchInterface(nodeId, logicalConnPoint, waveNumber, format);
case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1:
return openRoadmInterface221.createOpenRoadmOchInterface(nodeId, logicalConnPoint, waveNumber,
- centerFreq, slotWidth);
+ centerFreq, width);
default:
return null;
}
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.service.list.Services;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.service.list.ServicesBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.service.list.ServicesKey;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.node.interfaces.NodeInterface;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.node.interfaces.NodeInterfaceBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.node.interfaces.NodeInterfaceKey;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.olm.renderer.input.Nodes;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.node.interfaces.NodeInterface;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.node.interfaces.NodeInterfaceBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.node.interfaces.NodeInterfaceKey;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.olm.renderer.input.Nodes;
import org.opendaylight.yang.gen.v1.http.transportpce.topology.rev201019.OtnLinkType;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
// TODO: need to update transportpce-common-types accordingly, to a more, generic-term
Long waveNumber = input.getWaveNumber().toJava();
BigDecimal centerFreq = null;
- BigDecimal slotWidth = null;
+ BigDecimal width = null;
if (input.getCenterFreq() != null) {
centerFreq = input.getCenterFreq().getValue();
}
- if (input.getSlotWidth() != null) {
- slotWidth = input.getSlotWidth().getValue();
+ if (input.getWidth() != null) {
+ width = input.getWidth().getValue();
}
String srcTp = node.getSrcTp();
String destTp = node.getDestTp();
if ((destTp != null) && destTp.contains(StringConstants.NETWORK_TOKEN)) {
crossConnectFlag++;
String supportingOchInterface;
- if ((centerFreq != null) && (slotWidth != null)) {
+ if ((centerFreq != null) && (width != null)) {
supportingOchInterface = this.openRoadmInterfaceFactory.createOpenRoadmOchInterface(
- nodeId, destTp, waveNumber, ModulationFormat.DpQpsk, centerFreq, slotWidth);
+ nodeId, destTp, waveNumber, ModulationFormat.DpQpsk, centerFreq, width);
}
else {
supportingOchInterface = this.openRoadmInterfaceFactory.createOpenRoadmOchInterface(
crossConnectFlag++;
// create OpenRoadm Xponder Line Interfaces
String supportingOchInterface;
- if ((centerFreq != null) && (slotWidth != null)) {
+ if ((centerFreq != null) && (width != null)) {
supportingOchInterface = this.openRoadmInterfaceFactory.createOpenRoadmOchInterface(
- nodeId, srcTp, waveNumber, ModulationFormat.DpQpsk, centerFreq, slotWidth);
+ nodeId, srcTp, waveNumber, ModulationFormat.DpQpsk, centerFreq, width);
}
else {
supportingOchInterface = this.openRoadmInterfaceFactory.createOpenRoadmOchInterface(
}
if ((srcTp != null) && (srcTp.contains(StringConstants.TTP_TOKEN)
|| srcTp.contains(StringConstants.PP_TOKEN))) {
- if ((centerFreq != null) && (slotWidth != null)) {
+ if ((centerFreq != null) && (width != null)) {
createdOchInterfaces.addAll(
this.openRoadmInterfaceFactory
- .createOpenRoadmOchInterface(nodeId, srcTp, waveNumber, centerFreq, slotWidth));
+ .createOpenRoadmOchInterface(nodeId, srcTp, waveNumber, centerFreq, width));
}
else {
createdOchInterfaces.addAll(
if ((destTp != null) && (destTp.contains(StringConstants.TTP_TOKEN)
|| destTp.contains(StringConstants.PP_TOKEN))) {
- if ((centerFreq != null) && (slotWidth != null)) {
+ if ((centerFreq != null) && (width != null)) {
createdOchInterfaces.addAll(
this.openRoadmInterfaceFactory
- .createOpenRoadmOchInterface(nodeId, destTp, waveNumber, centerFreq, slotWidth));
+ .createOpenRoadmOchInterface(nodeId, destTp, waveNumber, centerFreq, width));
}
else {
createdOchInterfaces.addAll(
import java.util.Collections;
import java.util.List;
import org.opendaylight.transportpce.common.OperationResult;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.node.interfaces.NodeInterface;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.olm.renderer.input.Nodes;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.node.interfaces.NodeInterface;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.olm.renderer.input.Nodes;
public final class DeviceRenderingResult extends OperationResult {
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.OtnServicePathOutput;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.OtnServicePathOutputBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.interfaces.grp.Interface;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.node.interfaces.NodeInterface;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.node.interfaces.NodeInterfaceBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.node.interfaces.NodeInterfaceKey;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.otn.renderer.input.Nodes;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.node.interfaces.NodeInterface;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.node.interfaces.NodeInterfaceBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.node.interfaces.NodeInterfaceKey;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.otn.renderer.input.Nodes;
import org.opendaylight.yang.gen.v1.http.transportpce.topology.rev201019.OtnLinkType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Collections;
import java.util.List;
import org.opendaylight.transportpce.common.OperationResult;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.node.interfaces.NodeInterface;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.node.interfaces.NodeInterface;
public final class OtnDeviceRenderingResult extends OperationResult {
private final List<NodeInterface> renderedNodeInterfaces;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.ServicePathList;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePaths;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePathsKey;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.olm.get.pm.input.ResourceIdentifierBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.olm.renderer.input.Nodes;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.olm.get.pm.input.ResourceIdentifierBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.olm.renderer.input.Nodes;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.Notification;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.RendererRollbackInputBuilder;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.RendererRollbackOutput;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.renderer.rollback.output.FailedToRollback;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.node.interfaces.NodeInterface;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.node.interfaces.NodeInterfaceKey;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.node.interfaces.NodeInterface;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.node.interfaces.NodeInterfaceKey;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.opendaylight.transportpce.renderer.provisiondevice.DeviceRenderingResult;
import org.opendaylight.transportpce.renderer.provisiondevice.servicepath.ServicePathDirection;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.ServicePathOutput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.olm.renderer.input.Nodes;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.olm.renderer.input.Nodes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev201125.ServiceImplementationRequestOutput;
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.common.types.rev200615.olm.get.pm.input.ResourceIdentifierBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.olm.get.pm.input.ResourceIdentifierBuilder;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
@Ignore
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.service.endpoint.sp.RxDirectionBuilder;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.service.endpoint.sp.TxDirectionBuilder;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.service.handler.header.ServiceHandlerHeaderBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.olm.renderer.input.Nodes;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.olm.renderer.input.NodesBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200615.olm.renderer.input.NodesKey;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.olm.renderer.input.Nodes;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.olm.renderer.input.NodesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.olm.renderer.input.NodesKey;
import org.opendaylight.yangtools.yang.common.Uint32;
"transportpce-device-renderer:service-name": "testNMC-MC",
"transportpce-device-renderer:wave-number": "2",
"transportpce-device-renderer:center-freq": "196.05",
- "transportpce-device-renderer:slot-width": "87.5",
+ "transportpce-device-renderer:width": "80",
"transportpce-device-renderer:nodes": [
{
"transportpce-device-renderer:node-id": "ROADM-D1",
# Check the mc-ttp max and min-freq
self.assertEqual({
"frequency": 196.05,
- "width": 75
+ "width": 80
},
res['interface'][0]['org-openroadm-network-media-channel-interfaces:nmc-ctp'])
time.sleep(3)
"supporting-port": "C1",
"type": "org-openroadm-interfaces:networkMediaChannelConnectionTerminationPoint"},
**res['interface'][0]), res['interface'][0])
- self.assertEqual({"frequency": 196.05, "width": 75},
+ self.assertEqual({"frequency": 196.05, "width": 80},
res['interface'][0]['org-openroadm-network-media-channel-interfaces:nmc-ctp'])
time.sleep(3)