summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/portMirrorConfigurations.spec14
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/util/RestUtil.java3
2 files changed, 12 insertions, 5 deletions
diff --git a/config/portMirrorConfigurations.spec b/config/portMirrorConfigurations.spec
index 964b385..edf413a 100644
--- a/config/portMirrorConfigurations.spec
+++ b/config/portMirrorConfigurations.spec
@@ -4,22 +4,26 @@
{
// This section extracts pnf-information from the GENERIC-RESOURCES-API
- // response from sdnc
+ // port-mirror-configuration-request-input response from sdnc
"operation": "shift",
"spec": {
"port-mirror-configuration-request-input": {
"source-port": {
"pnf-information": {
"pnf-name": "pnfList[0].name",
- "#nfType": "pnfList[0].attributeList[0].name",
- "pnf-type": "pnfList[0].attributeList[0].value"
+ "pnf-type": {
+ "#nfType": "pnfList[0].attributeList[0].name",
+ "@(1,pnf-type)": "pnfList[0].attributeList[0].value"
+ }
}
},
"dest-port": {
"pnf-information": {
"pnf-name": "pnfList[1].name",
- "#nfType": "pnfList[1].attributeList[0].name",
- "pnf-type": "pnfList[1].attributeList[0].value"
+ "pnf-type": {
+ "#nfType": "pnfList[1].attributeList[0].name",
+ "@(1,pnf-type)": "pnfList[1].attributeList[0].value"
+ }
}
}
}
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/util/RestUtil.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/util/RestUtil.java
index 5065da3..b35f9f4 100644
--- a/src/main/java/org/onap/pomba/contextbuilder/sdnc/util/RestUtil.java
+++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/util/RestUtil.java
@@ -230,6 +230,9 @@ public class RestUtil {
Object providedConfigurationsInput = JsonUtils.jsonToObject(sdncResponse);
Chainr providedConfigurations = Chainr.fromSpec(providedConfigurationsSpec);
Object providedConfigurationsObject = providedConfigurations.transform(providedConfigurationsInput);
+ if (null == providedConfigurationsObject) {
+ return pnfList;
+ }
Gson gson = new Gson();
JsonElement jsonElement = gson.toJsonTree(providedConfigurationsObject);
JsonObject jsonObject = (JsonObject) jsonElement;