authors: Dhruv Bhardwaj ( db929a@att.com )
Shweta Vachhani ( sv111y@att.com )";
- revision 2020-01-28 {
+ revision 2021-06-18 {
description
- "Complement rpc otn-service-path";
+ "replace service-type by service-format,
+ and change service-rate type";
+ }
+ revision 2020-01-28 {
+ description
+ "Complement rpc otn-service-path";
}
revision 2019-12-12 {
description
rpc otn-service-path {
input {
leaf service-rate {
- type string;
+ type uint32;
}
- leaf service-type {
+ leaf service-format {
type string;
}
leaf ethernet-encoding {
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.ServicePathInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.ServicePathInput;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.optical.channel.types.rev200529.FrequencyGHz;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.optical.channel.types.rev200529.FrequencyTHz;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev181019.ModulationFormat;
import java.util.Map;
import org.junit.Test;
import org.opendaylight.transportpce.common.ServiceRateConstant;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.ServicePathInput;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.ServicePathInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.ServicePathInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.ServicePathInputBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.optical.channel.types.rev200529.FrequencyGHz;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.optical.channel.types.rev200529.FrequencyTHz;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev181019.ModulationFormat;
OtnDeviceRendererService otnDeviceRendererService = new OtnDeviceRendererServiceImpl(openRoadmInterfaceFactory,
crossConnect, openRoadmInterfaces, deviceTransactionManager, networkModelService);
rendererProvider = initRenderer(lightyServices, olmPowerServiceRpc, deviceRendererService,
- otnDeviceRendererService);
+ otnDeviceRendererService, portMapping);
LOG.info("Creating service-handler beans ...");
RendererServiceOperations rendererServiceOperations = new RendererServiceOperationsImpl(deviceRendererService,
otnDeviceRendererService, olmPowerServiceRpc, lightyServices.getBindingDataBroker(),
- lightyServices.getBindingNotificationPublishService());
+ lightyServices.getBindingNotificationPublishService(), portMapping);
ServiceDataStoreOperations serviceDataStoreOperations = new ServiceDataStoreOperationsImpl(
lightyServices.getBindingDataBroker());
RendererListenerImpl rendererListenerImpl = new RendererListenerImpl(pathComputationService,
}
private RendererProvider initRenderer(LightyServices lightyServices, TransportpceOlmService olmPowerServiceRpc,
- DeviceRendererService deviceRendererService, OtnDeviceRendererService otnDeviceRendererService) {
+ DeviceRendererService deviceRendererService, OtnDeviceRendererService otnDeviceRendererService,
+ PortMapping portMapping) {
DeviceRendererRPCImpl deviceRendererRPC = new DeviceRendererRPCImpl(deviceRendererService,
otnDeviceRendererService);
RendererServiceOperationsImpl rendererServiceOperations = new RendererServiceOperationsImpl(
deviceRendererService, otnDeviceRendererService, olmPowerServiceRpc,
- lightyServices.getBindingDataBroker(), lightyServices.getBindingNotificationPublishService());
+ lightyServices.getBindingDataBroker(), lightyServices.getBindingNotificationPublishService(),
+ portMapping);
return new RendererProvider(lightyServices.getRpcProviderService(), deviceRendererRPC,
rendererServiceOperations);
}
.getInstance(),
org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.tapinetworkutils.rev210408
.$YangModuleInfoImpl.getInstance(),
- org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128
+ org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618
.$YangModuleInfoImpl.getInstance(),
org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkmodel.rev201116
.$YangModuleInfoImpl.getInstance(),
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210426.mapping.Mapping;
import org.opendaylight.yang.gen.v1.http.transportpce.topology.rev210511.OtnLinkType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNodeConnectionStatus;
+import org.opendaylight.yangtools.yang.common.Uint32;
/**
* Service for data manipulation on OpenROADM topology models.
* @param isDeletion
* True indicates if the low-order otn service must be deleted
*/
- void updateOtnLinks(List<String> nodeTps, String serviceRate, Short tribPortNb, Short tribSoltNb,
+ void updateOtnLinks(List<String> nodeTps, Uint32 serviceRate, Short tribPortNb, Short tribSoltNb,
boolean isDeletion);
}
}
@Override
- public void updateOtnLinks(List<String> nodeTps, String serviceRate, Short tribPortNb, Short tribSoltNb,
+ public void updateOtnLinks(List<String> nodeTps, Uint32 serviceRate, Short tribPortNb, Short tribSoltNb,
boolean isDeletion) {
List<Link> supportedOdu4Links = getSupportingOdu4Links(nodeTps);
List<TerminationPoint> tps = getOtnNodeTps(nodeTps);
}
public static TopologyShard updateOtnLinks(List<Link> suppOdu4Links, List<TerminationPoint> oldTps,
- String serviceRate, Short tribPortNb, Short tribSoltNb, boolean isDeletion) {
+ Uint32 serviceRate, Short tribPortNb, Short tribSoltNb, boolean isDeletion) {
List<Link> links = new ArrayList<>();
Long bwIncr = 10000L;
- if ("1G".equals(serviceRate)) {
+ if (serviceRate.intValue() == 1) {
bwIncr = 1000L;
}
for (Link link : suppOdu4Links) {
return tpBldr.addAugmentation(otnTp1Bldr.setXpdrTpPortConnectionAttributes(xtpcaBldr.build()).build()).build();
}
- private static TerminationPoint updateNodeTpTsPool(TerminationPoint tp, String serviceRate, Short tribPortNb,
+ private static TerminationPoint updateNodeTpTsPool(TerminationPoint tp, Uint32 serviceRate, Short tribPortNb,
Short tribSlotNb, boolean isDeletion) {
LOG.debug("in updateNodeTpTsPool");
TerminationPointBuilder tpBldr = new TerminationPointBuilder(tp);
XpdrTpPortConnectionAttributesBuilder xtpcaBldr = new XpdrTpPortConnectionAttributesBuilder(
tpBldr.augmentation(TerminationPoint1.class).getXpdrTpPortConnectionAttributes());
List<Uint16> tsPool = new ArrayList<>(xtpcaBldr.getTsPool());
- switch (serviceRate) {
- case "1G":
+ switch (serviceRate.intValue()) {
+ case 1:
if (isDeletion) {
tsPool.add(Uint16.valueOf(tribSlotNb));
} else {
tsPool.remove(Uint16.valueOf(tribSlotNb));
}
break;
- case "10G":
+ case 10:
if (isDeletion) {
for (int i = 0; i < NB_TRIB_SLOT_PER_10GE; i++) {
tsPool.add(Uint16.valueOf(tribSlotNb + i));
public void createOtnLinksForODU4NormalTest() {
TopologyShard topoShard = OpenRoadmOtnTopology
.createOtnLinks(
- NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, 100000),
+ NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, Uint32.valueOf(100000)),
NetworkmodelTestUtil.createTpList(false));
assertNotNull("TopologyShard should never be null", topoShard);
assertNull("list of nodes should be null", topoShard.getNodes());
@Test
public void createOtnLinksForODU4WhenOTU4HaveBadBWParamsTest() {
- List<Link> otu4Links = NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, 100000);
+ List<Link> otu4Links = NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, Uint32.valueOf(100000));
List<Link> otu4LinksWithBadBWParam = new ArrayList<>();
for (Link link : otu4Links) {
otu4LinksWithBadBWParam.add(new LinkBuilder(link).removeAugmentation(Link1.class).build());
otu4LinksWithBadBWParam.clear();
topoShard =
OpenRoadmOtnTopology.createOtnLinks(
- NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, 99000),
+ NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, Uint32.valueOf(99000)),
NetworkmodelTestUtil.createTpList(false));
assertNull("list of nodes should be null", topoShard.getNodes());
assertNull("list of links should be null", topoShard.getLinks());
public void deleteOtnLinksForODU4NormalTest() {
TopologyShard topoShard =
OpenRoadmOtnTopology.deleteOtnLinks(
- NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, 0),
+ NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, Uint32.valueOf(0)),
NetworkmodelTestUtil.createTpList(true));
assertNotNull("TopologyShard should never be null", topoShard);
assertEquals("list of links should contain 2 links", 2, topoShard.getLinks().size());
@Test
public void deleteOtnLinksForODU4WhenOTU4HaveBadBWParamsTest() {
- List<Link> otu4Links = NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, 0);
+ List<Link> otu4Links = NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, Uint32.valueOf(0));
List<Link> otu4LinksWithBadBWParam = new ArrayList<>();
for (Link link : otu4Links) {
otu4LinksWithBadBWParam.add(new LinkBuilder(link).removeAugmentation(Link1.class).build());
// tests update for 10G creation
TopologyShard topoShard =
OpenRoadmOtnTopology.updateOtnLinks(
- NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.ODTU4, 100000),
+ NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.ODTU4, Uint32.valueOf(100000)),
NetworkmodelTestUtil.createTpList(true),
- "10G", (short)1, (short)1, false);
+ Uint32.valueOf(10), (short)1, (short)1, false);
assertNotNull("TopologyShard should never be null", topoShard);
assertNull("list of nodes should be null", topoShard.getNodes());
List<Link> sortedLinks = topoShard.getLinks().stream()
// tests update for 10G deletion
sortedLinks.clear();
- topoShard = OpenRoadmOtnTopology.updateOtnLinks(topoShard.getLinks(), topoShard.getTps(), "10G", (short)1,
- (short)1, true);
+ topoShard = OpenRoadmOtnTopology.updateOtnLinks(topoShard.getLinks(), topoShard.getTps(), Uint32.valueOf(10),
+ (short)1, (short)1, true);
sortedLinks = topoShard.getLinks().stream()
.sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
.collect(Collectors.toList());
// tests update for 1G creation
TopologyShard topoShard =
OpenRoadmOtnTopology.updateOtnLinks(
- NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.ODTU4, 100000),
+ NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.ODTU4, Uint32.valueOf(100000)),
NetworkmodelTestUtil.createTpList(true),
- "1G", (short)1, (short)1, false);
+ Uint32.valueOf(1), (short)1, (short)1, false);
assertNotNull("TopologyShard should never be null", topoShard);
assertNull("list of nodes should be null", topoShard.getNodes());
List<Link> sortedLinks = topoShard.getLinks().stream()
OpenRoadmOtnTopology.updateOtnLinks(
topoShard.getLinks(),
topoShard.getTps(),
- "1G", (short)1, (short)1, true);
+ Uint32.valueOf(1), (short)1, (short)1, true);
sortedLinks = topoShard.getLinks().stream()
.sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
.collect(Collectors.toList());
@Test
public void updateOtnLinksForODU4WhenBWParamsNotPresentTest() {
- List<Link> odu4Links = NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.ODTU4, 100000);
+ List<Link> odu4Links = NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.ODTU4, Uint32.valueOf(100000));
List<Link> odu4LinksWithBadBWParam = new ArrayList<>();
for (Link link : odu4Links) {
odu4LinksWithBadBWParam.add(new LinkBuilder(link).removeAugmentation(Link1.class).build());
OpenRoadmOtnTopology.updateOtnLinks(
odu4LinksWithBadBWParam,
NetworkmodelTestUtil.createTpList(true),
- "1G", (short)1, (short)1, false);
+ Uint32.valueOf(1), (short)1, (short)1, false);
assertNotNull("TopologyShard should never be null", topoShard);
assertNull("list of nodes should be null", topoShard.getNodes());
assertNull("list of links should be null", topoShard.getLinks());
@Test
public void updateOtnLinksForODU4WhenAvailBWNotSufficientTest() {
- List<Link> odu4LinksWithBadBWParam = NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.ODTU4, 8000);
+ List<Link> odu4LinksWithBadBWParam = NetworkmodelTestUtil
+ .createSuppOTNLinks(OtnLinkType.ODTU4, Uint32.valueOf(8000));
TopologyShard topoShard =
OpenRoadmOtnTopology.updateOtnLinks(
odu4LinksWithBadBWParam,
NetworkmodelTestUtil.createTpList(true),
- "10G", (short)1, (short)1, false);
+ Uint32.valueOf(10), (short)1, (short)1, false);
assertNotNull("TopologyShard should never be null", topoShard);
assertNull("list of nodes should be null", topoShard.getNodes());
assertNull("list of links should be null", topoShard.getLinks());
return mappingNode;
}
- public static List<Link> createSuppOTNLinks(OtnLinkType type, int availBW) {
+ public static List<Link> createSuppOTNLinks(OtnLinkType type, Uint32 availBW) {
String prefix = null;
if (OtnLinkType.OTU4.equals(type)) {
prefix = "OTU4-";
.build())
.addAugmentation(
new org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev200529.Link1Builder()
- .setAvailableBandwidth(Uint32.valueOf(availBW))
- .setUsedBandwidth(Uint32.valueOf(100000 - availBW))
+ .setAvailableBandwidth(availBW)
+ .setUsedBandwidth(Uint32.valueOf(100000 - availBW.intValue()))
.build())
.addAugmentation(
new org.opendaylight.yang.gen.v1.http.transportpce.topology.rev210511.Link1Builder()
.build())
.addAugmentation(
new org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev200529.Link1Builder()
- .setAvailableBandwidth(Uint32.valueOf(availBW))
- .setUsedBandwidth(Uint32.valueOf(100000 - availBW))
+ .setAvailableBandwidth(availBW)
+ .setUsedBandwidth(Uint32.valueOf(100000 - availBW.intValue()))
.build())
.addAugmentation(
new org.opendaylight.yang.gen.v1.http.transportpce.topology.rev210511.Link1Builder()
import org.opendaylight.transportpce.common.StringConstants;
import org.opendaylight.transportpce.common.fixedflex.GridConstant;
import org.opendaylight.transportpce.common.fixedflex.GridUtils;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.OtnServicePathInput;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.OtnServicePathInputBuilder;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.ServicePathInput;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.ServicePathInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.OtnServicePathInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.OtnServicePathInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.ServicePathInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.ServicePathInputBuilder;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupInput;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupInputBuilder;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev201125.ServiceDeleteOutput;
}
// Adding createOtnServiceInputpath for A-Z and Z-A directions as one method
- public static OtnServicePathInput rendererCreateOtnServiceInput(String serviceName, String serviceType,
- String serviceRate, PathDescription pathDescription, boolean asideToZside) {
+ public static OtnServicePathInput rendererCreateOtnServiceInput(String serviceName, String serviceFormat,
+ Uint32 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.rev201211.otn.renderer.input.Nodes> nodes =
new ArrayList<>();
}
OtnServicePathInputBuilder otnServicePathInputBuilder = new OtnServicePathInputBuilder()
.setServiceName(serviceName)
- .setServiceType(serviceType)
+ .setServiceFormat(serviceFormat)
.setServiceRate(serviceRate)
.setNodes(nodes);
// set the trib-slots and trib-ports for the lower oder odu
- if (serviceRate.equals("1G") || (serviceRate.equals("10G"))) {
+ if (serviceRate.intValue() == 1 || (serviceRate.intValue() == 10)) {
Short tribPort = Short.valueOf(pathDescription.getAToZDirection().getMinTribSlot().getValue()
.split("\\.")[0]);
Short minTribSlot = Short.valueOf(pathDescription.getAToZDirection().getMinTribSlot().getValue()
import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations;
import org.opendaylight.transportpce.renderer.rpcs.DeviceRendererRPCImpl;
import org.opendaylight.transportpce.renderer.rpcs.TransportPCEServicePathRPCImpl;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.TransportpceDeviceRendererService;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.TransportpceDeviceRendererService;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev201125.TransportpceRendererService;
import org.opendaylight.yangtools.concepts.ObjectRegistration;
import org.slf4j.Logger;
*/
package org.opendaylight.transportpce.renderer;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.ServicePathInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.ServicePathInput;
public class ServicePathInputData {
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
import org.opendaylight.transportpce.renderer.provisiondevice.servicepath.ServicePathDirection;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.CreateOtsOmsInput;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.CreateOtsOmsOutput;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.RendererRollbackInput;
-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.ServicePathInput;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.ServicePathOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.CreateOtsOmsInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.CreateOtsOmsOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.RendererRollbackInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.RendererRollbackOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.ServicePathInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.ServicePathOutput;
public interface DeviceRendererService {
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.alarmsuppression.rev171102.ServiceNodelist;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.alarmsuppression.rev171102.service.nodelist.NodelistBuilder;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.alarmsuppression.rev171102.service.nodelist.NodelistKey;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.CreateOtsOmsInput;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.CreateOtsOmsOutput;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.CreateOtsOmsOutputBuilder;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.RendererRollbackInput;
-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.RendererRollbackOutputBuilder;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.ServicePathInput;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.ServicePathOutput;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.ServicePathOutputBuilder;
-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.opendaylight.transportpce.device.renderer.rev200128.renderer.rollback.output.FailedToRollbackBuilder;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.renderer.rollback.output.FailedToRollbackKey;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.CreateOtsOmsInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.CreateOtsOmsOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.CreateOtsOmsOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.RendererRollbackInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.RendererRollbackOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.RendererRollbackOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.ServicePathInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.ServicePathOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.ServicePathOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.renderer.rollback.output.FailedToRollback;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.renderer.rollback.output.FailedToRollbackBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.renderer.rollback.output.FailedToRollbackKey;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210426.OpenroadmNodeVersion;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210426.mapping.Mapping;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev190531.service.Topology;
*/
package org.opendaylight.transportpce.renderer.provisiondevice;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.OtnServicePathInput;
-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.rev210618.OtnServicePathInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.OtnServicePathOutput;
public interface OtnDeviceRendererService {
OtnServicePathOutput setupOtnServicePath(OtnServicePathInput input);
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
import org.opendaylight.transportpce.networkmodel.service.NetworkModelService;
import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterfaceFactory;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.OtnServicePathInput;
-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.opendaylight.transportpce.device.renderer.rev210618.OtnServicePathInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.OtnServicePathOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.OtnServicePathOutputBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev200327.OpucnTribSlotDef;
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.rev210511.OtnLinkType;
+import org.opendaylight.yangtools.yang.common.Uint32;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
boolean success = true;
List<NodeInterface> nodeInterfaces = new ArrayList<>();
List<String> results = new ArrayList<>();
- if (input.getServiceType() == null || input.getServiceRate() == null) {
+ if (input.getServiceFormat() == null || input.getServiceRate() == null) {
OtnServicePathOutputBuilder otnServicePathOutputBuilder = new OtnServicePathOutputBuilder()
.setSuccess(false)
.setResult("Error - service-type and service-rate must be presents");
return otnServicePathOutputBuilder.build();
}
CopyOnWriteArrayList<Nodes> otnNodesProvisioned = new CopyOnWriteArrayList<>();
- switch (input.getServiceType()) {
+ switch (input.getServiceFormat()) {
case "Ethernet":
- if ("10G".equals(input.getServiceRate()) || "1G".equals(input.getServiceRate())) {
+ if (input.getServiceRate().intValue() == 1 || input.getServiceRate().intValue() == 10) {
try {
LOG.info("Calling Node interfaces {} {} {} {} {} {} {}",
input.getServiceRate(), input.getEthernetEncoding(),
- input.getServiceType(), input.getOperation(), input.getTribPortNumber(),
+ input.getServiceFormat(), input.getOperation(), input.getTribPortNumber(),
input.getTribSlot(), input.getNodes());
nodeInterfaces = createInterface(input);
LOG.info("Node interfaces created just fine ");
LOG.warn("Set up service path failed", e);
success = false;
}
- } else if ("100G".equals(input.getServiceRate())) {
+ } else if (input.getServiceRate().intValue() == 100) {
try {
LOG.info("Calling Node interfaces {} {} {} {} {} {}",
input.getServiceRate(), input.getEthernetEncoding(),
- input.getServiceType(), input.getOperation(), input.getOpucnTribSlots(), input.getNodes());
+ input.getServiceFormat(), input.getOperation(), input.getOpucnTribSlots(),
+ input.getNodes());
nodeInterfaces = createInterface(input);
LOG.info("Node interfaces created just fine for 100G OTN ");
// TODO: Update the OTN topology accordingly with Opucn-Trib-slots
}
break;
case "ODU":
- if ("100G".equals(input.getServiceRate())) {
+ if (input.getServiceRate().intValue() == 100) {
try {
createODU4TtpInterface(input, nodeInterfaces, otnNodesProvisioned);
updateOtnTopology(otnNodesProvisioned, null, null, null, null, false);
LOG.warn("Set up service path failed", e);
success = false;
}
- } else if ("400G".equals(input.getServiceRate())) {
+ } else if (input.getServiceRate().intValue() == 400) {
try {
createOduc4TtpInterface(input, nodeInterfaces, otnNodesProvisioned);
updateOtnTopology(otnNodesProvisioned, null, null, null, null, false);
}
break;
default:
- LOG.error("service-type {} not managed yet", input.getServiceType());
+ LOG.error("service-type {} not managed yet", input.getServiceFormat());
break;
}
if (success) {
String nodeId = node.getNodeId();
LOG.info("Deleting service setup on node {}", nodeId);
String networkTp = node.getNetworkTp();
- if (networkTp == null || input.getServiceRate() == null || input.getServiceType() == null) {
- LOG.error("destination ({}) or service rate ({}) or service type ({}) is null.", networkTp,
- input.getServiceRate(), input.getServiceType());
+ if (networkTp == null || input.getServiceRate() == null || input.getServiceFormat() == null) {
+ LOG.error("destination ({}) or service-rate ({}) or service-format ({}) is null.", networkTp,
+ input.getServiceRate(), input.getServiceFormat());
return;
}
// if the node is currently mounted then proceed.
if (this.deviceTransactionManager.isDeviceMounted(nodeId)) {
String connectionNumber = "";
- switch (input.getServiceRate()) {
- case ("100G"):
- if ("ODU".equals(input.getServiceType())) {
+ switch (input.getServiceRate().intValue()) {
+ case 100:
+ if ("ODU".equals(input.getServiceFormat())) {
interfacesToDelete.add(networkTp + "-ODU4");
otnNodesProvisioned.add(node);
if (node.getNetwork2Tp() != null) {
interfacesToDelete.add(node.getNetwork2Tp() + "-ODU4");
}
- } else if ("Ethernet".equals(input.getServiceType())) {
+ } else if ("Ethernet".equals(input.getServiceFormat())) {
connectionNumber = getConnectionNumber(input.getServiceName(), node, networkTp, "ODU4");
}
break;
- case ("400G"):
- LOG.info("Service Rate is 400G");
- if ("ODU".equals(input.getServiceType())) {
+ case 400:
+ if ("ODU".equals(input.getServiceFormat())) {
interfacesToDelete.add(networkTp + "-ODUC4");
otnNodesProvisioned.add(node);
if (node.getNetwork2Tp() != null) {
}
}
break;
- case ("10G"):
+ case 10:
connectionNumber = getConnectionNumber(input.getServiceName(), node, networkTp, "ODU2e");
break;
- case ("1G"):
+ case 1:
connectionNumber = getConnectionNumber(input.getServiceName(), node, networkTp, "ODU0");
break;
default:
interfacesToDelete.add(interf);
String supportedInterface = this.openRoadmInterfaces.getSupportedInterface(nodeId, interf);
- if (input.getServiceRate().equals("100G")) {
+ if (input.getServiceRate().intValue() == 100) {
if (!supportedInterface.contains("ODUC4")) {
interfacesToDelete.add(supportedInterface);
}
}
forkJoinPool.shutdown();
LOG.info("requesting otn-topology update...");
- if (!nodesTpToUpdate.isEmpty() && !"ODU".equals(input.getServiceType())) {
+ if (!nodesTpToUpdate.isEmpty() && !"ODU".equals(input.getServiceFormat())) {
updateOtnTopology(null, nodesTpToUpdate, input.getServiceRate(), input.getTribPortNumber(),
input.getTribSlot(), true);
} else if (!otnNodesProvisioned.isEmpty()) {
List<NodeInterface> nodeInterfaces = new ArrayList<>();
LOG.info("Calling Create Interface entry for OTN service path");
if (input.getServiceRate() == null
- || !("1G".equals(input.getServiceRate()) || "10G".equals(input.getServiceRate())
- || "100G".equals(input.getServiceRate()))) {
+ || !(input.getServiceRate().intValue() == 1 || input.getServiceRate().intValue() == 10
+ || input.getServiceRate().intValue() == 100)) {
LOG.error("Service rate {} not managed yet", input.getServiceRate());
} else {
createLowOrderInterfaces(input, nodeInterfaces);
// check if the node is mounted or not?
List<String> createdEthInterfaces = new ArrayList<>();
List<String> createdOduInterfaces = new ArrayList<>();
- switch (input.getServiceRate()) {
- case ("1G"):
+ switch (input.getServiceRate().intValue()) {
+ case 1:
LOG.info("Input service is 1G");
if (node.getClientTp() != null) {
createdEthInterfaces.add(
input.getTribSlot()));
}
break;
- case ("10G"):
+ case 10:
LOG.info("Input service is 10G");
if (node.getClientTp() != null) {
createdEthInterfaces.add(openRoadmInterfaceFactory.createOpenRoadmEth10GInterface(
input.getTribSlot()));
}
break;
- case ("100G"):
+ case 100:
LOG.info("Input service is 100G");
// Take the first and last value in the list of OpucnTribSlot (assuming SH would provide
// min and max value only, size two)
}
}
- private void updateOtnTopology(CopyOnWriteArrayList<Nodes> nodes, List<String> nodesTps, String serviceRate,
+ private void updateOtnTopology(CopyOnWriteArrayList<Nodes> nodes, List<String> nodesTps, Uint32 serviceRate,
Short tribPortNb, Short tribSlotNb, boolean isDeletion) {
if (nodes != null && nodes.size() == 2) {
if (isDeletion) {
import org.opendaylight.transportpce.common.ResponseCodes;
import org.opendaylight.transportpce.common.StringConstants;
import org.opendaylight.transportpce.common.Timeouts;
+import org.opendaylight.transportpce.common.mapping.PortMapping;
+import org.opendaylight.transportpce.common.service.ServiceTypes;
import org.opendaylight.transportpce.renderer.ModelMappingUtils;
import org.opendaylight.transportpce.renderer.ServicePathInputData;
import org.opendaylight.transportpce.renderer.provisiondevice.servicepath.ServicePathDirection;
import org.opendaylight.transportpce.renderer.provisiondevice.tasks.OlmPowerSetupTask;
import org.opendaylight.transportpce.renderer.provisiondevice.tasks.OtnDeviceRenderingTask;
import org.opendaylight.transportpce.renderer.provisiondevice.tasks.RollbackProcessor;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.OtnServicePathInput;
-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.rev210618.OtnServicePathInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.OtnServicePathOutput;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmInputBuilder;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmOutput;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerSetupInput;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.ServicePowerTurndownOutput;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.TransportpceOlmService;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.get.pm.output.Measurements;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210426.mapping.Mapping;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev201125.RendererRpcResultSp;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev201125.RendererRpcResultSpBuilder;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev201125.ServiceDeleteInput;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev201125.ServiceDeleteOutput;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev201125.ServiceImplementationRequestInput;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev201125.ServiceImplementationRequestOutput;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev200327.ODU4;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev200327.ODUCn;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev200327.OTU4;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev200327.OTUCn;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev190531.ConnectionType;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.types.rev191129.NodeTypes;
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.openroadm.service.format.rev190531.ServiceFormat;
private final TransportpceOlmService olmService;
private final DataBroker dataBroker;
private final NotificationPublishService notificationPublishService;
+ private final PortMapping portMapping;
private ListeningExecutorService executor;
public RendererServiceOperationsImpl(DeviceRendererService deviceRenderer,
OtnDeviceRendererService otnDeviceRenderer, TransportpceOlmService olmService,
- DataBroker dataBroker, NotificationPublishService notificationPublishService) {
+ DataBroker dataBroker, NotificationPublishService notificationPublishService, PortMapping portMapping) {
this.deviceRenderer = deviceRenderer;
this.otnDeviceRenderer = otnDeviceRenderer;
this.olmService = olmService;
this.dataBroker = dataBroker;
this.notificationPublishService = notificationPublishService;
+ this.portMapping = portMapping;
this.executor = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(NUMBER_OF_THREADS));
}
public ServiceImplementationRequestOutput call() throws Exception {
sendNotifications(ServicePathNotificationTypes.ServiceImplementationRequest, input.getServiceName(),
RpcStatusEx.Pending, "Service compliant, submitting service implementation Request ...");
- // Here is the switch statement that distinguishes on the connection-type
- LOG.info("Connection-type is {} for {}", input.getConnectionType(), input.getServiceName());
- switch (input.getConnectionType()) {
- case Service: case RoadmLine: // This takes into account of Ethernet 100G, 1G, 10G and ODU4
- LOG.info("RPC implementation for {}", input.getConnectionType());
- if (((input.getServiceAEnd().getServiceRate() != null)
- && ((input.getServiceAEnd().getServiceRate().intValue() == 100))
- || (input.getServiceAEnd().getServiceRate().intValue() == 400))
- && ((input.getServiceAEnd().getServiceFormat().getName().equals("Ethernet"))
- || (input.getServiceAEnd().getServiceFormat().getName().equals("OC")))) {
- LOG.info("Service format for {} is {} and rate is {}", input.getServiceName(),
- input.getServiceAEnd().getServiceFormat(), input.getServiceAEnd().getServiceRate());
- if (!createServicepathInput(input)) {
- return ModelMappingUtils.createServiceImplResponse(ResponseCodes.RESPONSE_FAILED,
- OPERATION_FAILED);
- }
- } else { // This implies, service-rate is 1 or 10G
- // This includes the lower-order odu (1G, 10G, 100G) and this is A-Z side
- LOG.info("RPC implementation for LO-ODU");
- String serviceRate = ""; // Assuming service at A-side and Z-side has same service rate
- if (input.getServiceAEnd().getServiceRate() != null) {
- serviceRate = input.getServiceAEnd().getServiceRate().toString() + "G";
- }
- LOG.info("Start rendering for {} service with {} rate and {} format",
- input.getServiceName(), serviceRate,
- input.getServiceAEnd().getServiceFormat());
- // This is A-Z side
- OtnServicePathInput otnServicePathInputAtoZ = ModelMappingUtils
- .rendererCreateOtnServiceInput(input.getServiceName(),
- input.getServiceAEnd().getServiceFormat().getName(),
- serviceRate, (PathDescription) input.getPathDescription(), true);
- // Rollback should be same for all conditions, so creating a new one
- RollbackProcessor rollbackProcessor = new RollbackProcessor();
- List<OtnDeviceRenderingResult> otnRenderingResults = otnDeviceRendering(rollbackProcessor,
- otnServicePathInputAtoZ, null);
- if (rollbackProcessor.rollbackAllIfNecessary() > 0) {
- sendNotifications(ServicePathNotificationTypes.ServiceImplementationRequest,
- input.getServiceName(), RpcStatusEx.Failed, DEVICE_RENDERING_ROLL_BACK_MSG);
- return ModelMappingUtils.createServiceImplResponse(ResponseCodes.RESPONSE_FAILED,
- OPERATION_FAILED);
- }
- LOG.info("OTN rendering result size {}", otnRenderingResults.size());
+ Uint32 serviceRate = getServiceRate(input);
+ String serviceType;
+ if (NodeTypes.Xpdr.equals(portMapping.getNode(input.getServiceAEnd().getNodeId())
+ .getNodeInfo().getNodeType())
+ && input.getServiceAEnd().getTxDirection() != null
+ && input.getServiceAEnd().getTxDirection().getPort() != null
+ && input.getServiceAEnd().getTxDirection().getPort().getPortName() != null) {
+ Mapping mapping = portMapping.getMapping(input.getServiceAEnd().getNodeId(),
+ input.getServiceAEnd().getTxDirection().getPort().getPortName());
+ serviceType = ServiceTypes.getServiceType(input.getServiceAEnd().getServiceFormat().getName(),
+ serviceRate, mapping);
+ } else {
+ serviceType = ServiceTypes.getServiceType(input.getServiceAEnd().getServiceFormat().getName(),
+ serviceRate, null);
+ }
+
+ switch (serviceType) {
+ case StringConstants.SERVICE_TYPE_100GE_T:
+ case StringConstants.SERVICE_TYPE_400GE:
+ case StringConstants.SERVICE_TYPE_OTU4:
+ case StringConstants.SERVICE_TYPE_OTUC4:
+ if (!createServicepathInput(input)) {
+ return ModelMappingUtils.createServiceImplResponse(ResponseCodes.RESPONSE_FAILED,
+ OPERATION_FAILED);
}
break;
- case Infrastructure:
- LOG.info("RPC implementation for {}", input.getConnectionType());
- if (input.getServiceAEnd().getOtuServiceRate() != null) {
- if ((input.getServiceAEnd().getOtuServiceRate().equals(OTU4.class))
- || (input.getServiceAEnd().getOtuServiceRate().equals(OTUCn.class))) {
- // For the service of OTU4 or OTUCn infrastructure
- // Create the OCH and OTU interfaces for OTU4 class
- // Create OTSi, OTSi-group and OTUCn interface
- if (!createServicepathInput(input)) {
- return ModelMappingUtils.createServiceImplResponse(ResponseCodes.RESPONSE_FAILED,
- OPERATION_FAILED);
- }
- }
- }
- if (input.getServiceAEnd().getOduServiceRate() != null) {
- String serviceRate = null;
- if (input.getServiceAEnd().getOduServiceRate().equals(ODU4.class)) {
- // For the service of OTU4 infrastructure
- serviceRate = "100G"; // For OtnDeviceRendererServiceImpl
- }
- else if (input.getServiceAEnd().getOduServiceRate().equals(ODUCn.class)) {
- // For the service of OTUCn infrastructure
- // TODO: what happens if split-lambda where to be used? We will have ODUC2 rate,
- // TODO: which case service-rate would be 200
- // TODO: in that case it would be 200G?? Need to understand more
- serviceRate = "400G"; // For OtnDeviceRendererServiceImpl
- }
- LOG.info("Service format for {} is {} and rate is {}", input.getServiceName(),
- input.getServiceAEnd().getOduServiceRate(), serviceRate);
- // Now start rendering ODU4 or ODUC4 interface
- // This is A-Z side
- OtnServicePathInput otnServicePathInputAtoZ = ModelMappingUtils
- .rendererCreateOtnServiceInput(input.getServiceName(),
- input.getServiceAEnd().getServiceFormat().getName(),
- serviceRate,
- input.getPathDescription(), true);
- // This is Z-A side
- OtnServicePathInput otnServicePathInputZtoA = ModelMappingUtils
- .rendererCreateOtnServiceInput(input.getServiceName(),
- input.getServiceZEnd().getServiceFormat().getName(),
- serviceRate,
- input.getPathDescription(), false);
- // Rollback should be same for all conditions, so creating a new one
- RollbackProcessor rollbackProcessor = new RollbackProcessor();
- List<OtnDeviceRenderingResult> otnRenderingResults = otnDeviceRendering(rollbackProcessor,
- otnServicePathInputAtoZ, otnServicePathInputZtoA);
- if (rollbackProcessor.rollbackAllIfNecessary() > 0) {
- sendNotifications(ServicePathNotificationTypes.ServiceImplementationRequest,
- input.getServiceName(), RpcStatusEx.Failed, DEVICE_RENDERING_ROLL_BACK_MSG);
- return ModelMappingUtils.createServiceImplResponse(ResponseCodes.RESPONSE_FAILED,
- OPERATION_FAILED);
- }
- LOG.info("OTN rendering result size {}", otnRenderingResults.size());
+ case StringConstants.SERVICE_TYPE_1GE:
+ case StringConstants.SERVICE_TYPE_10GE:
+ case StringConstants.SERVICE_TYPE_ODU4:
+ case StringConstants.SERVICE_TYPE_ODUC4:
+ // This is A-Z side
+ OtnServicePathInput otnServicePathInputAtoZ = ModelMappingUtils
+ .rendererCreateOtnServiceInput(input.getServiceName(),
+ input.getServiceAEnd().getServiceFormat().getName(),
+ serviceRate,
+ input.getPathDescription(), true);
+ // This is Z-A side
+ OtnServicePathInput otnServicePathInputZtoA = ModelMappingUtils
+ .rendererCreateOtnServiceInput(input.getServiceName(),
+ input.getServiceZEnd().getServiceFormat().getName(),
+ serviceRate,
+ input.getPathDescription(), false);
+ // Rollback should be same for all conditions, so creating a new one
+ RollbackProcessor rollbackProcessor = new RollbackProcessor();
+ otnDeviceRendering(rollbackProcessor, otnServicePathInputAtoZ, otnServicePathInputZtoA);
+ if (rollbackProcessor.rollbackAllIfNecessary() > 0) {
+ sendNotifications(ServicePathNotificationTypes.ServiceImplementationRequest,
+ input.getServiceName(), RpcStatusEx.Failed, DEVICE_RENDERING_ROLL_BACK_MSG);
+ return ModelMappingUtils.createServiceImplResponse(ResponseCodes.RESPONSE_FAILED,
+ OPERATION_FAILED);
}
break;
default:
- LOG.warn("Unsupported connection type {}", input.getConnectionType());
+ LOG.error("unsupported service-type");
+ break;
}
+
sendNotificationsWithPathDescription(
ServicePathNotificationTypes.ServiceImplementationRequest,
input.getServiceName(), RpcStatusEx.Successful, OPERATION_SUCCESSFUL,
return ModelMappingUtils.createServiceDeleteResponse(ResponseCodes.RESPONSE_FAILED,
OPERATION_FAILED);
}
- switch (service.getConnectionType()) {
- case RoadmLine:
- case Service:
- if ((ServiceFormat.Ethernet.equals(service.getServiceAEnd().getServiceFormat())
- || ServiceFormat.OC.equals(service.getServiceAEnd().getServiceFormat()))
- && (Uint32.valueOf("100").equals(service.getServiceAEnd().getServiceRate())
- || Uint32.valueOf("400").equals(service.getServiceAEnd().getServiceRate()))) {
- if (!manageServicePathDeletion(serviceName, pathDescription)) {
- return ModelMappingUtils.createServiceDeleteResponse(ResponseCodes.RESPONSE_FAILED,
- OPERATION_FAILED);
- }
- }
- if (ServiceFormat.Ethernet.equals(service.getServiceAEnd().getServiceFormat())
- && (Uint32.valueOf("10").equals(service.getServiceAEnd().getServiceRate())
- || Uint32.valueOf("1").equals(service.getServiceAEnd().getServiceRate()))) {
- if (!manageOtnServicePathDeletion(serviceName, pathDescription, service)) {
- return ModelMappingUtils.createServiceDeleteResponse(ResponseCodes.RESPONSE_FAILED,
- OPERATION_FAILED);
- }
+ String serviceType = ServiceTypes.getServiceType(service.getServiceAEnd().getServiceFormat().getName(),
+ service.getServiceAEnd().getServiceRate(), null);
+ switch (serviceType) {
+ case StringConstants.SERVICE_TYPE_100GE_T:
+ case StringConstants.SERVICE_TYPE_400GE:
+ case StringConstants.SERVICE_TYPE_OTU4:
+ case StringConstants.SERVICE_TYPE_OTUC4:
+ if (!manageServicePathDeletion(serviceName, pathDescription)) {
+ return ModelMappingUtils.createServiceDeleteResponse(ResponseCodes.RESPONSE_FAILED,
+ OPERATION_FAILED);
}
break;
- case Infrastructure:
- if (ServiceFormat.OTU.equals(service.getServiceAEnd().getServiceFormat())) {
- if (!manageServicePathDeletion(serviceName, pathDescription)) {
- return ModelMappingUtils.createServiceDeleteResponse(ResponseCodes.RESPONSE_FAILED,
- OPERATION_FAILED);
- }
- } else if (ServiceFormat.ODU.equals(service.getServiceAEnd().getServiceFormat())) {
- if (!manageOtnServicePathDeletion(serviceName, pathDescription, service)) {
- return ModelMappingUtils.createServiceDeleteResponse(ResponseCodes.RESPONSE_FAILED,
- OPERATION_FAILED);
- }
+ case StringConstants.SERVICE_TYPE_1GE:
+ case StringConstants.SERVICE_TYPE_10GE:
+ case StringConstants.SERVICE_TYPE_ODU4:
+ case StringConstants.SERVICE_TYPE_ODUC4:
+ if (!manageOtnServicePathDeletion(serviceName, pathDescription, service)) {
+ return ModelMappingUtils.createServiceDeleteResponse(ResponseCodes.RESPONSE_FAILED,
+ OPERATION_FAILED);
}
break;
default:
- LOG.error("Unmanaged connection-type for deletion of service {}", serviceName);
+ LOG.error("unsupported service-type");
break;
- }
+ }
return ModelMappingUtils.createServiceDeleteResponse(ResponseCodes.RESPONSE_OK, OPERATION_SUCCESSFUL);
}
});
}
+ @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
+ value = "UPM_UNCALLED_PRIVATE_METHOD",
+ justification = "call in call() method")
+ private Uint32 getServiceRate(ServiceImplementationRequestInput input) {
+ if (input.getServiceAEnd() == null) {
+ LOG.warn("Unable to get service-rate for service {}", input.getServiceName());
+ return Uint32.ZERO;
+ }
+ if (input.getServiceAEnd().getServiceRate() != null) {
+ return input.getServiceAEnd().getServiceRate();
+ }
+ if (ServiceFormat.OTU.equals(input.getServiceAEnd().getServiceFormat())
+ && input.getServiceAEnd().getOtuServiceRate() != null) {
+ switch (input.getServiceAEnd().getOtuServiceRate().getSimpleName()) {
+ case "OTUCn":
+ return Uint32.valueOf(400);
+ case "OTU4":
+ return Uint32.valueOf(100);
+ case "OTU2":
+ case "OTU2e":
+ return Uint32.valueOf(10);
+ default:
+ LOG.warn("otu-service-rate {} not managed yet", input.getServiceAEnd().getOtuServiceRate()
+ .getSimpleName());
+ return Uint32.ZERO;
+ }
+ } else if (ServiceFormat.ODU.equals(input.getServiceAEnd().getServiceFormat())
+ && input.getServiceAEnd().getOduServiceRate() != null) {
+ switch (input.getServiceAEnd().getOduServiceRate().getSimpleName()) {
+ case "ODUCn":
+ return Uint32.valueOf(400);
+ case "ODU4":
+ return Uint32.valueOf(100);
+ case "ODU2":
+ case "ODU2e":
+ return Uint32.valueOf(10);
+ case "ODU0":
+ return Uint32.valueOf(1);
+ default:
+ LOG.warn("odu-service-rate {} not managed yet", input.getServiceAEnd().getOduServiceRate()
+ .getSimpleName());
+ return Uint32.ZERO;
+ }
+ } else {
+ LOG.warn("Unable to get service-rate for service {} - otu-service-rate should not be null",
+ input.getServiceName());
+ return Uint32.ZERO;
+ }
+ }
+
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
value = "UPM_UNCALLED_PRIVATE_METHOD",
justification = "call in call() method")
private boolean manageOtnServicePathDeletion(String serviceName, PathDescription pathDescription,
Services service) {
OtnServicePathInput ospi = null;
- ospi = ModelMappingUtils.rendererCreateOtnServiceInput(serviceName,
+ if (ConnectionType.Infrastructure.equals(service.getConnectionType())) {
+ ospi = ModelMappingUtils.rendererCreateOtnServiceInput(
+ serviceName, service.getServiceAEnd().getServiceFormat().getName(), Uint32.valueOf(100),
+ pathDescription, true);
+ } else if (ConnectionType.Service.equals(service.getConnectionType())) {
+ ospi = ModelMappingUtils.rendererCreateOtnServiceInput(serviceName,
service.getServiceAEnd().getServiceFormat().getName(),
- service.getServiceAEnd().getServiceRate().toString() + "G", pathDescription, true);
+ service.getServiceAEnd().getServiceRate(), pathDescription, true);
+ }
LOG.info("Deleting otn-service path {} via renderer", serviceName);
sendNotifications(ServicePathNotificationTypes.ServiceDelete, serviceName, RpcStatusEx.Pending,
"Deleting otn-service path via renderer");
import java.util.List;
import java.util.Map;
import org.opendaylight.transportpce.renderer.provisiondevice.DeviceRendererService;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.RendererRollbackInput;
-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.opendaylight.transportpce.device.renderer.rev210618.RendererRollbackInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.RendererRollbackInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.RendererRollbackOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.renderer.rollback.output.FailedToRollback;
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.opendaylight.transportpce.renderer.provisiondevice.DeviceRendererService;
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.opendaylight.transportpce.device.renderer.rev210618.ServicePathOutput;
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 java.util.concurrent.Callable;
import org.opendaylight.transportpce.renderer.provisiondevice.OtnDeviceRendererService;
import org.opendaylight.transportpce.renderer.provisiondevice.OtnDeviceRenderingResult;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.OtnServicePathInput;
-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.rev210618.OtnServicePathInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.OtnServicePathOutput;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
import org.opendaylight.transportpce.renderer.provisiondevice.DeviceRendererService;
import org.opendaylight.transportpce.renderer.provisiondevice.OtnDeviceRendererService;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.CreateOtsOmsInput;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.CreateOtsOmsOutput;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.OtnServicePathInput;
-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.opendaylight.transportpce.device.renderer.rev200128.RendererRollbackInput;
-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.ServicePathInput;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.ServicePathOutput;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.ServicePathOutputBuilder;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.TransportpceDeviceRendererService;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.CreateOtsOmsInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.CreateOtsOmsOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.OtnServicePathInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.OtnServicePathOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.OtnServicePathOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.RendererRollbackInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.RendererRollbackOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.ServicePathInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.ServicePathOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.ServicePathOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.TransportpceDeviceRendererService;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.slf4j.Logger;
<argument ref="olmService" />
<argument ref="dataBroker" />
<argument ref="notificationPublishService" />
+ <argument ref="portMapping" />
</bean>
<bean id="rendererProvider" class="org.opendaylight.transportpce.renderer.RendererProvider"
import org.opendaylight.transportpce.renderer.utils.MountPointUtils;
import org.opendaylight.transportpce.test.AbstractTest;
import org.opendaylight.transportpce.test.stub.MountPointServiceStub;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.CreateOtsOmsInput;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.CreateOtsOmsOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.CreateOtsOmsInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.CreateOtsOmsOutput;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210426.Network;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210426.OpenroadmNodeVersion;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210426.network.Nodes;
MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(NUMBER_OF_THREADS));
NotificationPublishService notificationPublishService = new NotificationPublishServiceMock();
this.rendererServiceOperations = new RendererServiceOperationsImpl(this.deviceRenderer,
- this.otnDeviceRendererService, olmService, getDataBroker(), notificationPublishService);
+ this.otnDeviceRendererService, olmService, getDataBroker(), notificationPublishService, null);
}
import org.opendaylight.transportpce.test.AbstractTest;
import org.opendaylight.transportpce.test.stub.MountPointServiceStub;
import org.opendaylight.transportpce.test.stub.MountPointStub;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.ServicePathOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.ServicePathOutputBuilder;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmInput;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmInputBuilder;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev170418.GetPmOutput;
this.olmService = Mockito.spy(this.olmService);
this.deviceRenderer = Mockito.spy(this.deviceRenderer);
this.rendererServiceOperations = new RendererServiceOperationsImpl(this.deviceRenderer,
- this.otnDeviceRendererService, this.olmService, getDataBroker(), notificationPublishService);
+ this.otnDeviceRendererService, this.olmService, getDataBroker(), notificationPublishService, null);
ServicePathOutputBuilder mockOutputBuilder = new ServicePathOutputBuilder().setResult("success")
.setSuccess(true);
import org.opendaylight.transportpce.renderer.provisiondevice.DeviceRendererService;
import org.opendaylight.transportpce.renderer.provisiondevice.OtnDeviceRendererService;
import org.opendaylight.transportpce.test.AbstractTest;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.CreateOtsOmsInput;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.RendererRollbackInput;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.RendererRollbackOutputBuilder;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.ServicePathInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.CreateOtsOmsInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.RendererRollbackInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.RendererRollbackOutputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.ServicePathInput;
@Ignore
public class DeviceRendererRPCImplTest extends AbstractTest {
package org.opendaylight.transportpce.renderer.utils;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.CreateOtsOmsInput;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.CreateOtsOmsInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.CreateOtsOmsInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.CreateOtsOmsInputBuilder;
public final class CreateOtsOmsDataUtils {
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.RendererRollbackInput;
-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.ServicePathInput;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev200128.ServicePathInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.RendererRollbackInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.RendererRollbackInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.ServicePathInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.ServicePathInputBuilder;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev201125.ServiceImplementationRequestInput;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev201125.ServiceImplementationRequestInputBuilder;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev201125.service.implementation.request.input.PathDescription;
res['interface'][0]['org-openroadm-otn-otu-interfaces:otu'])
def test_08_otn_service_path_create_ODU4(self):
- response = test_utils.otn_service_path_request("create", "service_ODU4", "100G", "ODU",
+ response = test_utils.otn_service_path_request("create", "service_ODU4", "100", "ODU",
[{"node-id": "SPDR-SA1", "network-tp": "XPDR1-NETWORK1"}])
time.sleep(3)
self.assertEqual(response.status_code, requests.codes.ok)
res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['opu'])
def test_11_otn_service_path_create_10GE(self):
- response = test_utils.otn_service_path_request("create", "service1", "10G", "Ethernet",
+ response = test_utils.otn_service_path_request("create", "service1", "10", "Ethernet",
[{"node-id": "SPDR-SA1", "client-tp": "XPDR1-CLIENT4",
"network-tp": "XPDR1-NETWORK1"}],
{"ethernet-encoding": "eth encode",
res['odu-connection'][0]['source'])
def test_16_otn_service_path_delete_10GE(self):
- response = test_utils.otn_service_path_request("delete", "service1", "10G", "Ethernet",
+ response = test_utils.otn_service_path_request("delete", "service1", "10", "Ethernet",
[{"node-id": "SPDR-SA1", "client-tp": "XPDR1-CLIENT4",
"network-tp": "XPDR1-NETWORK1"}],
{"ethernet-encoding": "eth encode",
self.assertEqual(response.status_code, requests.codes.conflict)
def test_21_otn_service_path_delete_ODU4(self):
- response = test_utils.otn_service_path_request("delete", "service_ODU4", "100G", "ODU",
+ response = test_utils.otn_service_path_request("delete", "service_ODU4", "100", "ODU",
[{"node-id": "SPDR-SA1", "network-tp": "XPDR1-NETWORK1"}])
time.sleep(3)
self.assertEqual(response.status_code, requests.codes.ok)
return post_request(URL_SERVICE_PATH, attr)
-def otn_service_path_request(operation: str, servicename: str, servicerate: str, servicetype: str, nodes,
+def otn_service_path_request(operation: str, servicename: str, servicerate: str, serviceformat: str, nodes,
eth_attr=None):
attr = {"service-name": servicename,
"operation": operation,
"service-rate": servicerate,
- "service-type": servicetype,
+ "service-format": serviceformat,
"nodes": nodes}
if eth_attr:
attr.update(eth_attr)