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.v3.oas.annotations.OpenAPIDefinition;
20 import io.swagger.v3.oas.annotations.Operation;
21 import io.swagger.v3.oas.annotations.Parameter;
22 import io.swagger.v3.oas.annotations.info.Info;
23 import io.swagger.v3.oas.annotations.media.Content;
24 import io.swagger.v3.oas.annotations.media.Schema;
25 import io.swagger.v3.oas.annotations.responses.ApiResponse;
26 import org.apache.cxf.jaxrs.ext.multipart.Attachment;
27 import org.apache.cxf.jaxrs.ext.multipart.Multipart;
28 import org.openecomp.sdcrests.vendorsoftwareproducts.types.FileDataStructureDto;
29 import org.openecomp.sdcrests.vendorsoftwareproducts.types.UploadFileResponseDto;
30 import org.springframework.validation.annotation.Validated;
32 import javax.validation.Valid;
33 import javax.validation.constraints.NotNull;
35 import javax.ws.rs.core.MediaType;
36 import javax.ws.rs.core.Response;
38 import java.io.IOException;
39 import java.lang.reflect.InvocationTargetException;
41 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
42 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
44 @Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/orchestration-template-candidate")
45 @Produces(MediaType.APPLICATION_JSON)
46 @Consumes(MediaType.APPLICATION_JSON)
47 @OpenAPIDefinition(info = @Info(title = "Orchestration Template Candidate"))
49 public interface OrchestrationTemplateCandidate extends VspEntities {
53 @Consumes(MediaType.MULTIPART_FORM_DATA)
55 @PathParam("vspId") String vspId,
56 @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
57 @Multipart("upload") Attachment fileToUpload,
58 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
62 @Produces(MediaType.APPLICATION_OCTET_STREAM)
63 @Operation(description = "Get uploaded Network Package file",
64 summary = "Downloads in uploaded Network Package file", responses = @ApiResponse(content = @Content(schema = @Schema(implementation =File.class))))
66 @PathParam("vspId") String vspId,
67 @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
68 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)
73 @Operation(description = "Delete orchestration template candidate file and its files data structure")
75 @PathParam("vspId") String vspId,
76 @Parameter(description = "Version Id") @PathParam("versionId") String versionId)
81 @Operation(description = "process Orchestration Template Candidate",responses = @ApiResponse(content = @Content(schema = @Schema(implementation =UploadFileResponseDto.class))))
83 @PathParam("vspId") String vspId,
84 @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
85 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)
86 throws InvocationTargetException, IllegalAccessException;
90 @Operation(description = "Update an existing vendor software product")
91 Response updateFilesDataStructure(
92 @PathParam("vspId") String vspId,
93 @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
94 @Valid FileDataStructureDto fileDataStructureDto,
95 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)
100 @Operation(description = "Get uploaded HEAT file files data structure",
101 summary = "Downloads the latest HEAT package",responses = @ApiResponse(content = @Content(schema = @Schema(implementation =FileDataStructureDto.class))))
102 Response getFilesDataStructure(
103 @PathParam("vspId") String vspId,
104 @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
105 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)