1 package org.openecomp.sdcrests.vsp.rest;
3 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
4 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
6 import io.swagger.annotations.Api;
7 import io.swagger.annotations.ApiOperation;
8 import io.swagger.annotations.ApiParam;
9 import org.openecomp.sdc.versioning.dao.types.Version;
10 import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeDetailsDto;
11 import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeDto;
12 import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto;
13 import org.openecomp.sdcrests.vendorsoftwareproducts.types.validation.IsValidJson;
14 import org.springframework.validation.annotation.Validated;
16 import javax.validation.Valid;
17 import javax.validation.constraints.NotNull;
18 import javax.validation.constraints.Pattern;
19 import javax.ws.rs.Consumes;
20 import javax.ws.rs.DELETE;
21 import javax.ws.rs.GET;
22 import javax.ws.rs.HeaderParam;
23 import javax.ws.rs.POST;
24 import javax.ws.rs.PUT;
25 import javax.ws.rs.Path;
26 import javax.ws.rs.PathParam;
27 import javax.ws.rs.Produces;
28 import javax.ws.rs.QueryParam;
29 import javax.ws.rs.core.MediaType;
30 import javax.ws.rs.core.Response;
32 @Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/components/{componentId" +
34 @Produces(MediaType.APPLICATION_JSON)
35 @Consumes(MediaType.APPLICATION_JSON)
36 @Api(value = "Vendor Software Product Component Compute-flavors")
38 public interface Compute extends VspEntities {
42 @ApiOperation(value = "Get list of vendor software product component compute-flavors",
43 response = ComputeDto.class,
44 responseContainer = "List")
45 Response list(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
46 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
47 @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
49 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
53 @Path("/{computeFlavorId}")
54 @ApiOperation(value = "Get vendor software product component compute-flavor",
55 response = ComputeDetailsDto.class,
56 responseContainer = "CompositionEntityResponse")
57 Response get(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
58 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
59 @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
61 @ApiParam(value = "Vendor software product compute-flavor Id") @PathParam
64 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
69 @ApiOperation(value = "Create a vendor software product component compute-flavor")
70 Response create(@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 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
79 @Path("/{computeFlavorId}")
80 @ApiOperation(value = "Update vendor software product component compute-flavor")
81 Response update(@Valid ComputeDetailsDto request,
82 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
83 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
84 @ApiParam(value = "Vendor software product component Id")
85 @PathParam("componentId") String componentId,
86 @ApiParam(value = "Vendor software product compute-flavor Id") @PathParam
88 String computeFlavorId,
89 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
93 @Path("/{computeFlavorId}/questionnaire")
94 @ApiOperation(value = "Update vendor software product component compute-flavor questionnaire")
95 Response updateQuestionnaire(@NotNull @IsValidJson String questionnaireData,
96 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
97 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
98 @ApiParam(value = "Vendor software product component Id")
99 @PathParam("componentId") String componentId,
100 @ApiParam(value = "Vendor software product compute-flavor Id") @PathParam
102 String computeFlavorId,
103 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
107 @Path("/{computeFlavorId}")
108 @ApiOperation(value = "Delete vendor software product component compute-flavor")
109 Response delete(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
110 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
111 @ApiParam(value = "Vendor software product component Id")
112 @PathParam("componentId") String componentId,
113 @ApiParam(value = "Vendor software product compute-flavor Id") @PathParam
115 String computeFlavorId,
116 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
120 @Path("/{computeFlavorId}/questionnaire")
121 @ApiOperation(value = "Get vendor software product component compute-flavor questionnaire",
122 response = QuestionnaireResponseDto.class)
123 Response getQuestionnaire(
124 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
125 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
126 @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
128 @ApiParam(value = "Vendor software product compute-flavor Id") @PathParam
129 ("computeFlavorId") String computeId,
130 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);