2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdcrests.vsp.rest;
23 import io.swagger.v3.oas.annotations.OpenAPIDefinition;
24 import io.swagger.v3.oas.annotations.Operation;
25 import io.swagger.v3.oas.annotations.Parameter;
26 import io.swagger.v3.oas.annotations.info.Info;
27 import io.swagger.v3.oas.annotations.media.ArraySchema;
28 import io.swagger.v3.oas.annotations.media.Content;
29 import io.swagger.v3.oas.annotations.media.Schema;
30 import io.swagger.v3.oas.annotations.responses.ApiResponse;
31 import org.apache.cxf.jaxrs.ext.multipart.Attachment;
32 import org.apache.cxf.jaxrs.ext.multipart.Multipart;
33 import org.openecomp.sdcrests.vendorsoftwareproducts.types.MonitoringUploadStatusDto;
34 import org.springframework.validation.annotation.Validated;
36 import javax.validation.constraints.NotNull;
38 import javax.ws.rs.core.MediaType;
39 import javax.ws.rs.core.Response;
41 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
42 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
45 "/v1.0/vendor-software-products/{vspId}/versions/{versionId}/components/{componentId}/uploads/")
46 @Produces(MediaType.APPLICATION_JSON)
47 @Consumes(MediaType.APPLICATION_JSON)
48 @OpenAPIDefinition(info = @Info(title = "Vendor Software Product Component Uploads"))
50 public interface ComponentMonitoringUploads extends VspEntities {
52 @Path("types/{type}/")
53 @Consumes(MediaType.MULTIPART_FORM_DATA)
54 @Operation(description = "Upload file for component by type")
55 Response upload(@Multipart("upload") Attachment attachment,
56 @Parameter(description = "Vendor software product Id") @PathParam("vspId")
58 @Parameter(description = "Vendor software product version Id")
59 @PathParam("versionId") String versionId,
60 @Parameter(description = "Component Id") @PathParam("componentId") String
62 @Parameter(description = "Upload Type") @PathParam("type") String type,
63 @NotNull(message = USER_MISSING_ERROR_MSG)
64 @HeaderParam(USER_ID_HEADER_PARAM) String user) throws Exception;
68 @Operation(description = "Delete file uploaded for component")
70 @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
71 @Parameter(description = "Vendor software product version Id") @PathParam("versionId")
73 @Parameter(description = "Component Id") @PathParam("componentId") String componentId,
74 @Parameter(description = "Upload Type") @PathParam("type") String type,
75 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user)
80 @Operation(description = "Get the filenames of uploaded files by type", responses = @ApiResponse(content = @Content(array = @ArraySchema( schema = @Schema(implementation =MonitoringUploadStatusDto.class)))))
81 Response list(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
82 @Parameter(description = "Vendor software product version Id") @PathParam("versionId")
84 @Parameter(description = "Vendor software product component Id") @PathParam("componentId")
86 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)