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.annotations.Api;
24 import io.swagger.annotations.ApiOperation;
25 import io.swagger.annotations.ApiParam;
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.ProcessEntityDto;
29 import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessRequestDto;
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 static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
39 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
41 @Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/components/{componentId}/processes")
42 @Produces(MediaType.APPLICATION_JSON)
43 @Consumes(MediaType.APPLICATION_JSON)
44 @Api(value = "Vendor Software Product Component Processes")
46 public interface ComponentProcesses extends VspEntities {
49 @ApiOperation(value = "List vendor software product component processes",
50 response = ProcessEntityDto.class,
51 responseContainer = "List")
52 Response list(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
53 @ApiParam(value = "Vendor software product version Id") @PathParam("versionId") String versionId,
54 @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
56 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
61 @ApiOperation(value = "Delete vendor software product processes",
62 responseContainer = "List")
64 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
65 @ApiParam(value = "Vendor software product version Id") @PathParam("versionId") String versionId,
66 @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
68 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
72 @ApiOperation(value = "Create a vendor software product process")
73 Response create(@Valid ProcessRequestDto request,
74 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
75 @ApiParam(value = "Vendor software product version Id") @PathParam("versionId") String versionId,
76 @ApiParam(value = "Vendor software product component Id")
77 @PathParam("componentId") String componentId,
78 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
83 @ApiOperation(value = "Get vendor software product process",
84 response = ProcessEntityDto.class)
85 Response get(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
86 @ApiParam(value = "Vendor software product version Id") @PathParam("versionId") String versionId,
87 @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
89 @ApiParam(value = "Vendor software product process Id") @PathParam("processId")
91 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
96 @ApiOperation(value = "Delete vendor software product process")
97 Response delete(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
98 @ApiParam(value = "Vendor software product version Id") @PathParam("versionId") String versionId,
99 @ApiParam(value = "Vendor software product component Id")
100 @PathParam("componentId") String componentId,
101 @ApiParam(value = "Vendor software product process Id") @PathParam("processId")
103 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
107 @Path("/{processId}")
108 @ApiOperation(value = "Update vendor software product process")
109 Response update(@Valid ProcessRequestDto request,
110 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
111 @ApiParam(value = "Vendor software product version Id") @PathParam("versionId") String versionId,
112 @ApiParam(value = "Vendor software product component Id")
113 @PathParam("componentId") String componentId,
114 @ApiParam(value = "Vendor software product process Id") @PathParam("processId")
116 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
120 @Path("/{processId}/upload")
121 @Produces(MediaType.APPLICATION_OCTET_STREAM)
122 @ApiOperation(value = "Get vendor software product process uploaded file")
123 Response getUploadedFile(
124 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
125 @ApiParam(value = "Vendor software product version Id") @PathParam("versionId") String versionId,
126 @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
128 @ApiParam(value = "Vendor software product process Id") @PathParam("processId")
130 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
133 @Path("/{processId}/upload")
134 @ApiOperation(value = "Delete vendor software product process uploaded file")
135 Response deleteUploadedFile(
136 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
137 @ApiParam(value = "Vendor software product version Id") @PathParam("versionId") String versionId,
138 @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
140 @ApiParam(value = "Vendor software product process Id") @PathParam("processId")
142 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
145 @Path("/{processId}/upload")
146 @Consumes(MediaType.MULTIPART_FORM_DATA)
147 @ApiOperation(value = "Update vendor software product process upload")
148 Response uploadFile(@Multipart("upload") Attachment attachment,
149 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
150 @ApiParam(value = "Vendor software product version Id") @PathParam("versionId") String versionId,
151 @ApiParam(value = "Vendor software product component Id")
152 @PathParam("componentId") String componentId,
153 @ApiParam(value = "Vendor software product process Id")
154 @PathParam("processId") String processId,
155 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)