diff options
author | PATTANAYAK, SAUMYA SWARUP (sp931a) <sp931a@att.com> | 2020-10-30 16:59:05 -0400 |
---|---|---|
committer | PATTANAYAK, SAUMYA SWARUP (sp931a) <sp931a@att.com> | 2020-10-30 16:59:15 -0400 |
commit | a2613d4a31ed4452bf473386718aaa16ab7a02bc (patch) | |
tree | 00c8a75b4d174ea4dbc07d2ec3b23fa54c2cbe90 /vid-app-common | |
parent | 5ecb6d93b05f1cecb95604b057a1894293a6b687 (diff) |
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>
Diffstat (limited to 'vid-app-common')
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/mso/rest/AsyncRequestStatus.java | 5 | ||||
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/services/AuditServiceImpl.java | 20 |
2 files changed, 22 insertions, 3 deletions
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 475e18401..1a39174fd 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 class AsyncRequestStatus { 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 796e9de4a..0487af37f 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 @@ public class AuditServiceImpl implements AuditService{ 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 @@ public class AuditServiceImpl implements AuditService{ } 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 = ""; |