2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdcrests.vsp.rest;
23 import io.swagger.annotations.Api;
24 import io.swagger.annotations.ApiOperation;
25 import io.swagger.annotations.ApiParam;
26 import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeDetailsDto;
27 import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeDto;
28 import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto;
29 import org.openecomp.sdcrests.vendorsoftwareproducts.types.validation.IsValidJson;
30 import org.springframework.validation.annotation.Validated;
32 import javax.validation.Valid;
33 import javax.validation.constraints.NotNull;
35 import javax.ws.rs.core.MediaType;
36 import javax.ws.rs.core.Response;
38 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
39 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
41 @Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/components/{componentId" +
43 @Produces(MediaType.APPLICATION_JSON)
44 @Consumes(MediaType.APPLICATION_JSON)
45 @Api(value = "Vendor Software Product Component Compute-flavors")
47 public interface Compute extends VspEntities {
51 @ApiOperation(value = "Get list of vendor software product component compute-flavors",
52 response = ComputeDto.class,
53 responseContainer = "List")
54 Response list(@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 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
62 @Path("/{computeFlavorId}")
63 @ApiOperation(value = "Get vendor software product component compute-flavor",
64 response = ComputeDetailsDto.class,
65 responseContainer = "CompositionEntityResponse")
66 Response get(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
67 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
68 @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
70 @ApiParam(value = "Vendor software product compute-flavor Id") @PathParam
73 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
78 @ApiOperation(value = "Create a vendor software product component compute-flavor")
79 Response create(@Valid ComputeDetailsDto request,
80 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
81 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
82 @ApiParam(value = "Vendor software product component Id")
83 @PathParam("componentId") String componentId,
84 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
88 @Path("/{computeFlavorId}")
89 @ApiOperation(value = "Update vendor software product component compute-flavor")
90 Response update(@Valid ComputeDetailsDto request,
91 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
92 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
93 @ApiParam(value = "Vendor software product component Id")
94 @PathParam("componentId") String componentId,
95 @ApiParam(value = "Vendor software product compute-flavor Id") @PathParam
97 String computeFlavorId,
98 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
102 @Path("/{computeFlavorId}/questionnaire")
103 @ApiOperation(value = "Update vendor software product component compute-flavor questionnaire")
104 Response updateQuestionnaire(@NotNull @IsValidJson String questionnaireData,
105 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
106 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
107 @ApiParam(value = "Vendor software product component Id")
108 @PathParam("componentId") String componentId,
109 @ApiParam(value = "Vendor software product compute-flavor Id") @PathParam
111 String computeFlavorId,
112 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
116 @Path("/{computeFlavorId}")
117 @ApiOperation(value = "Delete vendor software product component compute-flavor")
118 Response delete(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
119 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
120 @ApiParam(value = "Vendor software product component Id")
121 @PathParam("componentId") String componentId,
122 @ApiParam(value = "Vendor software product compute-flavor Id") @PathParam
124 String computeFlavorId,
125 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
129 @Path("/{computeFlavorId}/questionnaire")
130 @ApiOperation(value = "Get vendor software product component compute-flavor questionnaire",
131 response = QuestionnaireResponseDto.class)
132 Response getQuestionnaire(
133 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
134 @ApiParam(value = "Version Id") @PathParam("versionId") String versionId,
135 @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
137 @ApiParam(value = "Vendor software product compute-flavor Id") @PathParam
138 ("computeFlavorId") String computeId,
139 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);