diff options
author | Tait,Trevor(rt0435) <rtait@amdocs.com> | 2019-02-12 10:21:48 -0500 |
---|---|---|
committer | Tait,Trevor(rt0435) <rtait@amdocs.com> | 2019-02-12 14:41:44 -0500 |
commit | f7f9a94854dd70d29945cf25e7fe0ea1a10c16da (patch) | |
tree | 3154e166878714a973b428b3b35f25e86a3ce070 /src/main/java/org/onap | |
parent | edbe401f90d9fd332a2ee18d84846c1360b62b36 (diff) |
SdnccCtxBld unable to retrieve all VNF attributes
Issue-ID: LOG-968
Change-Id: I93e95e18a9b498dbedcc9ca14c84dd8eab17f59f
Signed-off-by: Tait,Trevor(rt0435) <rtait@amdocs.com>
Diffstat (limited to 'src/main/java/org/onap')
-rw-r--r-- | src/main/java/org/onap/pomba/contextbuilder/sdnc/handlers/VnfApiHandler.java | 2 | ||||
-rw-r--r-- | src/main/java/org/onap/pomba/contextbuilder/sdnc/util/RestUtil.java | 14 |
2 files changed, 7 insertions, 9 deletions
diff --git a/src/main/java/org/onap/pomba/contextbuilder/sdnc/handlers/VnfApiHandler.java b/src/main/java/org/onap/pomba/contextbuilder/sdnc/handlers/VnfApiHandler.java index 2aeba1a..7cb9214 100644 --- a/src/main/java/org/onap/pomba/contextbuilder/sdnc/handlers/VnfApiHandler.java +++ b/src/main/java/org/onap/pomba/contextbuilder/sdnc/handlers/VnfApiHandler.java @@ -125,7 +125,7 @@ public class VnfApiHandler { private static List<VnfInstance> retrieveAaiVnfList(RestClient aaiClient, String aaiBaseUrl, String aaiBasicAuthorization, String transactionId, List <String>genericVnfLinks) throws AuditException { List<VnfInstance> vnfList = new ArrayList<>(); for (String genericVnfLink : genericVnfLinks) { - String genericVnfUrl = RestUtil.generateAaiUrl(aaiBaseUrl, genericVnfLink, null); + String genericVnfUrl = RestUtil.generateAaiUrl(aaiBaseUrl, genericVnfLink, "?depth=all"); String genericVnfPayload = RestUtil.getAaiResource(aaiClient, genericVnfUrl, aaiBasicAuthorization, transactionId); if (genericVnfPayload.equals(EMPTY_JSON_STRING)) { log.info("retrieveAaiVnfList "+ genericVnfPayload +" is not found, " + "return empty Json "); 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 b35f9f4..0353661 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 @@ -95,7 +95,6 @@ public class RestUtil { private static final String FORWARD_SLASH = "/"; // SDNC vnf Json Path - private static final String VNF_SPEC_PATH = "config/vnflist.spec"; private static final String GENERIC_API_SPEC_PATH = "config/sdncgenericresource.spec"; private static final String PROVIDED_CONFIGURATIONS_SPEC_PATH = "config/providedConfigurations.spec"; private static final String PORT_MIRROR_CONFIGURATIONS_SPEC_PATH = "config/portMirrorConfigurations.spec"; @@ -562,13 +561,12 @@ public class RestUtil { * Extract the vnf-list from the Json payload. */ private static List<Vnf> extractVnfList(String payload) throws AuditException { - List<Object> jsonSpec = JsonUtils.filepathToList(VNF_SPEC_PATH); - Object jsonInput = JsonUtils.jsonToObject(payload); - Chainr chainr = Chainr.fromSpec(jsonSpec); - Object transObject = chainr.transform(jsonInput); - String vnfListString = JsonUtils.toPrettyJsonString(transObject); - VnfList vnfList = VnfList.fromJson(vnfListString); - return vnfList.getVnfList(); + VnfList vnfList = VnfList.fromJson(payload); + if (null != vnfList) { + return vnfList.getVnfList(); + } + return new ArrayList<>(); + } private static String abstractStrInfo (String origStr, String matchStr) { |