Onboarding upload control
[sdc.git] / 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
1 /*
2  * -
3  *  ============LICENSE_START=======================================================
4  *  Copyright (C) 2022 Nordix Foundation.
5  *  ================================================================================
6  *  Licensed under the Apache License, Version 2.0 (the "License");
7  *  you may not use this file except in compliance with the License.
8  *  You may obtain a copy of the License at
9  *
10  *       http://www.apache.org/licenses/LICENSE-2.0
11  *
12  *  Unless required by applicable law or agreed to in writing, software
13  *  distributed under the License is distributed on an "AS IS" BASIS,
14  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *  See the License for the specific language governing permissions and
16  *  limitations under the License.
17  *
18  *  SPDX-License-Identifier: Apache-2.0
19  *  ============LICENSE_END=========================================================
20  */
21
22 package org.openecomp.sdcrests.vsp.rest;
23
24 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
25 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
26 import static org.openecomp.sdcrests.vsp.rest.OrchestrationTemplateCandidateUploadManagerController.URL;
27
28 import io.swagger.v3.oas.annotations.Parameter;
29 import io.swagger.v3.oas.annotations.tags.Tag;
30 import javax.validation.constraints.NotNull;
31 import javax.ws.rs.Consumes;
32 import javax.ws.rs.GET;
33 import javax.ws.rs.HeaderParam;
34 import javax.ws.rs.Path;
35 import javax.ws.rs.PathParam;
36 import javax.ws.rs.Produces;
37 import javax.ws.rs.core.MediaType;
38 import javax.ws.rs.core.Response;
39 import org.springframework.validation.annotation.Validated;
40
41 @Path(URL)
42 @Produces(MediaType.APPLICATION_JSON)
43 @Consumes(MediaType.APPLICATION_JSON)
44 @Tag(name = "SDCE-1 APIs")
45 @Tag(name = "Package Upload Manager")
46 @Validated
47 public interface OrchestrationTemplateCandidateUploadManagerController extends VspEntities {
48
49     String URL = "/v1.0/vendor-software-products/{vspId}/versions/{versionId}/orchestration-template-candidate/upload";
50
51     /**
52      * Gets the latest package upload status for a Vendor Software Product version.
53      *
54      * @param vspId     the vsp id
55      * @param versionId the vsp version id
56      * @param user      the username accessing the API
57      * @return if successful, an OK response with the latest VspUploadStatus information
58      */
59     @GET
60     @Path("/")
61     Response getLatestStatus(@Parameter(description = "Vendor Software Product id") @PathParam("vspId") String vspId,
62                              @Parameter(description = "Vendor Software Product version id") @PathParam("versionId") String versionId,
63                              @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
64
65 }