From cc3f7f96f5c2f6d53bb5dad5ffb5e0e61f53802b Mon Sep 17 00:00:00 2001 From: Evangelos Chaniotakis Date: Thu, 25 Jul 2024 08:31:52 -0700 Subject: [PATCH] hotfix for topology modifications (#489) --- CHANGES.md | 4 ++++ backend/pom.xml | 6 +++--- .../main/java/net/es/oscars/topo/enums/Layer.java | 4 +++- .../java/net/es/oscars/topo/pop/TopoPopulator.java | 13 ++++++------- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 0792d180..f54338da 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,8 @@ # OSCARS Release Notes +### 1.2.13 +> Jul 2024 +- Topology hotfix + ### 1.2.12 > Jul 2024 - Add LSP waypoint search API diff --git a/backend/pom.xml b/backend/pom.xml index ce861d9f..d271e7f7 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -7,14 +7,14 @@ org.springframework.boot spring-boot-starter-parent - 3.2.5 + 3.3.2 net.es.oscars backend backend - 1.2.12 + 1.2.13 OSCARS backend @@ -86,7 +86,7 @@ net.es.topo.common topo-common - 0.0.24 + 0.0.28 net.es.nsi diff --git a/backend/src/main/java/net/es/oscars/topo/enums/Layer.java b/backend/src/main/java/net/es/oscars/topo/enums/Layer.java index 157e5957..ae2f0cc9 100644 --- a/backend/src/main/java/net/es/oscars/topo/enums/Layer.java +++ b/backend/src/main/java/net/es/oscars/topo/enums/Layer.java @@ -6,7 +6,9 @@ public enum Layer { INTERNAL, MPLS, LOGICAL, - EDGE; + EDGE, + TAGGED, + UNTAGGED; } diff --git a/backend/src/main/java/net/es/oscars/topo/pop/TopoPopulator.java b/backend/src/main/java/net/es/oscars/topo/pop/TopoPopulator.java index 9f68cb11..3bbb27d8 100644 --- a/backend/src/main/java/net/es/oscars/topo/pop/TopoPopulator.java +++ b/backend/src/main/java/net/es/oscars/topo/pop/TopoPopulator.java @@ -1,6 +1,5 @@ package net.es.oscars.topo.pop; -import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import io.opentelemetry.api.OpenTelemetry; import io.opentelemetry.instrumentation.spring.web.v3_1.SpringWebTelemetry; @@ -132,11 +131,11 @@ public Topology loadTopology() throws TopoException, ResourceAccessException, IO for (OscarsOneDevice discDevice : oscarsOneTopo.getDevices()) { Set deviceCaps = new HashSet<>(); - for (String capString : discDevice.getCapabilities()) { - deviceCaps.add(Layer.valueOf(capString)); + for (OscarsOneCapability os1Cap : discDevice.getCapabilities()) { + deviceCaps.add(Layer.valueOf(os1Cap.toString())); } Set devResVlans = new HashSet<>(); - for (OscarsOneVlan vlan : discDevice.getReservableVlans()) { + for (net.es.topo.common.model.oscars1.IntRange vlan : discDevice.getReservableVlans()) { devResVlans.add(IntRange.builder() .ceiling(vlan.getCeiling()) .floor(vlan.getFloor()) @@ -160,11 +159,11 @@ public Topology loadTopology() throws TopoException, ResourceAccessException, IO devices.put(d.getUrn(), d); for (OscarsOnePort discPort : discDevice.getPorts()) { Set portCaps = new HashSet<>(); - for (String capString : discPort.getCapabilities()) { - portCaps.add(Layer.valueOf(capString)); + for (OscarsOneCapability os1Cap : discPort.getCapabilities()) { + portCaps.add(Layer.valueOf(os1Cap.toString())); } Set portResVlans = new HashSet<>(); - for (OscarsOneVlan vlan : discPort.getReservableVlans()) { + for (net.es.topo.common.model.oscars1.IntRange vlan : discPort.getReservableVlans()) { portResVlans.add(IntRange.builder() .ceiling(vlan.getCeiling()) .floor(vlan.getFloor())