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;
15 import javax.ws.rs.core.MediaType;
16 import javax.ws.rs.core.Response;
18 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
19 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
21 @Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/components/{componentId" +
23 @Produces(MediaType.APPLICATION_JSON)
24 @Consumes(MediaType.APPLICATION_JSON)
25 @Api(value = "Vendor Software Product Component Compute-flavors")
27 public interface Compute extends VspEntities {
31 @ApiOperation(value = "Get list of vendor software product component compute-flavors",
32 response = ComputeDto.class,
33 responseContainer = "List")
34 Response list(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
35 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
36 @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
38 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
42 @Path("/{computeFlavorId}")
43 @ApiOperation(value = "Get vendor software product component compute-flavor",
44 response = ComputeDetailsDto.class,
45 responseContainer = "CompositionEntityResponse")
46 Response get(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
47 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
48 @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
50 @ApiParam(value = "Vendor software product compute-flavor Id") @PathParam
53 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
58 @ApiOperation(value = "Create a vendor software product component compute-flavor")
59 Response create(@Valid ComputeDetailsDto request,
60 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
61 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
62 @ApiParam(value = "Vendor software product component Id")
63 @PathParam("componentId") String componentId,
64 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
68 @Path("/{computeFlavorId}")
69 @ApiOperation(value = "Update vendor software product component compute-flavor")
70 Response update(@Valid ComputeDetailsDto request,
71 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
72 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
73 @ApiParam(value = "Vendor software product component Id")
74 @PathParam("componentId") String componentId,
75 @ApiParam(value = "Vendor software product compute-flavor Id") @PathParam
77 String computeFlavorId,
78 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
82 @Path("/{computeFlavorId}/questionnaire")
83 @ApiOperation(value = "Update vendor software product component compute-flavor questionnaire")
84 Response updateQuestionnaire(@NotNull @IsValidJson String questionnaireData,
85 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
86 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
87 @ApiParam(value = "Vendor software product component Id")
88 @PathParam("componentId") String componentId,
89 @ApiParam(value = "Vendor software product compute-flavor Id") @PathParam
91 String computeFlavorId,
92 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
96 @Path("/{computeFlavorId}")
97 @ApiOperation(value = "Delete vendor software product component compute-flavor")
98 Response delete(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
99 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
100 @ApiParam(value = "Vendor software product component Id")
101 @PathParam("componentId") String componentId,
102 @ApiParam(value = "Vendor software product compute-flavor Id") @PathParam
104 String computeFlavorId,
105 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
109 @Path("/{computeFlavorId}/questionnaire")
110 @ApiOperation(value = "Get vendor software product component compute-flavor questionnaire",
111 response = QuestionnaireResponseDto.class)
112 Response getQuestionnaire(
113 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
114 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
115 @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
117 @ApiParam(value = "Vendor software product compute-flavor Id") @PathParam
118 ("computeFlavorId") String computeId,
119 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);