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.ComputeDetailsDto;
7 import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeDto;
8 import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto;
9 import org.openecomp.sdcrests.vendorsoftwareproducts.types.validation.IsValidJson;
10 import org.springframework.validation.annotation.Validated;
12 import javax.validation.Valid;
13 import javax.validation.constraints.NotNull;
14 import javax.ws.rs.Consumes;
15 import javax.ws.rs.DELETE;
16 import javax.ws.rs.GET;
17 import javax.ws.rs.HeaderParam;
18 import javax.ws.rs.POST;
19 import javax.ws.rs.PUT;
20 import javax.ws.rs.Path;
21 import javax.ws.rs.PathParam;
22 import javax.ws.rs.Produces;
23 import javax.ws.rs.core.MediaType;
24 import javax.ws.rs.core.Response;
26 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
27 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
29 @Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/components/{componentId" +
31 @Produces(MediaType.APPLICATION_JSON)
32 @Consumes(MediaType.APPLICATION_JSON)
33 @Api(value = "Vendor Software Product Component Compute-flavors")
35 public interface Compute extends VspEntities {
39 @ApiOperation(value = "Get list of vendor software product component compute-flavors",
40 response = ComputeDto.class,
41 responseContainer = "List")
42 Response list(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
43 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
44 @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
46 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
50 @Path("/{computeFlavorId}")
51 @ApiOperation(value = "Get vendor software product component compute-flavor",
52 response = ComputeDetailsDto.class,
53 responseContainer = "CompositionEntityResponse")
54 Response get(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
55 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
56 @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
58 @ApiParam(value = "Vendor software product compute-flavor Id") @PathParam
61 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
66 @ApiOperation(value = "Create a vendor software product component compute-flavor")
67 Response create(@Valid ComputeDetailsDto request,
68 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
69 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
70 @ApiParam(value = "Vendor software product component Id")
71 @PathParam("componentId") String componentId,
72 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
76 @Path("/{computeFlavorId}")
77 @ApiOperation(value = "Update vendor software product component compute-flavor")
78 Response update(@Valid ComputeDetailsDto request,
79 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
80 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
81 @ApiParam(value = "Vendor software product component Id")
82 @PathParam("componentId") String componentId,
83 @ApiParam(value = "Vendor software product compute-flavor Id") @PathParam
85 String computeFlavorId,
86 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
90 @Path("/{computeFlavorId}/questionnaire")
91 @ApiOperation(value = "Update vendor software product component compute-flavor questionnaire")
92 Response updateQuestionnaire(@NotNull @IsValidJson String questionnaireData,
93 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
94 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
95 @ApiParam(value = "Vendor software product component Id")
96 @PathParam("componentId") String componentId,
97 @ApiParam(value = "Vendor software product compute-flavor Id") @PathParam
99 String computeFlavorId,
100 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
104 @Path("/{computeFlavorId}")
105 @ApiOperation(value = "Delete vendor software product component compute-flavor")
106 Response delete(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
107 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
108 @ApiParam(value = "Vendor software product component Id")
109 @PathParam("componentId") String componentId,
110 @ApiParam(value = "Vendor software product compute-flavor Id") @PathParam
112 String computeFlavorId,
113 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
117 @Path("/{computeFlavorId}/questionnaire")
118 @ApiOperation(value = "Get vendor software product component compute-flavor questionnaire",
119 response = QuestionnaireResponseDto.class)
120 Response getQuestionnaire(
121 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
122 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
123 @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
125 @ApiParam(value = "Vendor software product compute-flavor Id") @PathParam
126 ("computeFlavorId") String computeId,
127 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);