summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorromaingimbert <romain.gimbert@orange.com>2018-09-07 10:53:31 +0200
committerromaingimbert <romain.gimbert@orange.com>2018-09-07 10:53:31 +0200
commitbeb712f922ca903674844c3370424fc14330164e (patch)
tree909e0969e0940d8e8121e3cc7c3bc610c4183d2b /src/main
parent2ede3ffbcb422795d0d3a733dbe60228ad0ace0d (diff)
state attribute for ServiceInventory
-change jolt mapping to add field state -manage when no VNF found -add test Change-Id: I68d885678aab031176a130349b2fb73838fff683 Issue-ID: EXTAPI-134 Signed-off-by: romaingimbert <romain.gimbert@orange.com>
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/onap/nbi/apis/serviceinventory/AaiClient.java11
-rw-r--r--src/main/resources/jolt/getServiceInventory.json1
2 files changed, 8 insertions, 4 deletions
diff --git a/src/main/java/org/onap/nbi/apis/serviceinventory/AaiClient.java b/src/main/java/org/onap/nbi/apis/serviceinventory/AaiClient.java
index a09917c..b9afe64 100644
--- a/src/main/java/org/onap/nbi/apis/serviceinventory/AaiClient.java
+++ b/src/main/java/org/onap/nbi/apis/serviceinventory/AaiClient.java
@@ -81,10 +81,13 @@ public class AaiClient extends BaseClient {
public Map getVNF(String relatedLink) {
StringBuilder callURL = new StringBuilder().append(aaiHost).append(relatedLink);
-
- ResponseEntity<Object> response = callApiGet(callURL.toString(), buildRequestHeaderForAAI());
- return (LinkedHashMap) response.getBody();
-
+ try{
+ ResponseEntity<Object> response = callApiGet(callURL.toString(), buildRequestHeaderForAAI());
+ return (LinkedHashMap) response.getBody();
+ } catch (BackendFunctionalException e) {
+ LOGGER.error("error on calling {} , {}" , callURL.toString(), e);
+ return null;
+ }
}
public Map getServicesInAaiForCustomer(String customerId) {
diff --git a/src/main/resources/jolt/getServiceInventory.json b/src/main/resources/jolt/getServiceInventory.json
index df4f14c..cb75530 100644
--- a/src/main/resources/jolt/getServiceInventory.json
+++ b/src/main/resources/jolt/getServiceInventory.json
@@ -4,6 +4,7 @@
"spec": {
"service-instance-id": "id",
"service-instance-name": "name",
+ "orchestration-status": "state",
"model-version-id" : "serviceSpecification.id",
"model-invariant-id": "serviceSpecification.invariantUUID",
"vnfs" : {