summaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
authoraosull01 <adrian.osullivan@huawei.com>2019-03-08 15:33:43 +0000
committeraosull01 <adrian.osullivan@huawei.com>2019-03-08 15:34:33 +0000
commit66403a1729296f9d90ce61a4d4cb0d102e03cd1e (patch)
treeced0eea0758f3a069861355beeda8a4f30c29272 /src/main/java/org
parentd801fdc32a34621aed239f5429c55cda0344eac9 (diff)
add href to service inventory responses
Change-Id: I818902bb04dc9464764ee52efb309df20e18e652 Issue-ID: EXTAPI-210 Signed-off-by: aosull01 <adrian.osullivan@huawei.com>
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/onap/nbi/apis/hub/service/CheckDMaaPEventsManager.java1
-rw-r--r--src/main/java/org/onap/nbi/apis/serviceinventory/ServiceInventoryService.java4
2 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/org/onap/nbi/apis/hub/service/CheckDMaaPEventsManager.java b/src/main/java/org/onap/nbi/apis/hub/service/CheckDMaaPEventsManager.java
index 7cd2287..b45647f 100644
--- a/src/main/java/org/onap/nbi/apis/hub/service/CheckDMaaPEventsManager.java
+++ b/src/main/java/org/onap/nbi/apis/hub/service/CheckDMaaPEventsManager.java
@@ -121,6 +121,7 @@ public class CheckDMaaPEventsManager {
JsonNode serviceInstances = childserviceInstances.get("service-instance");
JsonNode serviceInstance = serviceInstances.get(0);
serviceInstanceEvent.setId(serviceInstance.get("service-instance-id").asText());
+ serviceInstanceEvent.setHref("service/" + serviceInstance.get("service-instance-id").asText());
serviceInstanceEvent.setState(serviceInstance.get("orchestration-status").asText());
if (action.equals("CREATE")) {
if (logger.isDebugEnabled()) {
diff --git a/src/main/java/org/onap/nbi/apis/serviceinventory/ServiceInventoryService.java b/src/main/java/org/onap/nbi/apis/serviceinventory/ServiceInventoryService.java
index 0426226..4abc3e8 100644
--- a/src/main/java/org/onap/nbi/apis/serviceinventory/ServiceInventoryService.java
+++ b/src/main/java/org/onap/nbi/apis/serviceinventory/ServiceInventoryService.java
@@ -55,6 +55,8 @@ public class ServiceInventoryService {
LinkedHashMap serviceInventoryResponse =
(LinkedHashMap) getServiceInventoryJsonTransformer.transform(serviceResponse);
addrelatedPartyIdIdandSpecName(serviceId, serviceInventoryResponse);
+ String href = "service/" + serviceId;
+ serviceInventoryResponse.put("href", href );
return serviceInventoryResponse;
} else {
throw new BackendFunctionalException(HttpStatus.NOT_FOUND, "no catalog service found",
@@ -153,6 +155,8 @@ public class ServiceInventoryService {
if (!CollectionUtils.isEmpty(serviceInstances)) {
serviceInventoryResponse = findServiceInventoryJsonTransformer.transform(serviceInstances);
for (LinkedHashMap serviceInventory : serviceInventoryResponse) {
+ String href = "service/" + serviceInventory.get("id");
+ serviceInventory.put("href", href);
LinkedHashMap party = (LinkedHashMap) serviceInventory.get("relatedParty");
party.put("id", customerId);
}