1 package org.openecomp.sdcrests.vsp.rest;
3 import io.swagger.annotations.Api;
4 import io.swagger.annotations.ApiOperation;
5 import io.swagger.annotations.ApiParam;
6 import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyModel;
7 import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyResponseDto;
8 import org.springframework.validation.annotation.Validated;
10 import javax.validation.Valid;
11 import javax.validation.constraints.NotNull;
12 import javax.ws.rs.Consumes;
13 import javax.ws.rs.DELETE;
14 import javax.ws.rs.GET;
15 import javax.ws.rs.HeaderParam;
16 import javax.ws.rs.POST;
17 import javax.ws.rs.PUT;
18 import javax.ws.rs.Path;
19 import javax.ws.rs.PathParam;
20 import javax.ws.rs.Produces;
21 import javax.ws.rs.core.MediaType;
22 import javax.ws.rs.core.Response;
24 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
25 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
27 @Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/component-dependencies")
28 @Produces(MediaType.APPLICATION_JSON)
29 @Consumes(MediaType.APPLICATION_JSON)
30 @Api(value = "Vendor Software Product Component Dependencies")
32 public interface ComponentDependencies extends VspEntities {
36 @ApiOperation(value = "Create a vendor software product component dependency")
37 Response create(@Valid ComponentDependencyModel request,
38 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
39 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
40 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
45 @ApiOperation(value = "Get component dependencies for vendor software product",
46 response = ComponentDependencyResponseDto.class,
47 responseContainer = "List")
48 Response list(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
49 @ApiParam(value = "Vendor software product version Id") @PathParam("versionId")
51 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
55 @Path("/{dependencyId}")
56 @ApiOperation(value = "Delete component dependency for vendor software product")
57 Response delete(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
58 @ApiParam(value = "Vendor software product version Id")
59 @PathParam("versionId") String versionId,
60 @ApiParam(value = "Vendor software product Component Dependency Id") @PathParam
61 ("dependencyId") String dependencyId,
62 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
66 @Path("/{dependencyId}")
67 @ApiOperation(value = "Update component dependency for vendor software product")
68 Response update(@Valid ComponentDependencyModel request,
69 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
70 @ApiParam(value = "Vendor software product version Id") @PathParam("versionId")
72 @ApiParam(value = "Vendor software product Component Dependency Id") @PathParam
73 ("dependencyId") String dependencyId,
74 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
78 @Path("/{dependencyId}")
79 @ApiOperation(value = "Get component dependency for vendor software product",
80 response = ComponentDependencyResponseDto.class)
81 Response get(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
82 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
83 @ApiParam(value = "Vendor software product Component Dependency Id") @PathParam
84 ("dependencyId") String dependencyId,
85 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)