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.ImageDto;
7 import org.openecomp.sdcrests.vendorsoftwareproducts.types.ImageRequestDto;
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}/images")
22 @Produces(MediaType.APPLICATION_JSON)
23 @Consumes(MediaType.APPLICATION_JSON)
24 @Api(value = "Vendor Software Product Images")
26 public interface Images extends VspEntities {
30 @ApiOperation(value = "List vendor software product component images",
31 response = ImageDto.class,
32 responseContainer = "List")
33 Response list(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
34 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
35 @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
37 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
42 @ApiOperation(value = "Create a vendor software product component image")
43 Response create(@Valid ImageRequestDto request,
44 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
45 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
46 @ApiParam(value = "Vendor software product component Id")
47 @PathParam("componentId") String componentId,
48 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
53 //@ApiOperation(value = "Get schema for vendor software product component Image" ,
54 // response = QuestionnaireResponseDto.class)
55 Response getImageSchema(@ApiParam(value = "Vendor software product Id") @PathParam("vspId")
57 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
58 @ApiParam(value = "Vendor software product component Id")
59 @PathParam("componentId") String componentId,@NotNull
60 (message = USER_MISSING_ERROR_MSG) @HeaderParam
61 (USER_ID_HEADER_PARAM) String user);
65 @ApiOperation(value = "Get vendor software product component Image",
66 response = ImageDto.class,
67 responseContainer = "ImageEntityResponse")
68 Response get(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
69 @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
71 @ApiParam(value = "Vendor software product image Id") @PathParam("imageId")
73 @Pattern(regexp = Version.VERSION_REGEX,
74 message = Version.VERSION_STRING_VIOLATION_MSG) @QueryParam("version")
76 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
81 @ApiOperation(value = "Get vendor software product component Image",
82 response = ImageDto.class,
83 responseContainer = "CompositionEntityResponse")
84 Response get(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
85 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
86 @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
88 @ApiParam(value = "Vendor software product Image Id") @PathParam
91 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
96 @ApiOperation(value = "Delete vendor software product Image")
97 Response delete(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
98 @ApiParam(value = "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 Image Id") @PathParam("imageId")
103 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
108 @ApiOperation(value = "Update vendor software product Image")
109 Response update(@Valid ImageRequestDto request,
110 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
111 @ApiParam(value = "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 Image Id") @PathParam("imageId")
116 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
120 @Path("/{imageId}/questionnaire")
121 @ApiOperation(value = "Update vendor software product component image questionnaire")
122 Response updateQuestionnaire(@NotNull @IsValidJson String questionnaireData,
123 @ApiParam(value = "Vendor software product Id")
124 @PathParam("vspId") String vspId,
125 @ApiParam(value = "Version Id")
126 @PathParam("versionId") String versionId,
127 @ApiParam(value = "Vendor software product component Id")
128 @PathParam("componentId") String componentId,
129 @ApiParam(value = "Vendor software product image Id")
130 @PathParam ("imageId") String imageId,
131 @NotNull(message = USER_MISSING_ERROR_MSG)
132 @HeaderParam(USER_ID_HEADER_PARAM) String user);
135 @Path("/{imageId}/questionnaire")
136 @ApiOperation(value = "Get vendor software product component image questionnaire",
137 response = QuestionnaireResponseDto.class)
138 Response getQuestionnaire(
139 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
140 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
141 @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
143 @ApiParam(value = "Vendor software product image Id") @PathParam
144 ("imageId") String imageId,
145 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);