2 * Copyright © 2016-2018 European Support Limited
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.openecomp.sdcrests.vsp.rest;
19 import io.swagger.annotations.Api;
20 import io.swagger.annotations.ApiOperation;
21 import io.swagger.annotations.ApiParam;
22 import org.apache.cxf.jaxrs.ext.multipart.Attachment;
23 import org.apache.cxf.jaxrs.ext.multipart.Multipart;
24 import org.openecomp.sdcrests.vendorsoftwareproducts.types.FileDataStructureDto;
25 import org.openecomp.sdcrests.vendorsoftwareproducts.types.UploadFileResponseDto;
26 import org.springframework.validation.annotation.Validated;
28 import javax.validation.Valid;
29 import javax.validation.constraints.NotNull;
30 import javax.ws.rs.Consumes;
31 import javax.ws.rs.DELETE;
32 import javax.ws.rs.GET;
33 import javax.ws.rs.HeaderParam;
34 import javax.ws.rs.POST;
35 import javax.ws.rs.PUT;
36 import javax.ws.rs.Path;
37 import javax.ws.rs.PathParam;
38 import javax.ws.rs.Produces;
39 import javax.ws.rs.core.MediaType;
40 import javax.ws.rs.core.Response;
42 import java.io.IOException;
43 import java.lang.reflect.InvocationTargetException;
45 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
46 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
48 @Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/orchestration-template-candidate")
49 @Produces(MediaType.APPLICATION_JSON)
50 @Consumes(MediaType.APPLICATION_JSON)
51 @Api(value = "Orchestration Template Candidate")
53 public interface OrchestrationTemplateCandidate extends VspEntities {
57 @Consumes(MediaType.MULTIPART_FORM_DATA)
59 @PathParam("vspId") String vspId,
60 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
61 @Multipart("upload") Attachment fileToUpload,
62 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
66 @Produces(MediaType.APPLICATION_OCTET_STREAM)
67 @ApiOperation(value = "Get uploaded candidate HEAT file",
68 notes = "Downloads in process candidate HEAT file",
69 response = File.class)
71 @PathParam("vspId") String vspId,
72 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
73 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)
78 @ApiOperation(value = "Delete orchestration template candidate file and its files data structure")
80 @PathParam("vspId") String vspId,
81 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId)
86 @ApiOperation(value = "process Orchestration Template Candidate",
87 response = UploadFileResponseDto.class)
89 @PathParam("vspId") String vspId,
90 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
91 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)
92 throws InvocationTargetException, IllegalAccessException;
96 @ApiOperation(value = "Update an existing vendor software product")
97 Response updateFilesDataStructure(
98 @PathParam("vspId") String vspId,
99 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
100 @Valid FileDataStructureDto fileDataStructureDto,
101 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)
106 @ApiOperation(value = "Get uploaded HEAT file files data structure",
107 notes = "Downloads the latest HEAT package",
108 response = FileDataStructureDto.class)
109 Response getFilesDataStructure(
110 @PathParam("vspId") String vspId,
111 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
112 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)