diff options
author | andre.schmid <andre.schmid@est.tech> | 2022-03-24 13:11:04 +0000 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2022-04-04 15:25:41 +0000 |
commit | f6b81e6da9b95ec5ef2c8b2b7b50fb8de9f3dd28 (patch) | |
tree | 6503dc17a281a267dbf9e775552ac4444a6b7170 /openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/CatalogVspClientImpl.java | |
parent | f2e43fb0a2c36b484b686d6c22342e72da66f679 (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/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/CatalogVspClientImpl.java')
1 files changed, 6 insertions, 16 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/CatalogVspClientImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/CatalogVspClientImpl.java index 221c3a7fc5..c9ad46850e 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/CatalogVspClientImpl.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/CatalogVspClientImpl.java @@ -21,9 +21,14 @@ package org.openecomp.sdcrests.vsp.rest.services; +import static javax.ws.rs.core.HttpHeaders.ACCEPT; +import static javax.ws.rs.core.MediaType.APPLICATION_JSON; + import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Map; +import java.util.Optional; +import java.util.Properties; import org.jetbrains.annotations.Nullable; -import org.onap.sdc.tosca.services.YamlUtil; import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder; import org.openecomp.sdc.common.CommonConfigurationManager; import org.openecomp.sdc.common.api.Constants; @@ -33,32 +38,17 @@ import org.openecomp.sdc.common.http.client.api.HttpRequest; import org.openecomp.sdc.common.http.client.api.HttpResponse; import org.openecomp.sdc.logging.api.Logger; import org.openecomp.sdc.logging.api.LoggerFactory; -import org.openecomp.sdcrests.item.rest.services.catalog.notification.EntryNotConfiguredException; import org.openecomp.sdcrests.item.rest.services.catalog.notification.http.HttpConfiguration; import org.openecomp.sdcrests.vsp.rest.CatalogVspClient; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.Properties; - -import static javax.ws.rs.core.HttpHeaders.ACCEPT; -import static javax.ws.rs.core.MediaType.APPLICATION_JSON; - public class CatalogVspClientImpl implements CatalogVspClient { private static final Logger LOGGER = LoggerFactory.getLogger(CatalogVspClientImpl.class); private static final String URL_GET_RESOURCE_BY_CSAR_UUID = "%s://%s:%s/sdc2/rest/v1/catalog/resources/csar/%s"; - private static final String CONFIG_FILE_PROPERTY = "configuration.yaml"; private static final String CONFIG_SECTION = "catalogNotificationsConfig"; public static final String NAME = "name"; public static final String SDC_2_REST_V_1_CATALOG_RESOURCES_CSAR_CSARUUID = "sdc2/rest/v1/catalog/resources/csar/{csaruuid}"; - public CatalogVspClientImpl() { } - /** * Returns the name of a VF which is using the provided VSP. * It returns an empty optional in case the VSP is not used by any VF, |