instance name missing for delete action in audit info
Issue-ID: VID-916
Change-Id: Id9a8e59bbc3d221186a3ec23972fc480c29e7fb2
Signed-off-by: PATTANAYAK, SAUMYA SWARUP (sp931a) <sp931a@att.com>
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/AsyncRequestStatus.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/AsyncRequestStatus.java
index 475e184..1a39174 100644
--- a/vid-app-common/src/main/java/org/onap/vid/mso/rest/AsyncRequestStatus.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/AsyncRequestStatus.java
@@ -86,6 +86,11 @@
public String vnfInstanceId;
public String vfModuleInstanceId;
public String volumeGroupInstanceId;
+
+ public String serviceInstanceName;
+ public String vnfInstanceName;
+ public String vfModuleInstanceName;
+ public String volumeGroupInstanceName;
}
@JsonIgnoreProperties(ignoreUnknown = true)
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/AuditServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/AuditServiceImpl.java
index 796e9de..0487af3 100644
--- a/vid-app-common/src/main/java/org/onap/vid/services/AuditServiceImpl.java
+++ b/vid-app-common/src/main/java/org/onap/vid/services/AuditServiceImpl.java
@@ -179,14 +179,15 @@
if (request.requestId != null) {
requestId = UUID.fromString(request.requestId);
}
- instanceName = extractInstanceName(instanceName, request);
+
instanceType = request.requestType;
if (request.requestDetails != null && request.requestDetails.modelInfo != null) {
modelType = request.requestDetails.modelInfo.modelType;
}
instanceId = extractInstanceId(modelType,request);
-
+ instanceName = extractInstanceName(instanceName, request, modelType);
+
startTime = request.startTime;
if (request.requestStatus != null) {
@@ -221,7 +222,20 @@
}
return "";
}
-
+ private String extractInstanceName(String instanceName, AsyncRequestStatus.Request request, String modelType) {
+ if(null != request.instanceReferences) {
+ if("service".equalsIgnoreCase(modelType)) {
+ instanceName = request.instanceReferences.serviceInstanceName;
+ } else if("vfModule".equalsIgnoreCase(modelType)){
+ instanceName = request.instanceReferences.vfModuleInstanceName;
+ } else if("vnf".equalsIgnoreCase(modelType)) {
+ instanceName = request.instanceReferences.vnfInstanceName;
+ } else if("volumeGroup".equalsIgnoreCase(modelType)){
+ instanceName = request.instanceReferences.volumeGroupInstanceName;
+ }
+ }
+ return instanceName;
+ }
private String buildAdditionalInfo(AsyncRequestStatus.Request request) {
String source = "";
String statusMessage = "";