summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/handlers/VnfApiHandler.java2
-rw-r--r--src/main/java/org/onap/pomba/contextbuilder/sdnc/util/RestUtil.java14
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) {