summaryrefslogtreecommitdiffstats
path: root/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2022-03-24 13:11:04 +0000
committerMichael Morris <michael.morris@est.tech>2022-04-04 15:25:41 +0000
commitf6b81e6da9b95ec5ef2c8b2b7b50fb8de9f3dd28 (patch)
tree6503dc17a281a267dbf9e775552ac4444a6b7170 /openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main
parentf2e43fb0a2c36b484b686d6c22342e72da66f679 (diff)
Log partial VSP deletion
Adds entries to the VSP activity log identifying the VSP versions deleted from the MinIO client, and also if the deletion was fully complete. If the VSP deletion from the database fails, there will be registry of what happened with the MinIO deletion. Do some refactor in the VendorSoftwareProductsImpl in relation to the VSP deletion flow and responses. Issue-ID: SDC-3931 Change-Id: I75cb9d7fb74a48db01b242a5f70fefa0a88faa0d Signed-off-by: andre.schmid <andre.schmid@est.tech>
Diffstat (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main')
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/errors/DefaultExceptionMapper.java4
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/resources/errorCodesToResponseStatusMapping.json5
2 files changed, 7 insertions, 2 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/errors/DefaultExceptionMapper.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/errors/DefaultExceptionMapper.java
index a256af785c..22d6d90d8a 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/errors/DefaultExceptionMapper.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/errors/DefaultExceptionMapper.java
@@ -80,8 +80,8 @@ public class DefaultExceptionMapper implements ExceptionMapper<Exception> {
return buildResponse(Status.INTERNAL_SERVER_ERROR, code);
}
- private Response buildResponse(Status notFound, ErrorCode code) {
- return Response.status(notFound).entity(toEntity(notFound, code)).build();
+ private Response buildResponse(final Status status, final ErrorCode code) {
+ return Response.status(status).entity(toEntity(status, code)).build();
}
private Response transform(ConstraintViolationException validationException) {
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/resources/errorCodesToResponseStatusMapping.json b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/resources/errorCodesToResponseStatusMapping.json
index 96c06ae97c..5b2e808781 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/resources/errorCodesToResponseStatusMapping.json
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/resources/errorCodesToResponseStatusMapping.json
@@ -9,6 +9,11 @@
"VSP_UPLOAD_STATUS_NOT_FOUND_ERROR": "NOT_FOUND",
"VSP_UPLOAD_ALREADY_FINISHED_ERROR": "INTERNAL_SERVER_ERROR",
"VSP_UPLOAD_ALREADY_IN_STATUS_ERROR": "BAD_REQUEST",
+ "VSP_DELETE_ALREADY_IN_USE_BY_VF": "FORBIDDEN",
+ "VSP_DELETE_NOT_ARCHIVED": "FORBIDDEN",
+ "VSP_DELETE_GENERIC_ERROR": "INTERNAL_SERVER_ERROR",
+ "VSP_DELETE_FROM_STORAGE_ERROR": "INTERNAL_SERVER_ERROR",
+ "VSP_DELETE_FROM_DATABASE_ERROR": "INTERNAL_SERVER_ERROR",
"ORCHESTRATION_NOT_FOUND": "NOT_FOUND",
"UPLOAD_INVALID" : "PRECONDITION_FAILED",
"PACKAGE_NOT_FOUND": "NOT_FOUND",