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