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;
31 import javax.ws.rs.core.MediaType;
32 import javax.ws.rs.core.Response;
34 import java.io.IOException;
35 import java.lang.reflect.InvocationTargetException;
37 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
38 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
40 @Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/orchestration-template-candidate")
41 @Produces(MediaType.APPLICATION_JSON)
42 @Consumes(MediaType.APPLICATION_JSON)
43 @Api(value = "Orchestration Template Candidate")
45 public interface OrchestrationTemplateCandidate extends VspEntities {
49 @Consumes(MediaType.MULTIPART_FORM_DATA)
51 @PathParam("vspId") String vspId,
52 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
53 @Multipart("upload") Attachment fileToUpload,
54 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
58 @Produces(MediaType.APPLICATION_OCTET_STREAM)
59 @ApiOperation(value = "Get uploaded Network Package file",
60 notes = "Downloads in uploaded Network Package file",
61 response = File.class)
63 @PathParam("vspId") String vspId,
64 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
65 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)
70 @ApiOperation(value = "Delete orchestration template candidate file and its files data structure")
72 @PathParam("vspId") String vspId,
73 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId)
78 @ApiOperation(value = "process Orchestration Template Candidate",
79 response = UploadFileResponseDto.class)
81 @PathParam("vspId") String vspId,
82 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
83 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)
84 throws InvocationTargetException, IllegalAccessException;
88 @ApiOperation(value = "Update an existing vendor software product")
89 Response updateFilesDataStructure(
90 @PathParam("vspId") String vspId,
91 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
92 @Valid FileDataStructureDto fileDataStructureDto,
93 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)
98 @ApiOperation(value = "Get uploaded HEAT file files data structure",
99 notes = "Downloads the latest HEAT package",
100 response = FileDataStructureDto.class)
101 Response getFilesDataStructure(
102 @PathParam("vspId") String vspId,
103 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
104 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)