aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeigh, Phillip (pl876u) <phillip.leigh@amdocs.com>2019-02-27 13:31:33 -0500
committerLeigh, Phillip (pl876u) <phillip.leigh@amdocs.com>2019-02-27 15:23:45 -0500
commitd20e0ddf4b8953ce539f1dc7bf7cb4dca30fd189 (patch)
tree721825ccdcce64ad85437742cb97c039fe5e0b8a
parent15c6cfa5faaa3445e7fdad2650d72c76dda1e0b9 (diff)
AaiCtxBuilder:Handle L-Interface & Logical-Link
Also remove resourceVersion and handle empty valude of any attribute (LOG-988) Issue-ID: LOG-988 Issue-ID: LOG-766 Issue-ID: LOG-767 Change-Id: I8b3eef61cebf93690aaa0291f8d0a7c1e3575088 Signed-off-by: Leigh, Phillip (pl876u) <phillip.leigh@amdocs.com>
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/aai/datatype/LInterfaceInstance.java29
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/aai/datatype/LInterfaceInstanceList.java81
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/aai/datatype/LogicalLinkInstance.java351
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/aai/datatype/PInterfaceInstance.java42
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/aai/datatype/PserverInstance.java1
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/aai/datatype/VnfInstance.java23
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/aai/datatype/Vserver.java35
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/aai/util/RestUtil.java423
-rw-r--r--src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/LInterfaceInstanceTest.java31
-rw-r--r--src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/LogicalLinkInstanceTest.java59
-rw-r--r--src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/PInterfaceInstanceTest.java3
-rw-r--r--src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/RestUtilTest.java26
-rw-r--r--src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/VnfInstanceTest.java9
-rw-r--r--src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/VserverTest.java9
-rw-r--r--src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/test/RestServiceTest.java276
-rw-r--r--src/test/resources/junit/aai-service-instance_set4.json44
-rw-r--r--src/test/resources/junit/aai-vserver-set3.json96
-rw-r--r--src/test/resources/junit/genericVnfInput_set6.json148
-rw-r--r--src/test/resources/junit/l-interface-input.json10
-rw-r--r--src/test/resources/junit/l-interface-input2.json10
-rw-r--r--src/test/resources/junit/logical-link-input1.json17
-rw-r--r--src/test/resources/junit/logical-link-input2.json17
-rw-r--r--src/test/resources/junit/logical-link-input3.json17
-rw-r--r--src/test/resources/junit/logical-link-input4.json17
-rw-r--r--src/test/resources/junit/pnfInput_w_pInterface_LInterface.json (renamed from src/test/resources/junit/pnfInput_w_pInterface.json)26
-rw-r--r--src/test/resources/junit/pnfInput_w_pInterface_LInterface_set2.json146
-rw-r--r--src/test/resources/junit/pserverInput_with_pInterface_LInterface.json (renamed from src/test/resources/junit/pserverInput_with_pInterface.json)26
-rw-r--r--src/test/resources/junit/pserverInput_with_pInterface_LInterface_set2.json165
28 files changed, 1904 insertions, 233 deletions
diff --git a/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/LInterfaceInstance.java b/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/LInterfaceInstance.java
index db992b1..fdac64e 100644
--- a/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/LInterfaceInstance.java
+++ b/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/LInterfaceInstance.java
@@ -23,6 +23,9 @@ import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
@@ -56,6 +59,18 @@ public class LInterfaceInstance {
@SerializedName("in-maint")
@Expose
private String inMaint;
+ @SerializedName("relationship-list")
+ @Expose
+ private RelationshipList relationshipList;
+
+ private List<LogicalLinkInstance> logicalLinkInstanceList;
+ public List<LogicalLinkInstance> getLogicalLinkInstanceList() {
+ return logicalLinkInstanceList;
+ }
+
+ public void setLogicalLinkInstanceList(List<LogicalLinkInstance> logicalLinkInstanceList) {
+ this.logicalLinkInstanceList = logicalLinkInstanceList;
+ }
private static final Gson gson = new GsonBuilder().disableHtmlEscaping().create();
@@ -127,6 +142,14 @@ public class LInterfaceInstance {
this.inMaint = inMaint;
}
+ public RelationshipList getRelationshipList() {
+ return relationshipList;
+ }
+
+ public void setRelationshipList(RelationshipList relationshipList) {
+ this.relationshipList = relationshipList;
+ }
+
public static LInterfaceInstance fromJson(String payload) throws AuditException {
try {
if (payload == null || payload.isEmpty()) {
@@ -159,7 +182,7 @@ public class LInterfaceInstance {
*/
public LInterfaceInstance(String interfaceId, String interfaceName, String interfaceRole,
String isPortMirrored, String adminStatus, String networkName,
- String macAddr,String inMaint
+ String macAddr,String inMaint, RelationshipList relationshipList
) {
super();
this.interfaceId = interfaceId;
@@ -170,6 +193,7 @@ public class LInterfaceInstance {
this.networkName = networkName;
this.macAddr = macAddr;
this.inMaint = inMaint;
+ this.relationshipList = relationshipList;
}
@@ -186,6 +210,7 @@ public class LInterfaceInstance {
.append("networkName", networkName)
.append("macAddr", macAddr)
.append("inMaint", inMaint)
+ .append("relationshipList", relationshipList)
.toString();
}
@@ -200,6 +225,7 @@ public class LInterfaceInstance {
.append(networkName)
.append(macAddr)
.append(inMaint)
+ .append(relationshipList)
.toHashCode();
}
@@ -221,6 +247,7 @@ public class LInterfaceInstance {
.append(networkName, rhs.networkName)
.append(macAddr, rhs.macAddr)
.append(inMaint, rhs.inMaint)
+ .append(relationshipList, rhs.relationshipList)
.isEquals();
}
}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/LInterfaceInstanceList.java b/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/LInterfaceInstanceList.java
new file mode 100644
index 0000000..20cd44d
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/LInterfaceInstanceList.java
@@ -0,0 +1,81 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=====================================================
+ */
+package org.onap.pomba.contextbuilder.aai.datatype;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+import java.util.List;
+import javax.validation.Valid;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+public class LInterfaceInstanceList {
+
+ @SerializedName("l-interface")
+ @Expose
+ @Valid
+ private List<LInterfaceInstance> lInterfaceList = null;
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public LInterfaceInstanceList() {
+ }
+
+ /**
+ *
+ * @param lInterfaceList
+ */
+ public LInterfaceInstanceList(List<LInterfaceInstance> lInterfaceList) {
+ super();
+ this.lInterfaceList = lInterfaceList;
+ }
+
+ public List<LInterfaceInstance> getLInterfaceList() {
+ return lInterfaceList;
+ }
+
+ public void setLInterfaceList(List<LInterfaceInstance> lInterfaceList) {
+ this.lInterfaceList = lInterfaceList;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("lInterfaceList", lInterfaceList).toString();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(lInterfaceList).toHashCode();
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if (!(other instanceof LInterfaceInstanceList)) {
+ return false;
+ }
+ LInterfaceInstanceList rhs = ((LInterfaceInstanceList) other);
+ return new EqualsBuilder().append(lInterfaceList, rhs.lInterfaceList).isEquals();
+ }
+
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/LogicalLinkInstance.java b/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/LogicalLinkInstance.java
new file mode 100644
index 0000000..718dfd3
--- /dev/null
+++ b/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/LogicalLinkInstance.java
@@ -0,0 +1,351 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=====================================================
+ */
+
+package org.onap.pomba.contextbuilder.aai.datatype;
+
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+import javax.validation.Valid;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.onap.pomba.contextbuilder.aai.exception.AuditError;
+import org.onap.pomba.contextbuilder.aai.exception.AuditException;
+
+public class LogicalLinkInstance {
+ @SerializedName("link-name")
+ @Expose
+ private String linkName;
+ @SerializedName("link-id")
+ @Expose
+ private String linkId;
+ @SerializedName("model-version-id")
+ @Expose
+ private String modelVersionId;
+ @SerializedName("model-invariant-id")
+ @Expose
+ private String modelInvariantId;
+ @SerializedName("in-maint")
+ @Expose
+ private String inMaint;
+ @SerializedName("link-type")
+ @Expose
+ private String linkType;
+ @SerializedName("routing-protocol")
+ @Expose
+ private String routingProtocol;
+ @SerializedName("speed-value")
+ @Expose
+ private String speedValue;
+ @SerializedName("speed-units")
+ @Expose
+ private String speedUnits;
+ @SerializedName("ip-version")
+ @Expose
+ private String ipVersion;
+ @SerializedName("prov-status")
+ @Expose
+ private String provStatus;
+ @SerializedName("link-role")
+ @Expose
+ private String linkRole;
+ @SerializedName("link-name2")
+ @Expose
+ private String linkName2;
+ @SerializedName("circuit-id")
+ @Expose
+ @Valid
+ private String circuitId;
+ @SerializedName("purpose")
+ @Expose
+ @Valid
+ private String purpose;
+
+
+ public String getLinkName() {
+ return linkName;
+ }
+
+
+ public void setLinkName(String linkName) {
+ this.linkName = linkName;
+ }
+
+
+ public String getLinkId() {
+ return linkId;
+ }
+
+
+ public void setLinkId(String linkId) {
+ this.linkId = linkId;
+ }
+
+
+ public String getModelVersionId() {
+ return modelVersionId;
+ }
+
+
+ public void setModelVersionId(String modelVersionId) {
+ this.modelVersionId = modelVersionId;
+ }
+
+
+ public String getModelInvariantId() {
+ return modelInvariantId;
+ }
+
+
+ public void setModelInvariantId(String modelInvariantId) {
+ this.modelInvariantId = modelInvariantId;
+ }
+
+
+ public String getInMaint() {
+ return inMaint;
+ }
+
+
+ public void setInMaint(String inMaint) {
+ this.inMaint = inMaint;
+ }
+
+
+ public String getLinkType() {
+ return linkType;
+ }
+
+
+ public void setLinkType(String linkType) {
+ this.linkType = linkType;
+ }
+
+
+ public String getRoutingProtocol() {
+ return routingProtocol;
+ }
+
+
+ public void setRoutingProtocol(String routingProtocol) {
+ this.routingProtocol = routingProtocol;
+ }
+
+
+ public String getSpeedValue() {
+ return speedValue;
+ }
+
+
+ public void setSpeedValue(String speedValue) {
+ this.speedValue = speedValue;
+ }
+
+
+ public String getSpeedUnits() {
+ return speedUnits;
+ }
+
+
+ public void setSpeedUnits(String speedUnits) {
+ this.speedUnits = speedUnits;
+ }
+
+
+ public String getIpVersion() {
+ return ipVersion;
+ }
+
+
+ public void setIpVersion(String ipVersion) {
+ this.ipVersion = ipVersion;
+ }
+
+
+ public String getProvStatus() {
+ return provStatus;
+ }
+
+
+ public void setProvStatus(String provStatus) {
+ this.provStatus = provStatus;
+ }
+
+
+ public String getLinkRole() {
+ return linkRole;
+ }
+
+
+ public void setLinkRole(String linkRole) {
+ this.linkRole = linkRole;
+ }
+
+
+ public String getLinkName2() {
+ return linkName2;
+ }
+
+
+ public void setLinkName2(String linkName2) {
+ this.linkName2 = linkName2;
+ }
+
+
+ public String getCircuitId() {
+ return circuitId;
+ }
+
+
+ public void setCircuitId(String circuitId) {
+ this.circuitId = circuitId;
+ }
+
+
+ public String getPurpose() {
+ return purpose;
+ }
+
+
+ public void setPurpose(String purpose) {
+ this.purpose = purpose;
+ }
+
+ private static final Gson gson = new GsonBuilder().disableHtmlEscaping().create();
+
+ public String toJson() {
+ return gson.toJson(this);
+ }
+
+
+ public static LogicalLinkInstance fromJson(String payload) throws AuditException {
+ try {
+ if (payload == null || payload.isEmpty()) {
+ throw new AuditException("Empty Json response");
+ }
+ return gson.fromJson(payload, LogicalLinkInstance.class);
+ } catch (Exception ex) {
+ throw new AuditException(AuditError.JSON_READER_PARSE_ERROR, ex);
+ }
+ }
+
+ /**
+ * No args constructor for use in serialization
+ *
+ */
+ public LogicalLinkInstance() {
+ }
+
+ /**
+ *
+ * @param linkName
+ * @param linkId
+ * @param modelVersionId
+ * @param modelInvariantId
+ * @param linkType
+ * @param routingProtocol
+ * @param speedValue
+ * @param speedUnits
+ * @param provStatus
+ * @param inMaint
+ * @param linkRole
+ * @param ipVersion
+ * @param linkName2
+ *
+ */
+ public LogicalLinkInstance(String linkName, String linkId, String modelVersionId,
+ String modelInvariantId, String linkType,String routingProtocol,
+ String speedValue,String speedUnits,String provStatus,
+ String inMaint, String linkRole, String ipVersion,
+ String linkName2, String circuitId, String purpose) {
+ super();
+ this.linkName = linkName;
+ this.linkId = linkId;
+ this.modelVersionId = modelVersionId;
+ this.modelInvariantId = modelInvariantId;
+ this.linkType = linkType;
+ this.routingProtocol = routingProtocol;
+ this.speedValue = speedValue;
+ this.speedUnits = speedUnits;
+ this.provStatus = provStatus;
+ this.inMaint = inMaint;
+ this.linkRole = linkRole;
+ this.ipVersion = ipVersion;
+ this.linkName2 = linkName2;
+ this.circuitId = circuitId;
+ this.purpose = purpose;
+ }
+
+
+
+ /////////// common functions //////////////////////
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this)
+ .append("linkName", linkName)
+ .append("linkId", linkId)
+ .append("modelInvariantId", modelInvariantId)
+ .append("modelVersionId", modelVersionId)
+ .append("linkType", linkType)
+ .append("routingProtocol", routingProtocol)
+ .append("speedValue", speedValue)
+ .append("speedUnits", speedUnits)
+ .append("ipVersion", ipVersion)
+ .append("provStatus", provStatus)
+ .append("in-maint", inMaint)
+ .append("linkRole", linkRole)
+ .append("linkName2", linkName2)
+ .append("circuitId", circuitId)
+ .append("purpose", purpose)
+ .toString();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(linkName).append(ipVersion).append(speedUnits).append(speedValue).append(circuitId).append(purpose).toHashCode();
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if (!(other instanceof LogicalLinkInstance)) {
+ return false;
+ }
+ LogicalLinkInstance rhs = ((LogicalLinkInstance) other);
+ return new EqualsBuilder()
+ .append(linkName, rhs.linkName)
+ .append(linkId, rhs.linkId)
+ .append(speedUnits, rhs.speedUnits)
+ .append(ipVersion, rhs.ipVersion)
+ .append(linkType, rhs.linkType)
+ .append(speedValue, rhs.speedValue)
+ .append(modelInvariantId, rhs.modelInvariantId)
+ .append(circuitId, rhs.circuitId)
+ .append(linkRole, rhs.linkRole)
+ .append(linkName2, rhs.linkName2)
+ .append(purpose, rhs.purpose)
+ .isEquals();
+ }
+}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/PInterfaceInstance.java b/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/PInterfaceInstance.java
index c343df6..db4b714 100644
--- a/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/PInterfaceInstance.java
+++ b/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/PInterfaceInstance.java
@@ -21,6 +21,9 @@ import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
@@ -62,6 +65,21 @@ public class PInterfaceInstance {
@SerializedName("inv-status")
@Expose
private String invStatus;
+ @SerializedName("l-interfaces")
+ @Expose
+ private LInterfaceInstanceList lInterfaceInstanceList;
+ @SerializedName("relationship-list")
+ @Expose
+ private RelationshipList relationshipList;
+
+ private List<LogicalLinkInstance> logicalLinkInstanceList;
+ public List<LogicalLinkInstance> getLogicalLinkInstanceList() {
+ return logicalLinkInstanceList;
+ }
+
+ public void setLogicalLinkInstanceList(List<LogicalLinkInstance> logicalLinkInstanceList) {
+ this.logicalLinkInstanceList = logicalLinkInstanceList;
+ }
public String getInterfaceName() {
return interfaceName;
@@ -151,6 +169,22 @@ public class PInterfaceInstance {
this.invStatus = invStatus;
}
+ public LInterfaceInstanceList getLInterfaceInstanceList() {
+ return lInterfaceInstanceList;
+ }
+
+ public void setLInterfaceInstanceList(LInterfaceInstanceList lInterfaceInstanceList) {
+ this.lInterfaceInstanceList = lInterfaceInstanceList;
+ }
+
+ public RelationshipList getRelationshipList() {
+ return relationshipList;
+ }
+
+ public void setRelationshipList(RelationshipList relationshipList) {
+ this.relationshipList = relationshipList;
+ }
+
/**
* No args constructor for use in serialization
*
@@ -174,7 +208,8 @@ public class PInterfaceInstance {
*/
public PInterfaceInstance(String interfaceName,String speedValue,String speedUnits,
String portDescription,String equipmentIdentifier,String interfaceRole,String interfaceType,
- String provStatus,String resourceVersion,String inMaint, String invStatus ) {
+ String provStatus,String resourceVersion,String inMaint, String invStatus, LInterfaceInstanceList lInterfaceInstanceList,
+ RelationshipList relationshipList) {
super();
this.interfaceName = interfaceName;
this.speedValue = speedValue;
@@ -187,6 +222,8 @@ public class PInterfaceInstance {
this.resourceVersion = resourceVersion;
this.inMaint = inMaint;
this.invStatus = invStatus;
+ this.lInterfaceInstanceList = lInterfaceInstanceList;
+ this.relationshipList = relationshipList;
}
private static final Gson gson = new GsonBuilder().disableHtmlEscaping().create();
@@ -211,7 +248,8 @@ public class PInterfaceInstance {
return new ToStringBuilder(this).append("interfaceName", interfaceName).append("speedValue", speedValue).append("speedUnits", speedUnits)
.append("portDescription", portDescription).append("equipmentIdentifier", equipmentIdentifier).append("interfaceRole", interfaceRole)
.append("interfaceType", interfaceType).append("provStatus", provStatus).append("resourceVersion", resourceVersion)
- .append("inMaint", inMaint).append("invStatus", invStatus)
+ .append("inMaint", inMaint).append("invStatus", invStatus).append("lInterfaceInstanceList", lInterfaceInstanceList)
+ .append("relationshipList", relationshipList)
.toString();
}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/PserverInstance.java b/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/PserverInstance.java
index d8d6d39..5ca73c5 100644
--- a/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/PserverInstance.java
+++ b/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/PserverInstance.java
@@ -75,7 +75,6 @@ public class PserverInstance {
private String purpose;
@SerializedName("p-interfaces")
@Expose
- @Valid
private PInterfaceInstanceList pInterfaceInstanceList;
public String getPserverId() {
diff --git a/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/VnfInstance.java b/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/VnfInstance.java
index 6346d3a..b0053b3 100644
--- a/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/VnfInstance.java
+++ b/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/VnfInstance.java
@@ -113,8 +113,11 @@ public class VnfInstance {
@Expose
@Valid
private VfModules vfModules;
+ @SerializedName("l-interfaces")
+ @Expose
+ private LInterfaceInstanceList lInterfaceInstanceList;
- private static final Gson gson = new GsonBuilder().disableHtmlEscaping().create();
+ private static final Gson gson = new GsonBuilder().disableHtmlEscaping().create();
public String toJson() {
return gson.toJson(this);
@@ -167,8 +170,9 @@ public class VnfInstance {
* @param isClosedLoopDisabled
* @param licenseKey
* @param managementV6Address
+ * @param lInterfaceInstanceList
*/
- public VnfInstance(String vnfId, String vnfName, String vnfName2, String vnfType, String serviceId, String provisionStatus, String licenseKey, String equipmentRole, String orchestrationStatus, String heatStackId, String msoCatalogKey, String ipv4OamAddress, String ipv4Loopback0Address, String nmLanV6Address, String managementV6Address, Boolean inMaintenance, Boolean isClosedLoopDisabled, String resourceVersion, String modelInvariantId, String modelVersionId, String modelCustomizationId, String nfType, String nfFunction, String nfRole, String nfNamingCode, RelationshipList relationshipList, VfModules vfModules) {
+ public VnfInstance(String vnfId, String vnfName, String vnfName2, String vnfType, String serviceId, String provisionStatus, String licenseKey, String equipmentRole, String orchestrationStatus, String heatStackId, String msoCatalogKey, String ipv4OamAddress, String ipv4Loopback0Address, String nmLanV6Address, String managementV6Address, Boolean inMaintenance, Boolean isClosedLoopDisabled, String resourceVersion, String modelInvariantId, String modelVersionId, String modelCustomizationId, String nfType, String nfFunction, String nfRole, String nfNamingCode, RelationshipList relationshipList, VfModules vfModules, LInterfaceInstanceList lInterfaceInstanceList) {
super();
this.vnfId = vnfId;
this.vnfName = vnfName;
@@ -197,6 +201,7 @@ public class VnfInstance {
this.nfNamingCode = nfNamingCode;
this.relationshipList = relationshipList;
this.vfModules = vfModules;
+ this.lInterfaceInstanceList = lInterfaceInstanceList;
}
public String getVnfId() {
@@ -415,14 +420,22 @@ public class VnfInstance {
this.vfModules = vfModules;
}
+ public LInterfaceInstanceList getLInterfaceInstanceList() {
+ return lInterfaceInstanceList;
+ }
+
+ public void setLInterfaceInstanceList(LInterfaceInstanceList lInterfaceInstanceList) {
+ this.lInterfaceInstanceList = lInterfaceInstanceList;
+ }
+
@Override
public String toString() {
- return new ToStringBuilder(this).append("vnfId", vnfId).append("vnfName", vnfName).append("vnfName2", vnfName2).append("vnfType", vnfType).append("serviceId", serviceId).append("provisionStatus", provisionStatus).append("licenseKey", licenseKey).append("equipmentRole", equipmentRole).append("orchestrationStatus", orchestrationStatus).append("heatStackId", heatStackId).append("msoCatalogKey", msoCatalogKey).append("ipv4OamAddress", ipv4OamAddress).append("ipv4Loopback0Address", ipv4Loopback0Address).append("nmLanV6Address", nmLanV6Address).append("managementV6Address", managementV6Address).append("inMaintenance", inMaintenance).append("isClosedLoopDisabled", isClosedLoopDisabled).append("resourceVersion", resourceVersion).append("modelInvariantId", modelInvariantId).append("modelVersionId", modelVersionId).append("modelCustomizationId", modelCustomizationId).append("nfType", nfType).append("nfFunction", nfFunction).append("nfRole", nfRole).append("nfNamingCode", nfNamingCode).append("relationshipList", relationshipList).append("vfModules", vfModules).toString();
+ return new ToStringBuilder(this).append("vnfId", vnfId).append("vnfName", vnfName).append("vnfName2", vnfName2).append("vnfType", vnfType).append("serviceId", serviceId).append("provisionStatus", provisionStatus).append("licenseKey", licenseKey).append("equipmentRole", equipmentRole).append("orchestrationStatus", orchestrationStatus).append("heatStackId", heatStackId).append("msoCatalogKey", msoCatalogKey).append("ipv4OamAddress", ipv4OamAddress).append("ipv4Loopback0Address", ipv4Loopback0Address).append("nmLanV6Address", nmLanV6Address).append("managementV6Address", managementV6Address).append("inMaintenance", inMaintenance).append("isClosedLoopDisabled", isClosedLoopDisabled).append("resourceVersion", resourceVersion).append("modelInvariantId", modelInvariantId).append("modelVersionId", modelVersionId).append("modelCustomizationId", modelCustomizationId).append("nfType", nfType).append("nfFunction", nfFunction).append("nfRole", nfRole).append("nfNamingCode", nfNamingCode).append("relationshipList", relationshipList).append("vfModules", vfModules).append("lInterfaceInstanceList", lInterfaceInstanceList).toString();
}
@Override
public int hashCode() {
- return new HashCodeBuilder().append(modelCustomizationId).append(serviceId).append(ipv4Loopback0Address).append(vnfType).append(nfFunction).append(modelInvariantId).append(resourceVersion).append(vnfName2).append(relationshipList).append(nmLanV6Address).append(nfRole).append(nfType).append(modelVersionId).append(ipv4OamAddress).append(vnfName).append(inMaintenance).append(msoCatalogKey).append(provisionStatus).append(vfModules).append(equipmentRole).append(vnfId).append(orchestrationStatus).append(nfNamingCode).append(isClosedLoopDisabled).append(heatStackId).append(licenseKey).append(managementV6Address).toHashCode();
+ return new HashCodeBuilder().append(modelCustomizationId).append(serviceId).append(ipv4Loopback0Address).append(vnfType).append(nfFunction).append(modelInvariantId).append(resourceVersion).append(vnfName2).append(relationshipList).append(nmLanV6Address).append(nfRole).append(nfType).append(modelVersionId).append(ipv4OamAddress).append(vnfName).append(inMaintenance).append(msoCatalogKey).append(provisionStatus).append(vfModules).append(equipmentRole).append(vnfId).append(orchestrationStatus).append(nfNamingCode).append(isClosedLoopDisabled).append(heatStackId).append(licenseKey).append(managementV6Address).append(lInterfaceInstanceList).toHashCode();
}
@Override
@@ -434,7 +447,7 @@ public class VnfInstance {
return false;
}
VnfInstance rhs = ((VnfInstance) other);
- return new EqualsBuilder().append(modelCustomizationId, rhs.modelCustomizationId).append(serviceId, rhs.serviceId).append(ipv4Loopback0Address, rhs.ipv4Loopback0Address).append(vnfType, rhs.vnfType).append(nfFunction, rhs.nfFunction).append(modelInvariantId, rhs.modelInvariantId).append(resourceVersion, rhs.resourceVersion).append(vnfName2, rhs.vnfName2).append(relationshipList, rhs.relationshipList).append(nmLanV6Address, rhs.nmLanV6Address).append(nfRole, rhs.nfRole).append(nfType, rhs.nfType).append(modelVersionId, rhs.modelVersionId).append(ipv4OamAddress, rhs.ipv4OamAddress).append(vnfName, rhs.vnfName).append(inMaintenance, rhs.inMaintenance).append(msoCatalogKey, rhs.msoCatalogKey).append(provisionStatus, rhs.provisionStatus).append(vfModules, rhs.vfModules).append(equipmentRole, rhs.equipmentRole).append(vnfId, rhs.vnfId).append(orchestrationStatus, rhs.orchestrationStatus).append(nfNamingCode, rhs.nfNamingCode).append(isClosedLoopDisabled, rhs.isClosedLoopDisabled).append(heatStackId, rhs.heatStackId).append(licenseKey, rhs.licenseKey).append(managementV6Address, rhs.managementV6Address).isEquals();
+ return new EqualsBuilder().append(modelCustomizationId, rhs.modelCustomizationId).append(serviceId, rhs.serviceId).append(ipv4Loopback0Address, rhs.ipv4Loopback0Address).append(vnfType, rhs.vnfType).append(nfFunction, rhs.nfFunction).append(modelInvariantId, rhs.modelInvariantId).append(resourceVersion, rhs.resourceVersion).append(vnfName2, rhs.vnfName2).append(relationshipList, rhs.relationshipList).append(nmLanV6Address, rhs.nmLanV6Address).append(nfRole, rhs.nfRole).append(nfType, rhs.nfType).append(modelVersionId, rhs.modelVersionId).append(ipv4OamAddress, rhs.ipv4OamAddress).append(vnfName, rhs.vnfName).append(inMaintenance, rhs.inMaintenance).append(msoCatalogKey, rhs.msoCatalogKey).append(provisionStatus, rhs.provisionStatus).append(vfModules, rhs.vfModules).append(equipmentRole, rhs.equipmentRole).append(vnfId, rhs.vnfId).append(orchestrationStatus, rhs.orchestrationStatus).append(nfNamingCode, rhs.nfNamingCode).append(isClosedLoopDisabled, rhs.isClosedLoopDisabled).append(heatStackId, rhs.heatStackId).append(licenseKey, rhs.licenseKey).append(managementV6Address, rhs.managementV6Address).append(lInterfaceInstanceList, rhs.lInterfaceInstanceList).isEquals();
}
}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/Vserver.java b/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/Vserver.java
index 803e65d..948aaa7 100644
--- a/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/Vserver.java
+++ b/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/Vserver.java
@@ -24,6 +24,8 @@ import com.google.gson.annotations.SerializedName;
import java.util.List;
+import javax.validation.Valid;
+
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
@@ -56,13 +58,17 @@ public class Vserver {
@SerializedName("resource-version")
@Expose
private String resourceVersion;
-
@SerializedName("relationship-list")
@Expose
private RelationshipList relationshipList;
+ @SerializedName("l-interfaces")
+ @Expose
+ private LInterfaceInstanceList lInterfaceInstanceList;
+
+
private List<PserverInstance> pserverInstanceList;
- private List<LInterfaceInstance> lInterfaceInstanceList;
+
public List<PserverInstance> getPserverInstanceList() {
return pserverInstanceList;
}
@@ -71,14 +77,6 @@ public class Vserver {
this.pserverInstanceList = pserverInstanceList;
}
- public List<LInterfaceInstance> getlInterfaceInstanceList() {
- return lInterfaceInstanceList;
- }
-
- public void setlInterfaceInstanceList(List<LInterfaceInstance> lInterfaceInstanceList) {
- this.lInterfaceInstanceList = lInterfaceInstanceList;
- }
-
private static final Gson gson = new GsonBuilder().disableHtmlEscaping().create();
public String toJson() {
@@ -115,7 +113,7 @@ public class Vserver {
* @param vserverId
* @param isClosedLoopDisabled
*/
- public Vserver(String vserverId, String vserverName, String vserverName2, String provStatus, String vserverSelflink, Boolean inMaint, Boolean isClosedLoopDisabled, String resourceVersion, RelationshipList relationshipList) {
+ public Vserver(String vserverId, String vserverName, String vserverName2, String provStatus, String vserverSelflink, Boolean inMaint, Boolean isClosedLoopDisabled, String resourceVersion, RelationshipList relationshipList, LInterfaceInstanceList lInterfaceInstanceList) {
super();
this.vserverId = vserverId;
this.vserverName = vserverName;
@@ -126,6 +124,7 @@ public class Vserver {
this.isClosedLoopDisabled = isClosedLoopDisabled;
this.resourceVersion = resourceVersion;
this.relationshipList = relationshipList;
+ this.lInterfaceInstanceList = lInterfaceInstanceList;
}
public String getVserverId() {
@@ -200,14 +199,22 @@ public class Vserver {
this.relationshipList = relationshipList;
}
+ public LInterfaceInstanceList getLInterfaceInstanceList() {
+ return lInterfaceInstanceList;
+ }
+
+ public void setLInterfaceInstanceList(LInterfaceInstanceList lInterfaceInstanceList) {
+ this.lInterfaceInstanceList = lInterfaceInstanceList;
+ }
+
@Override
public String toString() {
- return new ToStringBuilder(this).append("vserverId", vserverId).append("vserverName", vserverName).append("vserverName2", vserverName2).append("provStatus", provStatus).append("vserverSelflink", vserverSelflink).append("inMaint", inMaint).append("isClosedLoopDisabled", isClosedLoopDisabled).append("resourceVersion", resourceVersion).append("relationshipList", relationshipList).toString();
+ return new ToStringBuilder(this).append("vserverId", vserverId).append("vserverName", vserverName).append("vserverName2", vserverName2).append("provStatus", provStatus).append("vserverSelflink", vserverSelflink).append("inMaint", inMaint).append("isClosedLoopDisabled", isClosedLoopDisabled).append("resourceVersion", resourceVersion).append("relationshipList", relationshipList).append("lInterfaceInstanceList", lInterfaceInstanceList).toString();
}
@Override
public int hashCode() {
- return new HashCodeBuilder().append(relationshipList).append(provStatus).append(inMaint).append(vserverName2).append(resourceVersion).append(vserverSelflink).append(vserverName).append(vserverId).append(isClosedLoopDisabled).toHashCode();
+ return new HashCodeBuilder().append(relationshipList).append(lInterfaceInstanceList).append(provStatus).append(inMaint).append(vserverName2).append(resourceVersion).append(vserverSelflink).append(vserverName).append(vserverId).append(isClosedLoopDisabled).toHashCode();
}
@Override
@@ -219,7 +226,7 @@ public class Vserver {
return false;
}
Vserver rhs = ((Vserver) other);
- return new EqualsBuilder().append(relationshipList, rhs.relationshipList).append(provStatus, rhs.provStatus).append(inMaint, rhs.inMaint).append(vserverName2, rhs.vserverName2).append(resourceVersion, rhs.resourceVersion).append(vserverSelflink, rhs.vserverSelflink).append(vserverName, rhs.vserverName).append(vserverId, rhs.vserverId).append(isClosedLoopDisabled, rhs.isClosedLoopDisabled).isEquals();
+ return new EqualsBuilder().append(relationshipList, rhs.relationshipList).append(lInterfaceInstanceList, rhs.lInterfaceInstanceList).append(provStatus, rhs.provStatus).append(inMaint, rhs.inMaint).append(vserverName2, rhs.vserverName2).append(resourceVersion, rhs.resourceVersion).append(vserverSelflink, rhs.vserverSelflink).append(vserverName, rhs.vserverName).append(vserverId, rhs.vserverId).append(isClosedLoopDisabled, rhs.isClosedLoopDisabled).isEquals();
}
}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/aai/util/RestUtil.java b/src/main/java/org/onap/pomba/contextbuilder/aai/util/RestUtil.java
index fcf4589..9f3e953 100644
--- a/src/main/java/org/onap/pomba/contextbuilder/aai/util/RestUtil.java
+++ b/src/main/java/org/onap/pomba/contextbuilder/aai/util/RestUtil.java
@@ -54,6 +54,7 @@ import org.onap.pomba.contextbuilder.aai.datatype.PserverInstance;
import org.onap.pomba.contextbuilder.aai.datatype.PInterfaceInstance;
import org.onap.pomba.contextbuilder.aai.datatype.L3networkInstance;
import org.onap.pomba.contextbuilder.aai.datatype.LInterfaceInstance;
+import org.onap.pomba.contextbuilder.aai.datatype.LogicalLinkInstance;
import org.onap.pomba.contextbuilder.aai.exception.AuditError;
import org.onap.pomba.contextbuilder.aai.exception.AuditException;
import org.slf4j.Logger;
@@ -65,6 +66,7 @@ import org.onap.pomba.common.datatypes.PInterface;
import com.bazaarvoice.jolt.JsonUtils;
import org.onap.pomba.common.datatypes.Pserver;
import org.onap.pomba.common.datatypes.LInterface;
+import org.onap.pomba.common.datatypes.LogicalLink;
public class RestUtil {
@@ -90,9 +92,8 @@ public class RestUtil {
private static final String CATALOG_IMAGE = "image";
private static final String CATALOG_PSERVER = "pserver";
private static final String CATALOG_L3_NETWORK = "l3-network";
+ private static final String CATALOG_LOGICAL_LINK = "logical-link";
private static final String CATALOG_PNF = "pnf";
- private static final String CATALOG_L_INTERFACE = "l-interface";
-
private static final String VF_MODULES = "vf-modules";
private static final String VF_MODULE = "vf-module";
@@ -119,7 +120,6 @@ public class RestUtil {
private static final String ATTRIBUTE_NF_ROLE = "nfRole";
private static final String ATTRIBUTE_NF_TYPE = "nfType";
private static final String ATTRIBUTE_NF_FUNCTION = "nfFunction";
- private static final String ATTRIBUTE_RESOURCE_VERSION = "resourceVersion";
private static final String ATTRIBUTE_NAME2 = "name2";
private static final String ATTRIBUTE_NAME2_SOURCE = "name2Source";
private static final String ATTRIBUTE_EQUIPMENT_TYPE = "equipType";
@@ -150,6 +150,12 @@ public class RestUtil {
private static final String ATTRIBUTE_ADMIN_STATUS = "adminStatus";
private static final String ATTRIBUTE_NFC_NAMING_CODE = "nfcNamingCode";
private static final String ATTRIBUTE_NF_NAMING_CODE = "nfNamingCode";
+ private static final String ATTRIBUTE_LINK_TYPE = "linkType";
+ private static final String ATTRIBUTE_ROUTING_PROTOCOL = "routingProtocol";
+ private static final String ATTRIBUTE_IP_VERSION = "ipVersion";
+ private static final String ATTRIBUTE_PROV_STATUS = "provStatus";
+ private static final String ATTRIBUTE_LINK_ROLE = "linkRole";
+ private static final String ATTRIBUTE_CIRCUIT_ID = "circuitId";
/**
@@ -275,6 +281,16 @@ public class RestUtil {
log.info("Message from AAI for VNF %s,message body: %s", genericVNFURL, JsonUtils.toPrettyJsonString(JsonUtils.jsonToObject(genericVNFPayload)));
// Logic to Create the Generic VNF Instance POJO object
VnfInstance vnfInstance = VnfInstance.fromJson(genericVNFPayload);
+
+ //Obtain L-Interface level logical-link
+ if ((vnfInstance.getLInterfaceInstanceList() != null)
+ &&(!(vnfInstance.getLInterfaceInstanceList().getLInterfaceList().isEmpty()))) {
+ List<LInterfaceInstance> lInterfaceInstList_aai = vnfInstance.getLInterfaceInstanceList().getLInterfaceList();
+ for (LInterfaceInstance lInterfaceInst_aai : lInterfaceInstList_aai) {
+ lInterfaceInst_aai.setLogicalLinkInstanceList(obtainLogicalLinkInfoFromAai ( aaiClient, baseURL,
+ transactionId, aaiBasicAuthorization, lInterfaceInst_aai.getRelationshipList()));
+ }
+ }
vnfLst.add(vnfInstance);
// Update VModule with l3-network list from aai, if any.
@@ -297,8 +313,12 @@ public class RestUtil {
//Obtain l3-network on service level
List<L3networkInstance> l3networkLstInService = retrieveAaiModelDataL3NetworkInServiceLevel (aaiClient, baseURL, transactionId, aaiBasicAuthorization, serviceInstancePayload) ;
+ //Obtain logical-link on service level
+ List<LogicalLinkInstance> logicalLinkInstanceLstInService = obtainLogicalLinkInfoFromAai ( aaiClient, baseURL,
+ transactionId, aaiBasicAuthorization, ServiceInstance.fromJson(serviceInstancePayload).getRelationshipList());
+
// Transform to common model and return
- return transform(ServiceInstance.fromJson(serviceInstancePayload), vnfLst, vnfcMap, l3networkMapInVnf, vnfVfmoduleVserverMap, pnfLst, l3networkLstInService);
+ return transform(ServiceInstance.fromJson(serviceInstancePayload), vnfLst, vnfcMap, l3networkMapInVnf, vnfVfmoduleVserverMap, pnfLst, l3networkLstInService, logicalLinkInstanceLstInService);
}
private static void buildVModuleWithL3NetworkInfo (VnfInstance vnfInstance,
@@ -323,7 +343,7 @@ public class RestUtil {
}
if (!(relatedLinkList.isEmpty())) {
- List<L3networkInstance> l3nwInsLst = queryAaiForL3networkInfo (aaiClient,baseURL,transactionId,aaiBasicAuthorization,relatedLinkList);
+ List<L3networkInstance> l3nwInsLst = queryAaiForL3networkInfo (aaiClient,baseURL,transactionId,aaiBasicAuthorization,relatedLinkList);
if ((l3nwInsLst != null) && (!l3nwInsLst.isEmpty())) {
t_vfModule.setL3NetworkList(l3nwInsLst);
@@ -363,12 +383,96 @@ public class RestUtil {
// Logic to Create the Generic VNF Instance POJO object
PnfInstance pnfInstance = PnfInstance.fromJson(genericPNFPayload);
pnfLst.add(pnfInstance);
+
+ //Obtain P-Interface level logical-link
+ if ((pnfInstance.getPInterfaceInstanceList() != null)
+ &&(!(pnfInstance.getPInterfaceInstanceList().getPInterfaceList().isEmpty()))) {
+ List<PInterfaceInstance> pInterfaceInstList_aai = pnfInstance.getPInterfaceInstanceList().getPInterfaceList();
+ for (PInterfaceInstance pInterfaceInst_aai : pInterfaceInstList_aai) {
+ pInterfaceInst_aai.setLogicalLinkInstanceList(obtainLogicalLinkInfoFromAai ( aaiClient, baseURL,
+ transactionId, aaiBasicAuthorization, pInterfaceInst_aai.getRelationshipList()));
+
+ //Obtain L-Interface level logical-link
+ if ((pInterfaceInst_aai.getLInterfaceInstanceList() != null)
+ &&(!(pInterfaceInst_aai.getLInterfaceInstanceList().getLInterfaceList().isEmpty()))) {
+ List<LInterfaceInstance> lInterfaceInstList_aai = pInterfaceInst_aai.getLInterfaceInstanceList().getLInterfaceList();
+ for (LInterfaceInstance lInterfaceInst_aai : lInterfaceInstList_aai) {
+ lInterfaceInst_aai.setLogicalLinkInstanceList(obtainLogicalLinkInfoFromAai ( aaiClient, baseURL,
+ transactionId, aaiBasicAuthorization, lInterfaceInst_aai.getRelationshipList()));
+ }
+ }
+ }
+ }
}
}
return pnfLst;
}
+ private static List<LogicalLinkInstance> obtainLogicalLinkInfoFromAai(RestClient aaiClient, String baseURL,
+ String transactionId, String aaiBasicAuthorization, RelationshipList logicalLinkRelateionShipList) throws AuditException {
+ if (logicalLinkRelateionShipList == null) {
+ return null;
+ }
+
+ List<Relationship> logicalLinkRelateionShipLocalList = logicalLinkRelateionShipList.getRelationship();
+ if ((logicalLinkRelateionShipLocalList == null) || (logicalLinkRelateionShipLocalList.size() < 1 )) {
+ return null;
+ }
+
+ List<String> relatedLinkList = new ArrayList<>();
+
+ for ( Relationship logicalLinkRelationShip : logicalLinkRelateionShipLocalList ) {
+ if (logicalLinkRelationShip.getRelatedTo().equals(CATALOG_LOGICAL_LINK)) {
+ String logicalLink_RelatedLink = logicalLinkRelationShip.getRelatedLink();
+ relatedLinkList.add(logicalLink_RelatedLink);
+ }
+ }
+
+ if (!(relatedLinkList.isEmpty())) {
+ List<LogicalLinkInstance> logicalLinkInsLst = queryAaiForLogicalLinkData (aaiClient,baseURL,transactionId,aaiBasicAuthorization,relatedLinkList);
+
+ if ((logicalLinkInsLst != null) && (!logicalLinkInsLst.isEmpty())) {
+
+ return logicalLinkInsLst;
+ }
+ }
+
+ return null;
+ }
+
+ private static List<LogicalLinkInstance> queryAaiForLogicalLinkData(RestClient aaiClient, String baseURL,
+ String transactionId, String aaiBasicAuthorization, List<String> genericRelatedLinkLst) throws AuditException {
+ if ( genericRelatedLinkLst.isEmpty()) {
+ return null;
+ }
+
+ log.info(LogMessages.NUMBER_OF_API_CALLS, "Logical-link", genericRelatedLinkLst.size());
+ log.info(LogMessages.API_CALL_LIST, "Logical-link", printOutAPIList(genericRelatedLinkLst));
+
+ String genericDataPayload = null;
+ List<LogicalLinkInstance> instanceLst = new ArrayList<>(); // List of the LogicalLinkInstance POJO object
+
+ for (String genericRelatedLink : genericRelatedLinkLst) {
+ String genericURL = baseURL + genericRelatedLink;
+ // Response from generic l3-network API call
+ genericDataPayload =
+ getResource(aaiClient, genericURL, aaiBasicAuthorization, transactionId, MediaType.valueOf(MediaType.APPLICATION_JSON));
+
+ if (isEmptyJson(genericDataPayload)) {
+ log.info(LogMessages.NOT_FOUND, " url ", genericRelatedLink);
+ } else {
+ log.info("Message from AAI for logical-link %s ,message body: %s",genericRelatedLink, JsonUtils.toPrettyJsonString(JsonUtils.jsonToObject(genericDataPayload)));
+
+ LogicalLinkInstance logicalLinkInstance = LogicalLinkInstance.fromJson(genericDataPayload);
+ instanceLst.add(logicalLinkInstance);
+
+ }
+ }
+
+ return instanceLst;
+ }
+
private static List<L3networkInstance> queryAaiForL3networkInfo(RestClient aaiClient, String baseURL,
String transactionId, String aaiBasicAuthorization, List<String> genericL3networkLinkLst) throws AuditException {
if ( genericL3networkLinkLst.isEmpty()) {
@@ -486,7 +590,7 @@ public class RestUtil {
List<Vserver> vserverLst = new ArrayList<>();
for (String vserverLink : vserverLinkLst) {
- String vserverURL = baseURL + vserverLink;
+ String vserverURL = baseURL + vserverLink + DEPTH;
vserverPayload = getResource(aaiClient, vserverURL, aaiBasicAuthorization, transactionId,
MediaType.valueOf(MediaType.APPLICATION_XML));
@@ -502,10 +606,14 @@ public class RestUtil {
vserver.setPserverInstanceList(pserverInstanceLst);
}
- // add L-interface List if any
- List<LInterfaceInstance> lInterfaceInstanceLst = getLInterfaceInstanceInfoFromAai(vserverPayload, aaiClient, baseURL, transactionId, aaiBasicAuthorization);
- if ((lInterfaceInstanceLst != null) && (!lInterfaceInstanceLst.isEmpty())) {
- vserver.setlInterfaceInstanceList(lInterfaceInstanceLst);
+ //Obtain l-Interface level logical-link
+ if ((vserver.getLInterfaceInstanceList() != null)
+ &&(!(vserver.getLInterfaceInstanceList().getLInterfaceList().isEmpty()))) {
+ List<LInterfaceInstance> lInterfaceInstList_aai = vserver.getLInterfaceInstanceList().getLInterfaceList();
+ for (LInterfaceInstance lInterfaceInst_aai : lInterfaceInstList_aai) {
+ lInterfaceInst_aai.setLogicalLinkInstanceList(obtainLogicalLinkInfoFromAai ( aaiClient, baseURL,
+ transactionId, aaiBasicAuthorization, lInterfaceInst_aai.getRelationshipList()));
+ }
}
vserverLst.add(vserver);
@@ -548,48 +656,33 @@ public class RestUtil {
} else {
log.info("Message from AAI for pserver %s ,message body: %s", pserverURL,pserverPayload);
// Logic to Create the Pserver POJO object
- PserverInstance pserver = PserverInstance.fromJson(pserverPayload);
+ PserverInstance pserverInst = PserverInstance.fromJson(pserverPayload);
+
+ if ((pserverInst.getPInterfaceInstanceList() != null)
+ &&(!(pserverInst.getPInterfaceInstanceList().getPInterfaceList().isEmpty()))) {
+ List<PInterfaceInstance> pInterfaceInstList_aai = pserverInst.getPInterfaceInstanceList().getPInterfaceList();
+ for (PInterfaceInstance pInterfaceInst_aai : pInterfaceInstList_aai) {
+ //Obtain P-Interface level logical-link
+ pInterfaceInst_aai.setLogicalLinkInstanceList(obtainLogicalLinkInfoFromAai ( aaiClient, baseURL,
+ transactionId, aaiBasicAuthorization, pInterfaceInst_aai.getRelationshipList()));
+
+ List<LInterfaceInstance> lInterfaceInstList_aai = pInterfaceInst_aai.getLInterfaceInstanceList().getLInterfaceList();
+ for (LInterfaceInstance lInterfaceInst_aai : lInterfaceInstList_aai) {
+ //Obtain L-Interface level logical-link
+ lInterfaceInst_aai.setLogicalLinkInstanceList(obtainLogicalLinkInfoFromAai ( aaiClient, baseURL,
+ transactionId, aaiBasicAuthorization, lInterfaceInst_aai.getRelationshipList()));
+ }
+
+ }
+ }
//update P-Interface if any.
- pserverLst.add(pserver);
+ pserverLst.add(pserverInst);
}
}
return pserverLst;
}
- private static List<LInterfaceInstance> getLInterfaceInstanceInfoFromAai (String vserverPayload, RestClient aaiClient, String baseURL, String transactionId, String aaiBasicAuthorization) throws AuditException {
- if (vserverPayload == null) {
- //already reported.
- return null;
- }
-
- //Obtain related L-Interface instance info
- List<String> lInterfaceRelatedLinkList = handleRelationshipGeneral (vserverPayload,CATALOG_L_INTERFACE );
- List<LInterfaceInstance> lInterfaceLst = null;
- if ((lInterfaceRelatedLinkList == null) || (lInterfaceRelatedLinkList.isEmpty())){
- // already reported
- return null;
- }
- lInterfaceLst = new ArrayList<>();
- for (String lInterfaceRelatedLink : lInterfaceRelatedLinkList) {
- String lInterfaceURL = baseURL + lInterfaceRelatedLink + DEPTH;;
- String lInterfacePayload = getResource(aaiClient, lInterfaceURL, aaiBasicAuthorization, transactionId,
- MediaType.valueOf(MediaType.APPLICATION_XML));
-
- if (isEmptyJson(lInterfacePayload)) {
- log.info(LogMessages.NOT_FOUND, "L-INTERFACE with url", lInterfaceURL);
- } else {
- log.info("Message from AAI for L-INTERFACE %s ,message body: %s", lInterfaceURL,lInterfacePayload);
- // Logic to Create the Pserver POJO object
- LInterfaceInstance lInterfaceInstance = LInterfaceInstance.fromJson(lInterfacePayload);
-
- //update P-Interface if any.
- lInterfaceLst.add(lInterfaceInstance);
- }
- }
- return lInterfaceLst;
- }
-
private static String getVnfId(String genericVNFPayload) throws AuditException {
VnfInstance vnfInstance = VnfInstance.fromJson(genericVNFPayload);
@@ -603,7 +696,8 @@ public class RestUtil {
Map<String, List<VnfcInstance>> vnfcMap,
Map<String, List<L3networkInstance>> l3networkMap_in_vnf,
Map<String, Map<String, List<Vserver>>> vnf_vfmodule_vserver_Map, List<PnfInstance> pnfLst_fromAAi,
- List<L3networkInstance> l3networkLst_in_service) {
+ List<L3networkInstance> l3networkLst_in_service,
+ List<LogicalLinkInstance> logicalLinkInstanceLstInService) {
ModelContext context = new ModelContext();
Service service = new Service();
service.setModelInvariantUUID(svcInstance.getModelInvariantId());
@@ -624,6 +718,18 @@ public class RestUtil {
vf.setAttributes(populateVnfAttributeList(vnf));
String key = vnf.getVnfId(); // generic vnf-id (top level of the key)
+ //Update Vnf level L-Interface here
+ if ((vnf.getLInterfaceInstanceList() != null) && (!(vnf.getLInterfaceInstanceList().getLInterfaceList().isEmpty()))) {
+ List<LInterfaceInstance> lInterfaceInstanceList = vnf.getLInterfaceInstanceList().getLInterfaceList();
+ List<LInterface> lInterfacelst = null;
+ if (lInterfaceInstanceList != null) {
+ lInterfacelst = getLInterfaceLstInfo (lInterfaceInstanceList);
+ }
+ if ((lInterfacelst != null) && (!lInterfacelst.isEmpty())) {
+ vf.setLInterfaceList(lInterfacelst);
+ }
+ }
+
// ---------------- Handle VNFC data
List<VNFC> vnfcLst = new ArrayList<>();
for (Map.Entry<String, List<VnfcInstance>> entry : vnfcMap.entrySet()) {
@@ -742,14 +848,16 @@ public class RestUtil {
}
vm.setPServer(pServer);
- //Update L-Interface here
- List<LInterfaceInstance> lInterfaceInstanceList = vserver.getlInterfaceInstanceList();
- List<LInterface> lInterfacelst = null;
- if (lInterfaceInstanceList != null) {
- lInterfacelst = getLInterfaceLstInfo (lInterfaceInstanceList);
- }
- if ((lInterfacelst != null) && (!lInterfacelst.isEmpty())) {
- vm.setLInterfaceList(lInterfacelst);
+ //Update VServer level L-Interface here
+ if ((vserver.getLInterfaceInstanceList() != null) && (!(vserver.getLInterfaceInstanceList().getLInterfaceList().isEmpty()))) {
+ List<LInterfaceInstance> lInterfaceInstanceList = vserver.getLInterfaceInstanceList().getLInterfaceList();
+ List<LInterface> lInterfacelst = null;
+ if (lInterfaceInstanceList != null) {
+ lInterfacelst = getLInterfaceLstInfo (lInterfaceInstanceList);
+ }
+ if ((lInterfacelst != null) && (!lInterfacelst.isEmpty())) {
+ vm.setLInterfaceList(lInterfacelst);
+ }
}
vmList.add(vm);
@@ -778,6 +886,9 @@ public class RestUtil {
context.setPnfs(transformPNF(pnfLst_fromAAi));
//Add service-level l3-network info
context.setNetworkList(transformL3Network (l3networkLst_in_service));
+ //Add service-level logical-link info
+ context.setLogicalLinkList(transformLogicalLink(logicalLinkInstanceLstInService));
+
log.info((String.format("ModelContext body: %s ", JsonUtils.toPrettyJsonString(context))));
return context;
}
@@ -954,14 +1065,7 @@ public class RestUtil {
att.setValue(String.valueOf(pserverInstance.getInMaint()));
attributeList.add(att);
}
- if ((name.name().equals(ATTRIBUTE_RESOURCE_VERSION))
- && isValid(pserverInstance.getResourceVersion())){
- Attribute att = new Attribute();
- att.setDataQuality(DataQuality.ok());
- att.setName(Attribute.Name.resourceVersion);
- att.setValue(String.valueOf(pserverInstance.getResourceVersion()));
- attributeList.add(att);
- }
+
if ((name.name().equals(ATTRIBUTE_PURPOSE))
&& isValid(pserverInstance.getPurpose())){
Attribute att = new Attribute();
@@ -1064,6 +1168,9 @@ public class RestUtil {
if (!attributeList.isEmpty()) {
lInterface.setAttributes(attributeList);
}
+
+ // add Logical-link info
+ lInterface.setLogicalLinkList(transformLogicalLink(lInterfaceInstance.getLogicalLinkInstanceList()));
lInterfaceLst.add(lInterface);
}
@@ -1081,6 +1188,17 @@ public class RestUtil {
// pInterface.setUuid( ); // there is no mapping data for UUID from AAI data.
pInterface.setName(pInterfaceInst_aai.getInterfaceName());
pInterface.setDataQuality(DataQuality.ok());
+ //Update L-Interface here
+ if ((pInterfaceInst_aai.getLInterfaceInstanceList() != null) && (!(pInterfaceInst_aai.getLInterfaceInstanceList().getLInterfaceList().isEmpty()))) {
+ List<LInterfaceInstance> lInterfaceInstanceList = pInterfaceInst_aai.getLInterfaceInstanceList().getLInterfaceList();
+ List<LInterface> lInterfacelst = null;
+ if (lInterfaceInstanceList != null) {
+ lInterfacelst = getLInterfaceLstInfo (lInterfaceInstanceList);
+ }
+ if ((lInterfacelst != null) && (!lInterfacelst.isEmpty())) {
+ pInterface.setLInterfaceList(lInterfacelst);
+ }
+ }
List<Attribute> pInterface_attributeList = new ArrayList<>();
updatePInterfaceAttributeList (pInterfaceInst_aai, pInterface_attributeList) ;
@@ -1088,6 +1206,9 @@ public class RestUtil {
pInterface.setAttributes(pInterface_attributeList);
}
+ // add Logical-link info
+ pInterface.setLogicalLinkList(transformLogicalLink(pInterfaceInst_aai.getLogicalLinkInstanceList()));
+
pInterfaceList.add(pInterface);
}
@@ -1129,15 +1250,6 @@ public class RestUtil {
attributeList.add(att);
}
- if ((name.name().equals(ATTRIBUTE_RESOURCE_VERSION))
- && isValid(pnfFromAai.getResourceVersion())){
- Attribute att = new Attribute();
- att.setDataQuality(DataQuality.ok());
- att.setName(Attribute.Name.resourceVersion);
- att.setValue(String.valueOf( pnfFromAai.getResourceVersion()));
- attributeList.add(att);
- }
-
if ((name.name().equals(ATTRIBUTE_NAME2))
&& isValid(pnfFromAai.getPnfName2() )){
Attribute att = new Attribute();
@@ -1233,6 +1345,17 @@ public class RestUtil {
pInterface.setUuid(pInterfaceInst_aai.getEquipmentIdentifier() );
pInterface.setName(pInterfaceInst_aai.getInterfaceName());
pInterface.setDataQuality(DataQuality.ok());
+ //Update L-Interface here
+ if ((pInterfaceInst_aai.getLInterfaceInstanceList() != null) && (!(pInterfaceInst_aai.getLInterfaceInstanceList().getLInterfaceList().isEmpty()))) {
+ List<LInterfaceInstance> lInterfaceInstanceList = pInterfaceInst_aai.getLInterfaceInstanceList().getLInterfaceList();
+ List<LInterface> lInterfacelst = null;
+ if (lInterfaceInstanceList != null) {
+ lInterfacelst = getLInterfaceLstInfo (lInterfaceInstanceList);
+ }
+ if ((lInterfacelst != null) && (!lInterfacelst.isEmpty())) {
+ pInterface.setLInterfaceList(lInterfacelst);
+ }
+ }
List<Attribute> pInterface_attributeList = new ArrayList<>();
updatePInterfaceAttributeList (pInterfaceInst_aai, pInterface_attributeList) ;
@@ -1240,6 +1363,8 @@ public class RestUtil {
pInterface.setAttributes(pInterface_attributeList);
}
+ // add Logical-link info
+ pInterface.setLogicalLinkList(transformLogicalLink(pInterfaceInst_aai.getLogicalLinkInstanceList()));
pInterfaceList.add(pInterface);
}
@@ -1255,6 +1380,8 @@ public class RestUtil {
return pnfLst;
}
+
+
/*
* Transform AAI Representation to Common Model
*/
@@ -1303,15 +1430,6 @@ public class RestUtil {
attributeList.add(att);
}
- if ((name.name().equals(ATTRIBUTE_RESOURCE_VERSION ))
- && isValid(l3networkFromAai.getResourceVersion())){
- Attribute att = new Attribute();
- att.setDataQuality(DataQuality.ok());
- att.setName(Attribute.Name.resourceVersion);
- att.setValue(String.valueOf( l3networkFromAai.getResourceVersion()));
- attributeList.add(att);
- }
-
if ((name.name().equals(ATTRIBUTE_PHYSICAL_NETWORK_NAME ))
&& isValid(l3networkFromAai.getPhysicalNetworkName())){
Attribute att = new Attribute();
@@ -1342,6 +1460,137 @@ public class RestUtil {
return l3NetworkLst;
}
+ /*
+ * Transform AAI Representation to Common Model
+ */
+ public static List<LogicalLink> transformLogicalLink(List<LogicalLinkInstance> logicalLinkInstanceLstFromAAI) {
+ if ((logicalLinkInstanceLstFromAAI == null ) || (logicalLinkInstanceLstFromAAI.isEmpty())) {
+ log.info(LogMessages.API_CALL_LIST, "Nill logical-link instance list");
+ return null;
+ }
+ List<LogicalLink> logicalLinkLst = new ArrayList<>();
+
+ for (LogicalLinkInstance logicalLinkInstFromAai : logicalLinkInstanceLstFromAAI) {
+ LogicalLink logicalLink = new LogicalLink();
+ logicalLink.setUuid(logicalLinkInstFromAai.getLinkId());
+ logicalLink.setName(logicalLinkInstFromAai.getLinkName());
+ logicalLink.setModelVersionID(logicalLinkInstFromAai.getModelVersionId());
+ logicalLink.setModelInvariantUUID(logicalLinkInstFromAai.getModelInvariantId());
+ logicalLink.setDataQuality(DataQuality.ok());
+ List<Attribute> attributeList = new ArrayList<>();
+
+ // Iterate through the ENUM Attribute list
+ for (Attribute.Name name: Attribute.Name.values()) {
+ if ((name.name().equals(ATTRIBUTE_LOCKEDBOOLEAN ))
+ && isValid(logicalLinkInstFromAai.getInMaint())){
+ Attribute att = new Attribute();
+ att.setDataQuality(DataQuality.ok());
+ att.setName(Attribute.Name.lockedBoolean);
+ att.setValue(String.valueOf( logicalLinkInstFromAai.getInMaint()));
+ attributeList.add(att);
+ }
+
+ if ((name.name().equals(ATTRIBUTE_LINK_TYPE ))
+ && isValid(logicalLinkInstFromAai.getLinkType())){
+ Attribute att = new Attribute();
+ att.setDataQuality(DataQuality.ok());
+ att.setName(Attribute.Name.linkType);
+ att.setValue(String.valueOf( logicalLinkInstFromAai.getLinkType()));
+ attributeList.add(att);
+ }
+
+ if ((name.name().equals(ATTRIBUTE_ROUTING_PROTOCOL ))
+ && isValid(logicalLinkInstFromAai.getRoutingProtocol())){
+ Attribute att = new Attribute();
+ att.setDataQuality(DataQuality.ok());
+ att.setName(Attribute.Name.routingProtocol);
+ att.setValue(String.valueOf( logicalLinkInstFromAai.getRoutingProtocol()));
+ attributeList.add(att);
+ }
+
+ if ((name.name().equals(ATTRIBUTE_SPEED_VALUE ))
+ && isValid(logicalLinkInstFromAai.getSpeedValue())){
+ Attribute att = new Attribute();
+ att.setDataQuality(DataQuality.ok());
+ att.setName(Attribute.Name.speedValue);
+ att.setValue(String.valueOf( logicalLinkInstFromAai.getSpeedValue()));
+ attributeList.add(att);
+ }
+
+ if ((name.name().equals(ATTRIBUTE_SPEED_UNITS ))
+ && isValid(logicalLinkInstFromAai.getSpeedUnits())){
+ Attribute att = new Attribute();
+ att.setDataQuality(DataQuality.ok());
+ att.setName(Attribute.Name.speedUnits);
+ att.setValue(String.valueOf( logicalLinkInstFromAai.getSpeedUnits()));
+ attributeList.add(att);
+ }
+
+ if ((name.name().equals(ATTRIBUTE_IP_VERSION ))
+ && isValid(logicalLinkInstFromAai.getIpVersion())){
+ Attribute att = new Attribute();
+ att.setDataQuality(DataQuality.ok());
+ att.setName(Attribute.Name.ipVersion);
+ att.setValue(String.valueOf( logicalLinkInstFromAai.getIpVersion()));
+ attributeList.add(att);
+ }
+
+ if ((name.name().equals(ATTRIBUTE_PROV_STATUS ))
+ && isValid(logicalLinkInstFromAai.getProvStatus())){
+ Attribute att = new Attribute();
+ att.setDataQuality(DataQuality.ok());
+ att.setName(Attribute.Name.provStatus);
+ att.setValue(String.valueOf( logicalLinkInstFromAai.getProvStatus()));
+ attributeList.add(att);
+ }
+
+ if ((name.name().equals(ATTRIBUTE_LINK_ROLE ))
+ && isValid(logicalLinkInstFromAai.getLinkRole())){
+ Attribute att = new Attribute();
+ att.setDataQuality(DataQuality.ok());
+ att.setName(Attribute.Name.linkRole);
+ att.setValue(String.valueOf( logicalLinkInstFromAai.getLinkRole()));
+ attributeList.add(att);
+ }
+
+ if ((name.name().equals(ATTRIBUTE_NAME2 ))
+ && isValid(logicalLinkInstFromAai.getLinkName2())){
+ Attribute att = new Attribute();
+ att.setDataQuality(DataQuality.ok());
+ att.setName(Attribute.Name.name2);
+ att.setValue(String.valueOf( logicalLinkInstFromAai.getLinkName2()));
+ attributeList.add(att);
+ }
+
+ if ((name.name().equals(ATTRIBUTE_CIRCUIT_ID ))
+ && isValid(logicalLinkInstFromAai.getCircuitId())){
+ Attribute att = new Attribute();
+ att.setDataQuality(DataQuality.ok());
+ att.setName(Attribute.Name.circuitId);
+ att.setValue(String.valueOf( logicalLinkInstFromAai.getCircuitId()));
+ attributeList.add(att);
+ }
+
+ if ((name.name().equals(ATTRIBUTE_PURPOSE ))
+ && isValid(logicalLinkInstFromAai.getPurpose())){
+ Attribute att = new Attribute();
+ att.setDataQuality(DataQuality.ok());
+ att.setName(Attribute.Name.purpose);
+ att.setValue(String.valueOf( logicalLinkInstFromAai.getPurpose()));
+ attributeList.add(att);
+ }
+ }
+
+ if (!attributeList.isEmpty()) {
+ logicalLink.setAttributes(attributeList);
+ }
+
+ logicalLinkLst.add(logicalLink);
+ } // done the vnfInstance
+
+ return logicalLinkLst;
+ }
+
private static void updatePInterfaceAttributeList(PInterfaceInstance pInterfaceInstFromAai, List<Attribute> pInterfaceAttributeList ) {
// Iterate through the ENUM Attribute list
for (Attribute.Name name: Attribute.Name.values()) {
@@ -1399,15 +1648,6 @@ public class RestUtil {
pInterfaceAttributeList.add(att);
}
- if ((name.name().equals( ATTRIBUTE_RESOURCE_VERSION ))
- && isValid(pInterfaceInstFromAai.getResourceVersion())){
- Attribute att = new Attribute();
- att.setDataQuality(DataQuality.ok());
- att.setName(Attribute.Name.resourceVersion);
- att.setValue(String.valueOf( pInterfaceInstFromAai.getResourceVersion()));
- pInterfaceAttributeList.add(att);
- }
-
if ((name.name().equals( ATTRIBUTE_LOCKEDBOOLEAN ))
&& isValid(pInterfaceInstFromAai.getInMaint())){
Attribute att = new Attribute();
@@ -1773,11 +2013,6 @@ public class RestUtil {
if (inputField == null) {
return false;
}
- String localInputField = inputField.trim();
-
- if (localInputField.equals("")) {
- return false;
- }
return true;
}
diff --git a/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/LInterfaceInstanceTest.java b/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/LInterfaceInstanceTest.java
index dbca0d0..1dde19d 100644
--- a/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/LInterfaceInstanceTest.java
+++ b/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/LInterfaceInstanceTest.java
@@ -21,44 +21,15 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
-import org.onap.pomba.contextbuilder.aai.datatype.L3networkInstance;
import org.onap.pomba.contextbuilder.aai.datatype.LInterfaceInstance;
public class LInterfaceInstanceTest {
- @Test
- public void testL3networkInstanceEquals() {
- L3networkInstance l3networkInstance1 = new L3networkInstance
- ( "networkId1", "networkName1", "networkType1",
- "networkRole1", "networkTechnology1", "resourceVersion1",
- "modelInvariantId1", "modelVersionId1", "physicalNetworkName1", "true",
- null);
-
- L3networkInstance l3networkInstance2 = new L3networkInstance ();
- l3networkInstance2.setNetworkId("networkId1");
- l3networkInstance2.setNetworkName("networkName1");
- l3networkInstance2.setNetworkType("networkType1");
- l3networkInstance2.setNetworkRole("networkRole1");
- l3networkInstance2.setNetworkTechnology("networkTechnology1");
- l3networkInstance2.setResourceVersion("resourceVersion1");
- l3networkInstance2.setModelInvariantId("modelInvariantId1");
- l3networkInstance2.setModelVersionId("modelVersionId1");
- l3networkInstance2.setPhysicalNetworkName("physicalNetworkName1");
- l3networkInstance2.setSharedNetworkBoolean("true");
- l3networkInstance2.setRelationshipList(null);
-
- l3networkInstance1.toJson();
- l3networkInstance1.toString();
- assertEquals("physicalNetworkName1", l3networkInstance2.getPhysicalNetworkName());
- assertTrue(l3networkInstance1.equals(l3networkInstance1));
- assertTrue(l3networkInstance1.equals(l3networkInstance2));
- }
-
@Test
public void testLInterfaceInstanceEquals() {
LInterfaceInstance lInterfaceInstance1 = new LInterfaceInstance
( "interfaceId1", "interfaceName1", "interfaceRole1",
"isPortMirrored1", "adminStatus1", "networkName1",
- "macAddr1", "inMaint1");
+ "macAddr1", "inMaint1", null);
LInterfaceInstance lInterfaceInstance2 = new LInterfaceInstance ();
lInterfaceInstance2.setInterfaceId("interfaceId1");
diff --git a/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/LogicalLinkInstanceTest.java b/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/LogicalLinkInstanceTest.java
new file mode 100644
index 0000000..b0c4ea8
--- /dev/null
+++ b/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/LogicalLinkInstanceTest.java
@@ -0,0 +1,59 @@
+/*
+ * ============LICENSE_START===================================================
+ * Copyright (c) 2018 Amdocs
+ * ============================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=====================================================
+ */
+package org.onap.logging_analytics.pomba.pomba_aai_context_builder;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+import org.onap.pomba.contextbuilder.aai.datatype.LogicalLinkInstance;
+
+public class LogicalLinkInstanceTest {
+ @Test
+ public void testLogicalLinkInstanceEquals() {
+ LogicalLinkInstance logicalLinkInstance1 = new LogicalLinkInstance
+ ( "linkName1", "linkId1", "modelVersionId1",
+ "modelInvariantId1", "linkType1", "routingProtocol1",
+ "speedValue1", "speedUnits1", "provStatus1",
+ "inMaint1", "linkRole1", "ipVersion1",
+ "linkName21","circuitId1","purpose1");
+
+ LogicalLinkInstance logicalLinkInstance2 = new LogicalLinkInstance ();
+ logicalLinkInstance2.setLinkName("linkName1");
+ logicalLinkInstance2.setLinkId("linkId1");
+ logicalLinkInstance2.setModelVersionId("modelVersionId1");
+ logicalLinkInstance2.setModelInvariantId("modelInvariantId1");
+ logicalLinkInstance2.setLinkType("linkType1");
+ logicalLinkInstance2.setRoutingProtocol("routingProtocol1");
+ logicalLinkInstance2.setSpeedValue("speedValue1");
+ logicalLinkInstance2.setSpeedUnits("speedUnits1");
+ logicalLinkInstance2.setProvStatus("provStatus1");
+ logicalLinkInstance2.setInMaint("inMaint1");
+ logicalLinkInstance2.setLinkRole("linkRole1");
+ logicalLinkInstance2.setIpVersion("ipVersion1");
+ logicalLinkInstance2.setLinkName2("linkName21");
+ logicalLinkInstance2.setCircuitId("circuitId1");
+ logicalLinkInstance2.setPurpose("purpose1");
+
+ logicalLinkInstance1.toJson();
+ logicalLinkInstance1.toString();
+ assertEquals("linkName1", logicalLinkInstance2.getLinkName());
+ assertTrue(logicalLinkInstance1.equals(logicalLinkInstance1));
+ assertTrue(logicalLinkInstance1.equals(logicalLinkInstance2));
+ }
+}
diff --git a/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/PInterfaceInstanceTest.java b/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/PInterfaceInstanceTest.java
index 2a0bbb2..33bba56 100644
--- a/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/PInterfaceInstanceTest.java
+++ b/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/PInterfaceInstanceTest.java
@@ -22,6 +22,7 @@ import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.onap.pomba.contextbuilder.aai.datatype.PInterfaceInstance;
+import org.onap.pomba.contextbuilder.aai.datatype.LInterfaceInstanceList;
public class PInterfaceInstanceTest {
@@ -30,7 +31,7 @@ public class PInterfaceInstanceTest {
PInterfaceInstance pInterfaceInstance1 = new PInterfaceInstance
( "interfaceName1", "speedValue1", "speedUnits1",
"portDescription1", "equipmentIdentifier1", "interfaceRole1", "interfaceType1",
- "provStatus1", "resourceVersion1", "inMaint1", "invStatus1" );
+ "provStatus1", "resourceVersion1", "inMaint1", "invStatus1" , new LInterfaceInstanceList(), null);
PInterfaceInstance pInterfaceInstance2 = new PInterfaceInstance ();
pInterfaceInstance2.setInterfaceName("interfaceName1");
diff --git a/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/RestUtilTest.java b/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/RestUtilTest.java
index a7be281..e184f4d 100644
--- a/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/RestUtilTest.java
+++ b/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/RestUtilTest.java
@@ -188,7 +188,7 @@ public class RestUtilTest {
// note: match to vserver-id to the path of "vserver" in (3)
addResponse(
"/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant"
- + "/b49b830686654191bb1e952a74b014ad/vservers/vserver/b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a",
+ + "/b49b830686654191bb1e952a74b014ad/vservers/vserver/b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a" + DEPTH,
"junit/aai-vserver.json", aaiEnricherRule);
// 5. simulate the rsp of pserver
@@ -212,7 +212,7 @@ public class RestUtilTest {
////
@Test
- public void testretrieveAAIModelDataFromAAI_PInterface_with_PNF() throws Exception {
+ public void testretrieveAAIModelDataFromAAI_PInterface_LInterface_with_PNF() throws Exception {
String transactionId = UUID.randomUUID().toString();
String serviceInstanceId = "adc3cc2a-c73e-414f-8ddb-367de81300cb"; //match to the test data in junit/queryNodeData-1.json
@@ -230,17 +230,20 @@ public class RestUtilTest {
// 4. simulate the response of PNF based on the resourceLink in (2)
//note: match pnf_id in junit/aai-service-instance.json
addResponse( "/aai/v13/network/pnfs/pnf/amdocsPnfName" + DEPTH,
- "junit/pnfInput_w_pInterface.json", aaiEnricherRule);
+ "junit/pnfInput_w_pInterface_LInterface.json", aaiEnricherRule);
ModelContext modelCtx = RestUtil.retrieveAAIModelData(aaiClient, aaiBaseUrl, aaiPathToSearchNodeQuery, transactionId , serviceInstanceId, aaiBasicAuthorization);
assertEquals(modelCtx.getVnfs().size(), 1);
assertEquals(modelCtx.getPnfs().size(), 1);
-
+ assertEquals(modelCtx.getPnfs().get(0).getPInterfaceList().size(), 1);
+ assertEquals(modelCtx.getPnfs().get(0).getPInterfaceList().get(0).getLInterfaceList().size(), 2);
+ assertEquals(modelCtx.getPnfs().get(0).getPInterfaceList().get(0).getLInterfaceList().get(0).getName(), "junit-l-interface-name5"); //l-interface-name
+ assertEquals(modelCtx.getPnfs().get(0).getPInterfaceList().get(0).getLInterfaceList().get(1).getName(), "junit-l-interface-name6"); //l-interface-name
}
@Test
- public void testretrieveAAIModelDataFromAAI_P_Interface_with_PSERVER() throws Exception {
+ public void testretrieveAAIModelDataFromAAI_PInterface_LInterface_with_PSERVER() throws Exception {
String transactionId = UUID.randomUUID().toString();
String serviceInstanceId = "adc3cc2a-c73e-414f-8ddb-367de81300cb"; //match to the test data in junit/queryNodeData-1.json
@@ -261,14 +264,14 @@ public class RestUtilTest {
// note: match to vserver-id to the path of "vserver" in (3)
addResponse(
"/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant"
- + "/b49b830686654191bb1e952a74b014ad/vservers/vserver/b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a",
+ + "/b49b830686654191bb1e952a74b014ad/vservers/vserver/b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a" + DEPTH,
"junit/aai-vserver.json", aaiEnricherRule);
- // 5. simulate the rsp of pserver
+ // 5. simulate the rsp of pserver with P-interface which also contains L-interface.
// note: match pserver hostname to the path of "pserver" in (4)
addResponse(
"/aai/v13/cloud-infrastructure/pservers/pserver/mtn96compute.cci.att.com" + DEPTH,
- "junit/pserverInput_with_pInterface.json", aaiEnricherRule);
+ "junit/pserverInput_with_pInterface_LInterface.json", aaiEnricherRule);
ModelContext modelCtx = RestUtil.retrieveAAIModelData(aaiClient, aaiBaseUrl, aaiPathToSearchNodeQuery, transactionId , serviceInstanceId, aaiBasicAuthorization);
@@ -281,6 +284,9 @@ public class RestUtilTest {
assertEquals(vmList.size(), 1);
assertEquals(vmList.get(0).getPServer().getPInterfaceList().size(), 1);
assertEquals(vmList.get(0).getPServer().getPInterfaceList().get(0).getName(), "bdc3cc2a-c73e-414f-7ddb-367de92801cb"); //interface-name
+ assertEquals(vmList.get(0).getPServer().getPInterfaceList().get(0).getLInterfaceList().size(), 2);
+ assertEquals(vmList.get(0).getPServer().getPInterfaceList().get(0).getLInterfaceList().get(0).getName(), "junit-l-interface-name7"); //l-interface-name
+ assertEquals(vmList.get(0).getPServer().getPInterfaceList().get(0).getLInterfaceList().get(1).getName(), "junit-l-interface-name8"); //l-interface-name
}
///Verify the relationship serviceInstanceId -> l3network
@@ -339,7 +345,7 @@ public class RestUtilTest {
// note: match to vserver-id to the path of "vserver" in (3)
addResponse(
"/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant"
- + "/b49b830686654191bb1e952a74b014ad/vservers/vserver/b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a",
+ + "/b49b830686654191bb1e952a74b014ad/vservers/vserver/b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a" + DEPTH,
"junit/aai-vserver-set2.json", aaiEnricherRule);
// 5. simulate the rsp of l3-network
@@ -380,7 +386,7 @@ public class RestUtilTest {
// note: match to vserver-id to the path of "vserver" in (3)
addResponse(
"/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant"
- + "/b49b830686654191bb1e952a74b014ad/vservers/vserver/b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a",
+ + "/b49b830686654191bb1e952a74b014ad/vservers/vserver/b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a" + DEPTH,
"junit/aai-vserver-set2.json", aaiEnricherRule);
// 5. simulate the rsp of l3-network
diff --git a/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/VnfInstanceTest.java b/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/VnfInstanceTest.java
index dd2a3fc..b9d9329 100644
--- a/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/VnfInstanceTest.java
+++ b/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/VnfInstanceTest.java
@@ -24,6 +24,7 @@ import org.junit.Test;
import org.onap.pomba.contextbuilder.aai.datatype.RelationshipList;
import org.onap.pomba.contextbuilder.aai.datatype.VfModules;
import org.onap.pomba.contextbuilder.aai.datatype.VnfInstance;
+import org.onap.pomba.contextbuilder.aai.datatype.LInterfaceInstanceList;
public class VnfInstanceTest {
@Test
@@ -90,7 +91,7 @@ public class VnfInstanceTest {
@Test
public void testVnfInstanceWithParameters() {
- VnfInstance vnfInstance = new VnfInstance("vnfId", "vnfName", "vnfName2", "vnfType", "serviceId", "provisionStatus", "licenseKey", "equipmentRole", "orchestrationStatus", "heatStackId", "msoCatalogKey", "ipv4OamAddress", "ipv4Loopback0Address", "nmLanV6Address", "managementV6Address", true, true, "resourceVersion", "modelInvariantId", "modelVersionId", "modelCustomizationId", "nfType", "nfFunction", "nfRole", "nfNamingCode", new RelationshipList(), new VfModules());
+ VnfInstance vnfInstance = new VnfInstance("vnfId", "vnfName", "vnfName2", "vnfType", "serviceId", "provisionStatus", "licenseKey", "equipmentRole", "orchestrationStatus", "heatStackId", "msoCatalogKey", "ipv4OamAddress", "ipv4Loopback0Address", "nmLanV6Address", "managementV6Address", true, true, "resourceVersion", "modelInvariantId", "modelVersionId", "modelCustomizationId", "nfType", "nfFunction", "nfRole", "nfNamingCode", new RelationshipList(), new VfModules(), new LInterfaceInstanceList());
assertEquals("serviceId", vnfInstance.getServiceId());
assertEquals("modelCustomizationId", vnfInstance.getModelCustomizationId());
@@ -126,9 +127,9 @@ public class VnfInstanceTest {
@Test
public void testVnfInstanceEquals() {
- VnfInstance vnfInstance1 = new VnfInstance("vnfId1", "vnfName1", "vnfName2-1", "vnfType1", "serviceId1", "provisionStatus1", "licenseKey1", "equipmentRole1", "orchestrationStatus1", "heatStackId1", "msoCatalogKey1", "ipv4OamAddress1", "ipv4Loopback0Address1", "nmLanV6Address1", "managementV6Address1", true, true, "resourceVersion1", "modelInvariantId1", "modelVersionId1", "modelCustomizationId1", "nfType1", "nfFunction1", "nfRole1", "nfNamingCode1", new RelationshipList(), new VfModules());
- VnfInstance vnfInstance2 = new VnfInstance("vnfId2", "vnfName2", "vnfName2-2", "vnfType2", "serviceId2", "provisionStatus2", "licenseKey2", "equipmentRole2", "orchestrationStatus2", "heatStackId2", "msoCatalogKey2", "ipv4OamAddress2", "ipv4Loopback0Address2", "nmLanV6Address2", "managementV6Address2", true, true, "resourceVersion2", "modelInvariantId2", "modelVersionId2", "modelCustomizationId2", "nfType2", "nfFunction2", "nfRole2", "nfNamingCode2", new RelationshipList(), new VfModules());
- VnfInstance vnfInstance3 = new VnfInstance("vnfId1", "vnfName1", "vnfName2-1", "vnfType1", "serviceId1", "provisionStatus1", "licenseKey1", "equipmentRole1", "orchestrationStatus1", "heatStackId1", "msoCatalogKey1", "ipv4OamAddress1", "ipv4Loopback0Address1", "nmLanV6Address1", "managementV6Address1", true, true, "resourceVersion1", "modelInvariantId1", "modelVersionId1", "modelCustomizationId1", "nfType1", "nfFunction1", "nfRole1", "nfNamingCode1", new RelationshipList(), new VfModules());
+ VnfInstance vnfInstance1 = new VnfInstance("vnfId1", "vnfName1", "vnfName2-1", "vnfType1", "serviceId1", "provisionStatus1", "licenseKey1", "equipmentRole1", "orchestrationStatus1", "heatStackId1", "msoCatalogKey1", "ipv4OamAddress1", "ipv4Loopback0Address1", "nmLanV6Address1", "managementV6Address1", true, true, "resourceVersion1", "modelInvariantId1", "modelVersionId1", "modelCustomizationId1", "nfType1", "nfFunction1", "nfRole1", "nfNamingCode1", new RelationshipList(), new VfModules(), new LInterfaceInstanceList());
+ VnfInstance vnfInstance2 = new VnfInstance("vnfId2", "vnfName2", "vnfName2-2", "vnfType2", "serviceId2", "provisionStatus2", "licenseKey2", "equipmentRole2", "orchestrationStatus2", "heatStackId2", "msoCatalogKey2", "ipv4OamAddress2", "ipv4Loopback0Address2", "nmLanV6Address2", "managementV6Address2", true, true, "resourceVersion2", "modelInvariantId2", "modelVersionId2", "modelCustomizationId2", "nfType2", "nfFunction2", "nfRole2", "nfNamingCode2", new RelationshipList(), new VfModules(), new LInterfaceInstanceList());
+ VnfInstance vnfInstance3 = new VnfInstance("vnfId1", "vnfName1", "vnfName2-1", "vnfType1", "serviceId1", "provisionStatus1", "licenseKey1", "equipmentRole1", "orchestrationStatus1", "heatStackId1", "msoCatalogKey1", "ipv4OamAddress1", "ipv4Loopback0Address1", "nmLanV6Address1", "managementV6Address1", true, true, "resourceVersion1", "modelInvariantId1", "modelVersionId1", "modelCustomizationId1", "nfType1", "nfFunction1", "nfRole1", "nfNamingCode1", new RelationshipList(), new VfModules(), new LInterfaceInstanceList());
assertTrue(vnfInstance1.equals(vnfInstance1));
assertTrue(!vnfInstance1.equals(vnfInstance2));
diff --git a/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/VserverTest.java b/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/VserverTest.java
index b42da7e..509db34 100644
--- a/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/VserverTest.java
+++ b/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/VserverTest.java
@@ -26,6 +26,7 @@ import org.junit.Test;
import org.onap.pomba.contextbuilder.aai.datatype.Relationship;
import org.onap.pomba.contextbuilder.aai.datatype.RelationshipList;
import org.onap.pomba.contextbuilder.aai.datatype.Vserver;
+import org.onap.pomba.contextbuilder.aai.datatype.LInterfaceInstanceList;
public class VserverTest {
@@ -62,7 +63,7 @@ public class VserverTest {
@Test
public void testVserverWithParameters() {
- Vserver aVServer = new Vserver("vserverId", "vserverName", "vserverName2", "provStatus", "vserverSelflink", true, true, "resourceVersion", new RelationshipList());
+ Vserver aVServer = new Vserver("vserverId", "vserverName", "vserverName2", "provStatus", "vserverSelflink", true, true, "resourceVersion", new RelationshipList(), new LInterfaceInstanceList());
assertEquals("vserverId", aVServer.getVserverId());
assertEquals("vserverName", aVServer.getVserverName());
@@ -76,9 +77,9 @@ public class VserverTest {
@Test
public void testVserverEquals() {
- Vserver aVServer1 = new Vserver("vserverId1", "vserverName1", "vserverName2", "provStatus1", "vserverSelflink1", true, true, "resourceVersion1", new RelationshipList());
- Vserver aVServer2 = new Vserver("vserverId2", "vserverName2", "vserverName2", "provStatus2", "vserverSelflink2", false, false, "resourceVersion2", new RelationshipList());
- Vserver aVServer3 = new Vserver("vserverId1", "vserverName1", "vserverName2", "provStatus1", "vserverSelflink1", true, true, "resourceVersion1", new RelationshipList());
+ Vserver aVServer1 = new Vserver("vserverId1", "vserverName1", "vserverName2", "provStatus1", "vserverSelflink1", true, true, "resourceVersion1", new RelationshipList(), new LInterfaceInstanceList());
+ Vserver aVServer2 = new Vserver("vserverId2", "vserverName2", "vserverName2", "provStatus2", "vserverSelflink2", false, false, "resourceVersion2", new RelationshipList(), new LInterfaceInstanceList());
+ Vserver aVServer3 = new Vserver("vserverId1", "vserverName1", "vserverName2", "provStatus1", "vserverSelflink1", true, true, "resourceVersion1", new RelationshipList(), new LInterfaceInstanceList());
assertTrue(aVServer1.equals(aVServer1));
assertFalse(aVServer1.equals(aVServer2));
diff --git a/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/test/RestServiceTest.java b/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/test/RestServiceTest.java
index 9f82c69..8e50484 100644
--- a/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/test/RestServiceTest.java
+++ b/src/test/java/org/onap/logging_analytics/pomba/pomba_aai_context_builder/test/RestServiceTest.java
@@ -139,7 +139,7 @@ public class RestServiceTest {
// note: match to vserver-id to the path of "vserver" in (3)
addResponse(
"/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant"
- + "/b49b830686654191bb1e952a74b014ad/vservers/vserver/b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a",
+ + "/b49b830686654191bb1e952a74b014ad/vservers/vserver/b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a" + DEPTH,
"junit/aai-vserver.json", aaiEnricherRule);
// 5. simulate the rsp of pserver
@@ -168,9 +168,10 @@ public class RestServiceTest {
}
- ///Verify the relationship serviceInstanceId -> vnf -> vserver -> LInterfaceList
+ ///Verify the relationship serviceInstanceId -> vnf (containing L-Interface) -> vserver (containing - LInterfaceList)
+
@Test
- public void testGetContext_VSERVER_L_interface_List() throws Exception {
+ public void testGetContext_VSERVER_L_interface_And_Logical_link() throws Exception {
String transactionId = UUID.randomUUID().toString();
String serviceInstanceId = "adc3cc2a-c73e-414f-8ddb-367de81300cb"; //match to the test data in junit/queryNodeData-1.json
@@ -190,23 +191,30 @@ public class RestServiceTest {
// 3. simulate the rsp of VNF (with 1 vserver)
// note: match vnf_id in (2)
addResponse( "/aai/v13/network/generic-vnfs/generic-vnf/8a9ddb25-2e79-449c-a40d-5011bac0da39" + DEPTH,
- "junit/genericVnfInput_set2.json", aaiEnricherRule);
+ "junit/genericVnfInput_set6.json", aaiEnricherRule);
// 4. simulate the rsp of vserer
// note: match to vserver-id to the path of "vserver" in (3)
addResponse(
"/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant"
- + "/b49b830686654191bb1e952a74b014ad/vservers/vserver/b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a",
+ + "/b49b830686654191bb1e952a74b014ad/vservers/vserver/b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a" + DEPTH,
"junit/aai-vserver-set3.json", aaiEnricherRule);
-
- // 5. simulate the rsp of LInterface
- // note: match l-Interface hostname to the path of "l-interface" in (4)
+ // 5. simulate the rsp of logical-link
+ // note: match to link-name to the path of "relationship-list" in (3: genericVnfInput_set6)
+ // and match the link-name to (4 aai-vserver-set3.json)
addResponse(
- "/aai/v13/l-interfaces/l-interface/junit-l-interface-name1" + DEPTH,
- "junit/l-interface-input.json", aaiEnricherRule);
+ "/aai/v13/network/logical-links/logical-link/01e8d84a-logical-link-1",
+ "junit/logical-link-input1.json", aaiEnricherRule);
addResponse(
- "/aai/v13/l-interfaces/l-interface/junit-l-interface-name2" + DEPTH,
- "junit/l-interface-input2.json", aaiEnricherRule);
+ "/aai/v13/network/logical-links/logical-link/01e8d84a-logical-link-2",
+ "junit/logical-link-input2.json", aaiEnricherRule);
+ addResponse(
+ "/aai/v13/network/logical-links/logical-link/01e8d84a-logical-link-3",
+ "junit/logical-link-input3.json", aaiEnricherRule);
+ addResponse(
+ "/aai/v13/network/logical-links/logical-link/01e8d84a-logical-link-4",
+ "junit/logical-link-input4.json", aaiEnricherRule);
+
when(mockHttpHeaders.getRequestHeaders()).thenReturn(multivaluedMapImpl);
@@ -219,6 +227,13 @@ public class RestServiceTest {
// verify results
List<VNF> vnfList = modelCtx.getVnfs();
assertEquals(vnfList.size(), 1);
+ assertEquals(vnfList.get(0).getLInterfaceList().size(), 2);
+ assertEquals(vnfList.get(0).getLInterfaceList().get(0).getName(), "junit-l-interface-name3"); //l-interface-name
+ assertEquals(vnfList.get(0).getLInterfaceList().get(1).getName(), "junit-l-interface-name4"); //l-interface-name
+ assertEquals(vnfList.get(0).getLInterfaceList().get(0).getLogicalLinkList().size(), 1);
+ assertEquals(vnfList.get(0).getLInterfaceList().get(0).getLogicalLinkList().get(0).getName(), "01e8d84a-logical-link-3"); //Logical-link at vnf->l-interface -> Logical-link
+ assertEquals(vnfList.get(0).getLInterfaceList().get(1).getLogicalLinkList().size(), 1);
+ assertEquals(vnfList.get(0).getLInterfaceList().get(1).getLogicalLinkList().get(0).getName(), "01e8d84a-logical-link-4");
List<VFModule> vfModuleList = vnfList.get(0).getVfModules();
assertEquals(vfModuleList.size(), 1);
List<VM> vmList = vfModuleList.get(0).getVms();
@@ -227,6 +242,11 @@ public class RestServiceTest {
assertEquals(vmList.get(0).getLInterfaceList().size(), 2);
assertEquals(vmList.get(0).getLInterfaceList().get(0).getName(), "junit-l-interface-name1"); //l-interface-name
assertEquals(vmList.get(0).getLInterfaceList().get(1).getName(), "junit-l-interface-name2"); //l-interface-name
+ assertEquals(vmList.get(0).getLInterfaceList().get(0).getLogicalLinkList().size(), 1);
+ assertEquals(vmList.get(0).getLInterfaceList().get(0).getLogicalLinkList().get(0).getName(), "01e8d84a-logical-link-1"); //Logical-link at vserver->l-interface -> Logical-link
+ assertEquals(vmList.get(0).getLInterfaceList().get(1).getLogicalLinkList().size(), 1);
+ assertEquals(vmList.get(0).getLInterfaceList().get(1).getLogicalLinkList().get(0).getName(), "01e8d84a-logical-link-2");
+
}
///Verify the relationship serviceInstanceId -> vnf + vnfc
@@ -257,7 +277,66 @@ public class RestServiceTest {
// note: match to vserver-id to the path of "vserver" in (3)
addResponse(
"/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant"
- + "/b49b830686654191bb1e952a74b014ad/vservers/vserver/b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a",
+ + "/b49b830686654191bb1e952a74b014ad/vservers/vserver/b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a" + DEPTH,
+ "junit/aai-vserver-set2.json", aaiEnricherRule);
+
+ // 5. simulate the rsp of vnfc
+ // note: match to vnfc-name to the path of "vnfc" in (3)
+ addResponse(
+ "/aai/v13/network/vnfcs/vnfc/junit-vnfc-name1212",
+ "junit/vnfc-input1.json", aaiEnricherRule);
+
+ when(mockHttpHeaders.getRequestHeaders()).thenReturn(multivaluedMapImpl);
+
+ Response response = this.dummyRestSvc.getContext(mockHttpHeaders, httpBasicAuthorization, testRestHeaders, transactionId,
+ serviceInstanceId);
+
+ assertEquals(Status.OK.getStatusCode(), response.getStatus());
+ Gson gson = new Gson();
+ ModelContext modelCtx = gson.fromJson((String) response.getEntity(), ModelContext.class);
+ // verify results
+ List<VNF> vnfList = modelCtx.getVnfs();
+ assertEquals(vnfList.size(), 1);
+ List<VFModule> vfModuleList = vnfList.get(0).getVfModules();
+ assertEquals(vfModuleList.size(), 1);
+ List<VM> vmList = vfModuleList.get(0).getVms();
+ assertEquals(vmList.size(), 1);
+ assertEquals(vmList.get(0).getUuid(), "b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a"); //vserver-id
+
+ List<VNFC> vnfcList = vnfList.get(0).getVnfcs();
+ assertEquals(vnfcList.size(), 1);
+ assertEquals(vnfcList.get(0).getName(), "junit-vnfc-name1212"); //vnfc-name
+ }
+
+ ///Verify the relationship serviceInstanceId -> vnf + vnfc
+ @Test
+ public void testGetContext_VNFC2() throws Exception {
+
+ String transactionId = UUID.randomUUID().toString();
+ String serviceInstanceId = "adc3cc2a-c73e-414f-8ddb-367de81300cb"; //match to the test data in junit/queryNodeData-1.json
+ String queryNodeUrl = aaiPathToSearchNodeQuery + serviceInstanceId;
+
+ // Test with No Partner Name
+ final MultivaluedMap<String, String> multivaluedMapImpl = buildHeaders(
+ transactionId, testRestHeaders, httpBasicAuthorization);
+
+ // 1. simulate the response to obtainResourceLink based on ServiceInstanceId
+ addResponse(queryNodeUrl, "junit/queryNodeData-1.json", aaiEnricherRule);
+ // 2. simulate the response of AAI (1 vnf)
+ // note: match serviceInstanceId in (1)
+ addResponse( "/aai/v13/business/customers/customer/DemoCust_651800ed-2a3c-45f5-b920-85c1ed155fc2/service-subscriptions/service-subscription/vFW/service-instances/service-instance/adc3cc2a-c73e-414f-8ddb-367de81300cb",
+ "junit/aai-service-instance_set2.json", aaiEnricherRule);
+
+ // 3. simulate the rsp of VNF (with 1 vserver)
+ // note: match vnf_id in (2)
+ addResponse( "/aai/v13/network/generic-vnfs/generic-vnf/8a9ddb25-2e79-449c-a40d-5011bac0da39" + DEPTH,
+ "junit/genericVnfInput_set5.json", aaiEnricherRule);
+
+ // 4. simulate the rsp of vserer
+ // note: match to vserver-id to the path of "vserver" in (3)
+ addResponse(
+ "/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant"
+ + "/b49b830686654191bb1e952a74b014ad/vservers/vserver/b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a" + DEPTH,
"junit/aai-vserver-set2.json", aaiEnricherRule);
// 5. simulate the rsp of vnfc
@@ -287,4 +366,175 @@ public class RestServiceTest {
assertEquals(vnfcList.size(), 1);
assertEquals(vnfcList.get(0).getName(), "junit-vnfc-name1212"); //vnfc-name
}
+
+ ///Verify the relationship serviceInstanceId -> vnf + vnfc
+ @Test
+ public void testGetContext_LogicalLink_in_service_level() throws Exception {
+ String transactionId = UUID.randomUUID().toString();
+ String serviceInstanceId = "adc3cc2a-c73e-414f-8ddb-367de81300cb"; //match to the test data in junit/queryNodeData-1.json
+ String queryNodeUrl = aaiPathToSearchNodeQuery + serviceInstanceId;
+
+ // Test with No Partner Name
+ final MultivaluedMap<String, String> multivaluedMapImpl = buildHeaders(
+ transactionId, testRestHeaders, httpBasicAuthorization);
+
+ // 1. simulate the response to obtainResourceLink based on ServiceInstanceId
+ addResponse(queryNodeUrl, "junit/queryNodeData-1.json", aaiEnricherRule);
+ // 2. simulate the response of AAI (1 vnf)
+ // note: match serviceInstanceId in (1)
+ addResponse( "/aai/v13/business/customers/customer/DemoCust_651800ed-2a3c-45f5-b920-85c1ed155fc2/service-subscriptions/service-subscription/vFW/service-instances/service-instance/adc3cc2a-c73e-414f-8ddb-367de81300cb",
+ "junit/aai-service-instance_set4.json", aaiEnricherRule);
+
+ // 3. simulate the rsp of logical-link
+ // note: match to link-name to the path of "relationship-list" in (2: aai-service-instance_set4)
+ addResponse(
+ "/aai/v13/network/logical-links/logical-link/01e8d84a-logical-link-1",
+ "junit/logical-link-input1.json", aaiEnricherRule);
+ addResponse(
+ "/aai/v13/network/logical-links/logical-link/01e8d84a-logical-link-2",
+ "junit/logical-link-input2.json", aaiEnricherRule);
+
+ when(mockHttpHeaders.getRequestHeaders()).thenReturn(multivaluedMapImpl);
+ Response response = this.dummyRestSvc.getContext(mockHttpHeaders, httpBasicAuthorization, testRestHeaders, transactionId,
+ serviceInstanceId);
+
+ assertEquals(Status.OK.getStatusCode(), response.getStatus());
+ Gson gson = new Gson();
+ ModelContext modelCtx = gson.fromJson((String) response.getEntity(), ModelContext.class);
+ assertEquals(modelCtx.getLogicalLinkList().size(), 2);
+ assertEquals(modelCtx.getLogicalLinkList().get(0).getName(), "01e8d84a-logical-link-1");
+ assertEquals(modelCtx.getLogicalLinkList().get(1).getName(), "01e8d84a-logical-link-2");
+ }
+
+ ///Verify the relationship P-interface, L-interaface, Logical-link
+ @Test
+ public void testGetContext_LogicalLink_in_PInterface_level_with_PNF() throws Exception {
+ String transactionId = UUID.randomUUID().toString();
+ String serviceInstanceId = "adc3cc2a-c73e-414f-8ddb-367de81300cb"; //match to the test data in junit/queryNodeData-1.json
+ String queryNodeUrl = aaiPathToSearchNodeQuery + serviceInstanceId;
+
+ // Test with No Partner Name
+ final MultivaluedMap<String, String> multivaluedMapImpl = buildHeaders(
+ transactionId, testRestHeaders, httpBasicAuthorization);
+
+ // 1. simulate the response to obtainResourceLink based on ServiceInstanceId
+ addResponse(queryNodeUrl, "junit/queryNodeData-1.json", aaiEnricherRule);
+ // 2. simulate the response of AAI (1 vnf and 1 pnf)
+ addResponse( "/aai/v13/business/customers/customer/DemoCust_651800ed-2a3c-45f5-b920-85c1ed155fc2/service-subscriptions/service-subscription/vFW/service-instances/service-instance/adc3cc2a-c73e-414f-8ddb-367de81300cb",
+ "junit/aai-service-instance.json", aaiEnricherRule);
+
+ // 3. simulate the rsp of VNF
+ addResponse( "/aai/v13/network/generic-vnfs/generic-vnf/8a9ddb25-2e79-449c-a40d-5011bac0da39" + DEPTH,
+ "junit/genericVnfInput.json", aaiEnricherRule);
+
+ // 4. simulate the response of PNF based on the resourceLink in (2)
+ //note: match pnf_id in junit/aai-service-instance.json
+ addResponse( "/aai/v13/network/pnfs/pnf/amdocsPnfName" + DEPTH,
+ "junit/pnfInput_w_pInterface_LInterface_set2.json", aaiEnricherRule);
+
+ // 5. simulate the rsp of logical-link
+ // note: match to link-name to the path of "relationship-list" in (4: pnfInput_w_pInterface_LInterface_set2)
+ addResponse(
+ "/aai/v13/network/logical-links/logical-link/01e8d84a-logical-link-1",
+ "junit/logical-link-input1.json", aaiEnricherRule);
+ addResponse(
+ "/aai/v13/network/logical-links/logical-link/01e8d84a-logical-link-2",
+ "junit/logical-link-input2.json", aaiEnricherRule);
+
+ when(mockHttpHeaders.getRequestHeaders()).thenReturn(multivaluedMapImpl);
+ Response response = this.dummyRestSvc.getContext(mockHttpHeaders, httpBasicAuthorization, testRestHeaders, transactionId,
+ serviceInstanceId);
+
+ assertEquals(Status.OK.getStatusCode(), response.getStatus());
+ Gson gson = new Gson();
+ ModelContext modelCtx = gson.fromJson((String) response.getEntity(), ModelContext.class);
+ assertEquals(modelCtx.getVnfs().size(), 1);
+ assertEquals(modelCtx.getPnfs().size(), 1);
+ assertEquals(modelCtx.getPnfs().get(0).getPInterfaceList().size(), 1);
+ assertEquals(modelCtx.getPnfs().get(0).getPInterfaceList().get(0).getLInterfaceList().size(), 2);
+ assertEquals(modelCtx.getPnfs().get(0).getPInterfaceList().get(0).getLInterfaceList().get(0).getName(), "junit-l-interface-name5"); //l-interface-name
+ assertEquals(modelCtx.getPnfs().get(0).getPInterfaceList().get(0).getLInterfaceList().get(1).getName(), "junit-l-interface-name6"); //l-interface-name
+ assertEquals(modelCtx.getPnfs().get(0).getPInterfaceList().get(0).getLogicalLinkList().size(), 2);
+ assertEquals(modelCtx.getPnfs().get(0).getPInterfaceList().get(0).getLogicalLinkList().get(0).getName(), "01e8d84a-logical-link-1");
+ assertEquals(modelCtx.getPnfs().get(0).getPInterfaceList().get(0).getLogicalLinkList().get(1).getName(), "01e8d84a-logical-link-2");
+ }
+
+ ///Verify the relationship P-interface, L-interaface, Logical-link
+ @Test
+ public void testGetContext_LogicalLink_in_PInterface_level_with_PSERVER() throws Exception {
+ String transactionId = UUID.randomUUID().toString();
+ String serviceInstanceId = "adc3cc2a-c73e-414f-8ddb-367de81300cb"; //match to the test data in junit/queryNodeData-1.json
+ String queryNodeUrl = aaiPathToSearchNodeQuery + serviceInstanceId;
+
+ // Test with No Partner Name
+ final MultivaluedMap<String, String> multivaluedMapImpl = buildHeaders(
+ transactionId, testRestHeaders, httpBasicAuthorization);
+
+ // 1. simulate the response to obtainResourceLink based on ServiceInstanceId
+ addResponse(queryNodeUrl, "junit/queryNodeData-1.json", aaiEnricherRule);
+ // 2. simulate the response of AAI (1 vnf)
+ // note: match serviceInstanceId in (1)
+ addResponse( "/aai/v13/business/customers/customer/DemoCust_651800ed-2a3c-45f5-b920-85c1ed155fc2/service-subscriptions/service-subscription/vFW/service-instances/service-instance/adc3cc2a-c73e-414f-8ddb-367de81300cb",
+ "junit/aai-service-instance_set2.json", aaiEnricherRule);
+
+ // 3. simulate the rsp of VNF (with 1 vserver)
+ // note: match vnf_id in (2)
+ addResponse( "/aai/v13/network/generic-vnfs/generic-vnf/8a9ddb25-2e79-449c-a40d-5011bac0da39" + DEPTH,
+ "junit/genericVnfInput_set2.json", aaiEnricherRule);
+
+ // 4. simulate the rsp of vserer
+ // note: match to vserver-id to the path of "vserver" in (3)
+ addResponse(
+ "/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant"
+ + "/b49b830686654191bb1e952a74b014ad/vservers/vserver/b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a" + DEPTH,
+ "junit/aai-vserver.json", aaiEnricherRule);
+
+ // 5. simulate the rsp of pserver with P-interface which also contains L-interface.
+ // note: match pserver hostname to the path of "pserver" in (4)
+ addResponse(
+ "/aai/v13/cloud-infrastructure/pservers/pserver/mtn96compute.cci.att.com" + DEPTH,
+ "junit/pserverInput_with_pInterface_LInterface_set2.json", aaiEnricherRule);
+
+ // 6. simulate the rsp of logical-link
+ // note: match to link-name to the path of "relationship-list" in (5: pserverInput_with_pInterface_LInterface_set2)
+ addResponse(
+ "/aai/v13/network/logical-links/logical-link/01e8d84a-logical-link-1",
+ "junit/logical-link-input1.json", aaiEnricherRule);
+ addResponse(
+ "/aai/v13/network/logical-links/logical-link/01e8d84a-logical-link-2",
+ "junit/logical-link-input2.json", aaiEnricherRule);
+ addResponse(
+ "/aai/v13/network/logical-links/logical-link/01e8d84a-logical-link-3",
+ "junit/logical-link-input3.json", aaiEnricherRule);
+ addResponse(
+ "/aai/v13/network/logical-links/logical-link/01e8d84a-logical-link-4",
+ "junit/logical-link-input4.json", aaiEnricherRule);
+
+ when(mockHttpHeaders.getRequestHeaders()).thenReturn(multivaluedMapImpl);
+ Response response = this.dummyRestSvc.getContext(mockHttpHeaders, httpBasicAuthorization, testRestHeaders, transactionId,
+ serviceInstanceId);
+
+ assertEquals(Status.OK.getStatusCode(), response.getStatus());
+ Gson gson = new Gson();
+ ModelContext modelCtx = gson.fromJson((String) response.getEntity(), ModelContext.class);
+
+ List<VNF> vnfList = modelCtx.getVnfs();
+ assertEquals(vnfList.size(), 1);
+ List<VFModule> vfModuleList = vnfList.get(0).getVfModules();
+ assertEquals(vfModuleList.size(), 1);
+ List<VM> vmList = vfModuleList.get(0).getVms();
+ assertEquals(vmList.size(), 1);
+ assertEquals(vmList.get(0).getPServer().getPInterfaceList().size(), 1);
+ assertEquals(vmList.get(0).getPServer().getPInterfaceList().get(0).getName(), "bdc3cc2a-c73e-414f-7ddb-367de92801cb"); //interface-name
+ assertEquals(vmList.get(0).getPServer().getPInterfaceList().get(0).getLInterfaceList().size(), 2);
+ assertEquals(vmList.get(0).getPServer().getPInterfaceList().get(0).getLInterfaceList().get(0).getName(), "junit-l-interface-name7"); //Vserver-> Pserver-> P-interface -> l-interface
+ assertEquals(vmList.get(0).getPServer().getPInterfaceList().get(0).getLInterfaceList().get(1).getName(), "junit-l-interface-name8");
+ assertEquals(vmList.get(0).getPServer().getPInterfaceList().get(0).getLInterfaceList().get(0).getLogicalLinkList().size(), 1);
+ assertEquals(vmList.get(0).getPServer().getPInterfaceList().get(0).getLInterfaceList().get(0).getLogicalLinkList().get(0).getName(), "01e8d84a-logical-link-3"); //Vserver-> Pserver-> P-interface -> l-interface -> logical-link
+ assertEquals(vmList.get(0).getPServer().getPInterfaceList().get(0).getLInterfaceList().get(1).getLogicalLinkList().size(), 1);
+ assertEquals(vmList.get(0).getPServer().getPInterfaceList().get(0).getLInterfaceList().get(1).getLogicalLinkList().get(0).getName(), "01e8d84a-logical-link-4");
+ assertEquals(vmList.get(0).getPServer().getPInterfaceList().get(0).getLogicalLinkList().size(), 2);
+ assertEquals(vmList.get(0).getPServer().getPInterfaceList().get(0).getLogicalLinkList().get(0).getName(), "01e8d84a-logical-link-1"); //Vserver-> Pserver-> P-interface -> Logical-link
+ assertEquals(vmList.get(0).getPServer().getPInterfaceList().get(0).getLogicalLinkList().get(1).getName(), "01e8d84a-logical-link-2");
+ }
}
diff --git a/src/test/resources/junit/aai-service-instance_set4.json b/src/test/resources/junit/aai-service-instance_set4.json
new file mode 100644
index 0000000..f7e6f1a
--- /dev/null
+++ b/src/test/resources/junit/aai-service-instance_set4.json
@@ -0,0 +1,44 @@
+{
+ "service-instance-id": "adc3cc2a-c73e-414f-8ddb-367de81300cb",
+ "service-instance-name": "Firewall1",
+ "model-invariant-id": "0c5a20de-87ad-442c-9190-f38ab0a6bb7f",
+ "model-version-id": "d3d6cf83-d03a-43cc-99ff-206d40bb9a72",
+ "resource-version": "1527637758480",
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-to": "logical-link",
+ "related-link": "/aai/v13/network/logical-links/logical-link/01e8d84a-logical-link-1",
+ "relationship-data": [
+ {
+ "relationship-key": "logical-link.link-name",
+ "relationship-value": "01e8d84a-logical-link-1"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "logical-link.circuit-id",
+ "property-value": "NET_8802"
+ }
+ ]
+ },
+ {
+ "related-to": "logical-link",
+ "related-link": "/aai/v13/network/logical-links/logical-link/01e8d84a-logical-link-2",
+ "relationship-data": [
+ {
+ "relationship-key": "logical-link.link-name",
+ "relationship-value": "01e8d84a-logical-link-2"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "logical-link.circuit-id",
+ "property-value": "NET_8802"
+ }
+ ]
+ }
+
+ ]
+ }
+}
diff --git a/src/test/resources/junit/aai-vserver-set3.json b/src/test/resources/junit/aai-vserver-set3.json
index f50d65a..9804786 100644
--- a/src/test/resources/junit/aai-vserver-set3.json
+++ b/src/test/resources/junit/aai-vserver-set3.json
@@ -7,41 +7,73 @@
"in-maint": false,
"is-closed-loop-disabled": false,
"resource-version": "1528481820321",
+ "l-interfaces" : {
+ "l-interface" : [
+ {
+ "interface-id": "junit-l-interface-1",
+ "interface-name": "junit-l-interface-name1",
+ "interface-role": "interface-role1",
+ "is-port-mirrored": "true",
+ "admin-status": "admin-status1",
+ "network-name": "network-name-amdocs",
+ "macaddr": "macaddr-1",
+ "in-maint": "true",
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-to": "logical-link",
+ "related-link": "/aai/v13/network/logical-links/logical-link/01e8d84a-logical-link-1",
+ "relationship-data": [
+ {
+ "relationship-key": "logical-link.link-name",
+ "relationship-value": "01e8d84a-logical-link-1"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "logical-link.circuit-id",
+ "property-value": "NET_8802"
+ }
+ ]
+ }
+ ]
+ }
+ },
+ {
+ "interface-id": "junit-l-interface-2",
+ "interface-name": "junit-l-interface-name2",
+ "interface-role": "interface-role2",
+ "is-port-mirrored": "true",
+ "admin-status": "admin-status2",
+ "network-name": "network-name-amdocs",
+ "macaddr": "macaddr-2",
+ "in-maint": "true",
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-to": "logical-link",
+ "related-link": "/aai/v13/network/logical-links/logical-link/01e8d84a-logical-link-2",
+ "relationship-data": [
+ {
+ "relationship-key": "logical-link.link-name",
+ "relationship-value": "01e8d84a-logical-link-2"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "logical-link.circuit-id",
+ "property-value": "NET_8802"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ ]
+ },
"relationship-list": {
"relationship": [
{
- "related-to": "l-interface",
- "relationship-label": "tosca.relationships.HostedOn",
- "related-link": "/aai/v13/l-interfaces/l-interface/junit-l-interface-name1",
- "relationship-data": [
- {
- "relationship-key": "l-interface.interface-name",
- "relationship-value": "junit-l-interface-name1"
- }
- ],
- "related-to-property": [
- { "property-key": "l-interface.interface-id",
- "property-value": "junit-l-interface-1"
- }
- ]
- },
- {
- "related-to": "l-interface",
- "relationship-label": "tosca.relationships.HostedOn",
- "related-link": "/aai/v13/l-interfaces/l-interface/junit-l-interface-name2",
- "relationship-data": [
- {
- "relationship-key": "l-interface.interface-name",
- "relationship-value": "junit-l-interface-name2"
- }
- ],
- "related-to-property": [
- { "property-key": "l-interface.interface-id",
- "property-value": "junit-l-interface-2"
- }
- ]
- },
- {
"related-to": "generic-vnf",
"related-link": "/aai/v13/network/generic-vnfs/generic-vnf/8a9ddb25-2e79-449c-a40d-5011bac0da39",
"relationship-data": [
diff --git a/src/test/resources/junit/genericVnfInput_set6.json b/src/test/resources/junit/genericVnfInput_set6.json
new file mode 100644
index 0000000..e5f7ea4
--- /dev/null
+++ b/src/test/resources/junit/genericVnfInput_set6.json
@@ -0,0 +1,148 @@
+{
+ "vnf-id": "8a9ddb25-2e79-449c-a40d-5011bac0da39",
+ "vnf-name": "Firewall-1",
+ "vnf-type": "vFW-vSINK-service/vFWvSINK 0",
+ "service-id": "8ea56b0d-459d-4668-b363-c9567432d8b7",
+ "prov-status": "PREPROV",
+ "orchestration-status": "Created",
+ "in-maint": false,
+ "is-closed-loop-disabled": false,
+ "resource-version": "1527637940029",
+ "model-invariant-id": "59dd4d63-8f21-406c-98c0-3b057bb86820",
+ "model-version-id": "e2d52f32-a952-46f5-800c-c250903625d6",
+ "model-customization-id": "3b822416-475d-4e1c-aac3-2544b0a0fdfc",
+ "nf-type": "",
+ "nf-function": "",
+ "nf-role": "",
+ "nf-naming-code": "",
+ "l-interfaces" : {
+ "l-interface" : [
+ {
+ "interface-id": "junit-l-interface-3",
+ "interface-name": "junit-l-interface-name3",
+ "interface-role": "interface-role3",
+ "is-port-mirrored": "true",
+ "admin-status": "admin-status3",
+ "network-name": "network-name-amdocs",
+ "macaddr": "macaddr-3",
+ "in-maint": "true",
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-to": "logical-link",
+ "related-link": "/aai/v13/network/logical-links/logical-link/01e8d84a-logical-link-3",
+ "relationship-data": [
+ {
+ "relationship-key": "logical-link.link-name",
+ "relationship-value": "01e8d84a-logical-link-3"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "logical-link.circuit-id",
+ "property-value": "NET_8802"
+ }
+ ]
+ }
+ ]
+ }
+ },
+ {
+ "interface-id": "junit-l-interface-4",
+ "interface-name": "junit-l-interface-name4",
+ "interface-role": "interface-role4",
+ "is-port-mirrored": "true",
+ "admin-status": "admin-status4",
+ "network-name": "network-name-amdocs",
+ "macaddr": "macaddr-4",
+ "in-maint": "true",
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-to": "logical-link",
+ "related-link": "/aai/v13/network/logical-links/logical-link/01e8d84a-logical-link-4",
+ "relationship-data": [
+ {
+ "relationship-key": "logical-link.link-name",
+ "relationship-value": "01e8d84a-logical-link-4"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "logical-link.circuit-id",
+ "property-value": "NET_8802"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-to": "vserver",
+ "related-link": "/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant/b49b830686654191bb1e952a74b014ad/vservers/vserver/b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a",
+ "relationship-data": [
+ {
+ "relationship-key": "cloud-region.cloud-owner",
+ "relationship-value": "CloudOwner"
+ },
+ {
+ "relationship-key": "cloud-region.cloud-region-id",
+ "relationship-value": "RegionOne"
+ },
+ {
+ "relationship-key": "tenant.tenant-id",
+ "relationship-value": "b49b830686654191bb1e952a74b014ad"
+ },
+ {
+ "relationship-key": "vserver.vserver-id",
+ "relationship-value": "b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a"
+ }
+ ]
+ },
+ {
+ "related-to": "service-instance",
+ "related-link": "/aai/v13/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vFWCL/service-instances/service-instance/adc3cc2a-c73e-414f-8ddb-367de81300cb",
+ "relationship-data": [
+ {
+ "relationship-key": "customer.global-customer-id",
+ "relationship-value": "Demonstration"
+ },
+ {
+ "relationship-key": "service-subscription.service-type",
+ "relationship-value": "vFWCL"
+ },
+ {
+ "relationship-key": "service-instance.service-instance-id",
+ "relationship-value": "adc3cc2a-c73e-414f-8ddb-367de81300cb"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "service-instance.service-instance-name",
+ "property-value": "Firewall1"
+ }
+ ]
+ }
+ ]
+ },
+ "vf-modules": {
+ "vf-module": [
+ {
+ "vf-module-id": "1563b649-9e05-4288-b7d9-e3639a54ace6",
+ "vf-module-name": "vFW_SINC_Module-2",
+ "heat-stack-id": "vFW_SINC_Module-2/41c4533a-748d-4cf4-a8d3-eccdd0aeb0d4",
+ "orchestration-status": "active",
+ "is-base-vf-module": true,
+ "resource-version": "1527638439198",
+ "model-invariant-id": "74bc1518-282d-4148-860f-8892b6369456",
+ "model-version-id": "4e3d28cf-d654-41af-a47b-04b4bd0ac58e",
+ "model-customization-id": "cc51ab7d-9b03-4bd6-9104-09df0c7c7907",
+ "module-index": 0
+ }
+ ]
+ }
+}
diff --git a/src/test/resources/junit/l-interface-input.json b/src/test/resources/junit/l-interface-input.json
deleted file mode 100644
index 0f80367..0000000
--- a/src/test/resources/junit/l-interface-input.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "interface-id": "junit-l-interface-1",
- "interface-name": "junit-l-interface-name1",
- "interface-role": "interface-role1",
- "is-port-mirrored": "true",
- "admin-status": "admin-status1",
- "network-name": "network-name-amdocs",
- "macaddr": "macaddr-1",
- "in-maint": "true"
-} \ No newline at end of file
diff --git a/src/test/resources/junit/l-interface-input2.json b/src/test/resources/junit/l-interface-input2.json
deleted file mode 100644
index 3bcbbda..0000000
--- a/src/test/resources/junit/l-interface-input2.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "interface-id": "junit-l-interface-2",
- "interface-name": "junit-l-interface-name2",
- "interface-role": "interface-role2",
- "is-port-mirrored": "true",
- "admin-status": "admin-status2",
- "network-name": "network-name-amdocs",
- "macaddr": "macaddr-2",
- "in-maint": "true"
-} \ No newline at end of file
diff --git a/src/test/resources/junit/logical-link-input1.json b/src/test/resources/junit/logical-link-input1.json
new file mode 100644
index 0000000..40fc85d
--- /dev/null
+++ b/src/test/resources/junit/logical-link-input1.json
@@ -0,0 +1,17 @@
+{
+ "link-name" : "01e8d84a-logical-link-1",
+ "link-id" : "link-id-1",
+ "model-version-id" : "model-version-id_1",
+ "model-invariant-id" : "model-invariant-id_1",
+ "link-type" : "link-type_1",
+ "routing-protocol" : "routing-protocol-1",
+ "speed-value" : "speed-value-1",
+ "speed-units" : "speed-units-001",
+ "ip-version" : "ip-version-001",
+ "prov-status" : "prov-status-1",
+ "link-role" : "link-role-1",
+ "link-name2" : "link-name2-1",
+ "circuit-id" : "circuit-id-001",
+ "purpose" : "purpose-1",
+ "in-maint" : false
+} \ No newline at end of file
diff --git a/src/test/resources/junit/logical-link-input2.json b/src/test/resources/junit/logical-link-input2.json
new file mode 100644
index 0000000..e606764
--- /dev/null
+++ b/src/test/resources/junit/logical-link-input2.json
@@ -0,0 +1,17 @@
+{
+ "link-name" : "01e8d84a-logical-link-2",
+ "link-id" : "link-id-2",
+ "model-version-id" : "model-version-id_2",
+ "model-invariant-id" : "model-invariant-id_2",
+ "link-type" : "link-type_2",
+ "routing-protocol" : "routing-protocol-2",
+ "speed-value" : "speed-value-2",
+ "speed-units" : "speed-units-002",
+ "ip-version" : "ip-version-002",
+ "prov-status" : "prov-status-2",
+ "link-role" : "link-role-2",
+ "link-name2" : "link-name2-2",
+ "circuit-id" : "circuit-id-002",
+ "purpose" : "purpose-2",
+ "in-maint" : true
+} \ No newline at end of file
diff --git a/src/test/resources/junit/logical-link-input3.json b/src/test/resources/junit/logical-link-input3.json
new file mode 100644
index 0000000..bc25f61
--- /dev/null
+++ b/src/test/resources/junit/logical-link-input3.json
@@ -0,0 +1,17 @@
+{
+ "link-name" : "01e8d84a-logical-link-3",
+ "link-id" : "link-id-3",
+ "model-version-id" : "model-version-id_3",
+ "model-invariant-id" : "model-invariant-id_3",
+ "link-type" : "link-type_3",
+ "routing-protocol" : "routing-protocol-3",
+ "speed-value" : "speed-value-3",
+ "speed-units" : "speed-units-003",
+ "ip-version" : "ip-version-003",
+ "prov-status" : "prov-status-3",
+ "link-role" : "link-role-3",
+ "link-name2" : "link-name2-3",
+ "circuit-id" : "circuit-id-003",
+ "purpose" : "purpose-3",
+ "in-maint" : false
+} \ No newline at end of file
diff --git a/src/test/resources/junit/logical-link-input4.json b/src/test/resources/junit/logical-link-input4.json
new file mode 100644
index 0000000..d44f075
--- /dev/null
+++ b/src/test/resources/junit/logical-link-input4.json
@@ -0,0 +1,17 @@
+{
+ "link-name" : "01e8d84a-logical-link-4",
+ "link-id" : "link-id-4",
+ "model-version-id" : "model-version-id_4",
+ "model-invariant-id" : "model-invariant-id_4",
+ "link-type" : "link-type_4",
+ "routing-protocol" : "routing-protocol-4",
+ "speed-value" : "speed-value-4",
+ "speed-units" : "speed-units-004",
+ "ip-version" : "ip-version-004",
+ "prov-status" : "prov-status-4",
+ "link-role" : "link-role-4",
+ "link-name2" : "link-name2-4",
+ "circuit-id" : "circuit-id-004",
+ "purpose" : "purpose-4",
+ "in-maint" : false
+} \ No newline at end of file
diff --git a/src/test/resources/junit/pnfInput_w_pInterface.json b/src/test/resources/junit/pnfInput_w_pInterface_LInterface.json
index c534dfc..d7a9fd7 100644
--- a/src/test/resources/junit/pnfInput_w_pInterface.json
+++ b/src/test/resources/junit/pnfInput_w_pInterface_LInterface.json
@@ -36,7 +36,31 @@
"resource-version": "99888",
"serial-number": "c44b872f6830498b88c4989d67b2a6b7",
"status": "ACTIVE",
- "inv-status": "TBD"
+ "inv-status": "TBD",
+ "l-interfaces" : {
+ "l-interface" : [
+ {
+ "interface-id": "junit-l-interface-5",
+ "interface-name": "junit-l-interface-name5",
+ "interface-role": "interface-role5",
+ "is-port-mirrored": "true",
+ "admin-status": "admin-status5",
+ "network-name": "network-name-amdocs",
+ "macaddr": "macaddr-5",
+ "in-maint": "true"
+ },
+ {
+ "interface-id": "junit-l-interface-6",
+ "interface-name": "junit-l-interface-name6",
+ "interface-role": "interface-role6",
+ "is-port-mirrored": "true",
+ "admin-status": "admin-status6",
+ "network-name": "network-name-amdocs",
+ "macaddr": "macaddr-6",
+ "in-maint": "true"
+ }
+ ]
+ }
}
]
},
diff --git a/src/test/resources/junit/pnfInput_w_pInterface_LInterface_set2.json b/src/test/resources/junit/pnfInput_w_pInterface_LInterface_set2.json
new file mode 100644
index 0000000..acd995e
--- /dev/null
+++ b/src/test/resources/junit/pnfInput_w_pInterface_LInterface_set2.json
@@ -0,0 +1,146 @@
+{
+ "pnf-name": "amdocsPnfName",
+ "pnf-name2": "amdocsPnfName2",
+ "pnf-name2-source": "pombaName2Source",
+ "pnf-id": "11112222pnf88889999",
+ "equip-type": "software",
+ "equip-vendor": "8df84f0a-737a-4628-be9c-c3c78454f9d9",
+ "equip-model": "123134236",
+ "management-option": "TBD",
+ "sw-version": "2",
+ "in-maint": "true",
+ "frame-id": "99888",
+ "serial-number": "c44b872f6830498b88c4989d67b2a6b7",
+ "status": "ACTIVE",
+ "nf-function": "nf-Function-123",
+ "nf-role": "22222",
+ "model-invariant-id": "12345",
+ "model-version-id": "2123",
+ "admin_state_up": true,
+ "resource-version": "28",
+ "tenant_id": "c44b872f6830498b88c4989d67b2a6b7",
+ "created_at": "2018-03-20T16:49:01Z",
+ "provider:network_type": "vlan",
+ "p-interfaces":{
+ "p-interface": [
+ {
+ "interface-name": "bdc3cc2a-c73e-414f-7ddb-367de92801cb",
+ "speed-value": "1225",
+ "speed-units": "mbs",
+ "port-description": "port-used-for-junit",
+ "equipment-identifier": "8df84f0a-737a-4628-be9c-c3c78454f9d9",
+ "interface-role": "123134236",
+ "interface-type": "Software",
+ "prov-status": "2",
+ "in-maint": "true",
+ "resource-version": "99888",
+ "serial-number": "c44b872f6830498b88c4989d67b2a6b7",
+ "status": "ACTIVE",
+ "inv-status": "TBD",
+ "l-interfaces" : {
+ "l-interface" : [
+ {
+ "interface-id": "junit-l-interface-5",
+ "interface-name": "junit-l-interface-name5",
+ "interface-role": "interface-role5",
+ "is-port-mirrored": "true",
+ "admin-status": "admin-status5",
+ "network-name": "network-name-amdocs",
+ "macaddr": "macaddr-5",
+ "in-maint": "true"
+ },
+ {
+ "interface-id": "junit-l-interface-6",
+ "interface-name": "junit-l-interface-name6",
+ "interface-role": "interface-role6",
+ "is-port-mirrored": "true",
+ "admin-status": "admin-status6",
+ "network-name": "network-name-amdocs",
+ "macaddr": "macaddr-6",
+ "in-maint": "true"
+ }
+ ]
+ },
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-to": "logical-link",
+ "related-link": "/aai/v13/network/logical-links/logical-link/01e8d84a-logical-link-1",
+ "relationship-data": [
+ {
+ "relationship-key": "logical-link.link-name",
+ "relationship-value": "01e8d84a-logical-link-1"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "logical-link.circuit-id",
+ "property-value": "NET_8802"
+ }
+ ]
+ },
+ {
+ "related-to": "logical-link",
+ "related-link": "/aai/v13/network/logical-links/logical-link/01e8d84a-logical-link-2",
+ "relationship-data": [
+ {
+ "relationship-key": "logical-link.link-name",
+ "relationship-value": "01e8d84a-logical-link-2"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "logical-link.circuit-id",
+ "property-value": "NET_8802"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-to": "vserver",
+ "related-link": "/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant/b49b830686654191bb1e952a74b014ad/vservers/vserver/b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a",
+ "relationship-data": [
+ {
+ "relationship-key": "cloud-region.cloud-owner",
+ "relationship-value": "CloudOwner"
+ },
+ {
+ "relationship-key": "cloud-region.cloud-region-id",
+ "relationship-value": "RegionOne"
+ },
+ {
+ "relationship-key": "tenant.tenant-id",
+ "relationship-value": "b49b830686654191bb1e952a74b014ad"
+ },
+ {
+ "relationship-key": "vserver.vserver-id",
+ "relationship-value": "b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a"
+ }
+ ]
+ },
+ {
+ "related-to": "l3-network",
+ "relationship-label": "org.onap.relationships.inventory.Uses",
+ "related-link": "/aai/v13/network/l3-networks/l3-network/HNP1d77c-1094-41ec-b7f3-94bb30951870",
+ "relationship-data": [
+ {
+ "relationship-key": "l3-network.network-id",
+ "relationship-value": "HNP1d77c-1094-41ec-b7f3-94bb30951870"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "l3-network.network-name",
+ "property-value": "HNPORTALOAM.OAM"
+ }
+ ]
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/src/test/resources/junit/pserverInput_with_pInterface.json b/src/test/resources/junit/pserverInput_with_pInterface_LInterface.json
index e33026b..f0ce496 100644
--- a/src/test/resources/junit/pserverInput_with_pInterface.json
+++ b/src/test/resources/junit/pserverInput_with_pInterface_LInterface.json
@@ -27,7 +27,31 @@
"resource-version": "99888",
"serial-number": "c44b872f6830498b88c4989d67b2a6b7",
"status": "ACTIVE",
- "inv-status": "TBD"
+ "inv-status": "TBD",
+ "l-interfaces" : {
+ "l-interface" : [
+ {
+ "interface-id": "junit-l-interface-7",
+ "interface-name": "junit-l-interface-name7",
+ "interface-role": "interface-role7",
+ "is-port-mirrored": "true",
+ "admin-status": "admin-status7",
+ "network-name": "network-name-amdocs",
+ "macaddr": "macaddr-7",
+ "in-maint": "true"
+ },
+ {
+ "interface-id": "junit-l-interface-8",
+ "interface-name": "junit-l-interface-name8",
+ "interface-role": "interface-role8",
+ "is-port-mirrored": "true",
+ "admin-status": "admin-status8",
+ "network-name": "network-name-amdocs",
+ "macaddr": "macaddr-8",
+ "in-maint": "true"
+ }
+ ]
+ }
}
]
},
diff --git a/src/test/resources/junit/pserverInput_with_pInterface_LInterface_set2.json b/src/test/resources/junit/pserverInput_with_pInterface_LInterface_set2.json
new file mode 100644
index 0000000..7b87fa7
--- /dev/null
+++ b/src/test/resources/junit/pserverInput_with_pInterface_LInterface_set2.json
@@ -0,0 +1,165 @@
+{
+ "hostname": "mtn96compute.cci.att.com",
+ "fqdn": "mtn96compute.cci.att.com",
+ "pserver-id": "auto-generated-skeleton",
+ "pserver-name2": "pserverName2-hello",
+ "ptnii-equip-name": "ptnii-equip-name-hello",
+ "equip-type": "Firewall",
+ "equip-vendor": "equip-vendor-hello",
+ "equip-model": "equip-model-hello",
+ "internet-topology": "internet-topology-hello",
+ "purpose": "purpose-something-for-fun",
+ "serial-number": "1223128888",
+ "in-maint": false,
+ "resource-version": "1544034123458",
+ "p-interfaces":{
+ "p-interface": [
+ {
+ "interface-name": "bdc3cc2a-c73e-414f-7ddb-367de92801cb",
+ "speed-value": "1225",
+ "speed-units": "mbs",
+ "port-description": "port-used-for-junit",
+ "equipment-identifier": "8df84f0a-737a-4628-be9c-c3c78454f9d9",
+ "interface-role": "123134236",
+ "interface-type": "Software",
+ "prov-status": "2",
+ "in-maint": "true",
+ "resource-version": "99888",
+ "serial-number": "c44b872f6830498b88c4989d67b2a6b7",
+ "status": "ACTIVE",
+ "inv-status": "TBD",
+ "l-interfaces" : {
+ "l-interface" : [
+ {
+ "interface-id": "junit-l-interface-7",
+ "interface-name": "junit-l-interface-name7",
+ "interface-role": "interface-role7",
+ "is-port-mirrored": "true",
+ "admin-status": "admin-status7",
+ "network-name": "network-name-amdocs",
+ "macaddr": "macaddr-7",
+ "in-maint": "true",
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-to": "logical-link",
+ "related-link": "/aai/v13/network/logical-links/logical-link/01e8d84a-logical-link-3",
+ "relationship-data": [
+ {
+ "relationship-key": "logical-link.link-name",
+ "relationship-value": "01e8d84a-logical-link-3"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "logical-link.circuit-id",
+ "property-value": "NET_8802"
+ }
+ ]
+ }
+ ]
+ }
+ },
+ {
+ "interface-id": "junit-l-interface-8",
+ "interface-name": "junit-l-interface-name8",
+ "interface-role": "interface-role8",
+ "is-port-mirrored": "true",
+ "admin-status": "admin-status8",
+ "network-name": "network-name-amdocs",
+ "macaddr": "macaddr-8",
+ "in-maint": "true",
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-to": "logical-link",
+ "related-link": "/aai/v13/network/logical-links/logical-link/01e8d84a-logical-link-4",
+ "relationship-data": [
+ {
+ "relationship-key": "logical-link.link-name",
+ "relationship-value": "01e8d84a-logical-link-4"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "logical-link.circuit-id",
+ "property-value": "NET_8802"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-to": "logical-link",
+ "related-link": "/aai/v13/network/logical-links/logical-link/01e8d84a-logical-link-1",
+ "relationship-data": [
+ {
+ "relationship-key": "logical-link.link-name",
+ "relationship-value": "01e8d84a-logical-link-1"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "logical-link.circuit-id",
+ "property-value": "NET_8802"
+ }
+ ]
+ },
+ {
+ "related-to": "logical-link",
+ "related-link": "/aai/v13/network/logical-links/logical-link/01e8d84a-logical-link-2",
+ "relationship-data": [
+ {
+ "relationship-key": "logical-link.link-name",
+ "relationship-value": "01e8d84a-logical-link-2"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "logical-link.circuit-id",
+ "property-value": "NET_8802"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-to": "vserver",
+ "relationship-label": "tosca.relationships.HostedOn",
+ "related-link": "/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant/b49b830686654191bb1e952a74b014ad/vservers/vserver/b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a",
+ "relationship-data": [
+ {
+ "relationship-key": "cloud-region.cloud-owner",
+ "relationship-value": "CloudOwner"
+ },
+ {
+ "relationship-key": "cloud-region.cloud-region-id",
+ "relationship-value": "RegionOne"
+ },
+ {
+ "relationship-key": "tenant.tenant-id",
+ "relationship-value": "b49b830686654191bb1e952a74b014ad"
+ },
+ {
+ "relationship-key": "vserver.vserver-id",
+ "relationship-value": "b494cd6e-b9f3-45e0-afe7-e1d1a5f5d74a"
+ }
+ ],
+ "related-to-property": [ {
+ "property-key": "vserver.vserver-name",
+ "property-value": "Firewall-0"
+ }]
+ }
+ ]
+ }
+} \ No newline at end of file