summaryrefslogtreecommitdiffstats
path: root/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/OrchestrationTemplateCandidateUploadManagerController.java
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2022-02-23 21:09:56 +0000
committerandre.schmid <andre.schmid@est.tech>2022-03-03 10:41:23 +0000
commit3dcbae860f1a4bc8e6596cddc9cb19611d0c3dc7 (patch)
tree01a34ad9bdc56a437632752ba3d1aedcaf5d0db2 /openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/OrchestrationTemplateCandidateUploadManagerController.java
parentc4a8271d664deb39e69fbba329b11ff57b9b276b (diff)
Obtain upload lock before uploading
Before uploading, the system will now set the status as uploading in order to have more control of the upload process and status. Without that the UI status updates could show up incorrectly. Also, this behaviour removes the need to upload a file to set the upload in progress, which avoids a concurrent upload try to upload a file if there is another upload in progress. Change-Id: Ic008560aa57e1ee7a50389ad26f1a8890f1cf198 Issue-ID: SDC-3888 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/OrchestrationTemplateCandidateUploadManagerController.java')
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/OrchestrationTemplateCandidateUploadManagerController.java15
1 files changed, 15 insertions, 0 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/OrchestrationTemplateCandidateUploadManagerController.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/OrchestrationTemplateCandidateUploadManagerController.java
index 971a1c42b5..19c27e4c56 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/OrchestrationTemplateCandidateUploadManagerController.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/OrchestrationTemplateCandidateUploadManagerController.java
@@ -31,6 +31,7 @@ import javax.validation.constraints.NotNull;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
@@ -62,4 +63,18 @@ public interface OrchestrationTemplateCandidateUploadManagerController extends V
@Parameter(description = "Vendor Software Product version id") @PathParam("versionId") String versionId,
@NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+ /**
+ * Creates the upload lock, setting the status to upload in progress.
+ *
+ * @param vspId the vsp id
+ * @param versionId the vsp version id
+ * @param user the username accessing the API
+ * @return if successful, an OK response with the created VspUploadStatus information
+ */
+ @POST
+ @Path("/")
+ Response createUploadLock(@Parameter(description = "Vendor Software Product id") @PathParam("vspId") String vspId,
+ @Parameter(description = "Vendor Software Product version id") @PathParam("versionId") String versionId,
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
+
}