2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 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.NicDto;
27 import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicRequestDto;
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}/nics")
42 @Produces(MediaType.APPLICATION_JSON)
43 @Consumes(MediaType.APPLICATION_JSON)
44 @Api(value = "Vendor Software Product Component NICs")
46 public interface Nics extends VspEntities {
49 @ApiOperation(value = "List vendor software product component NICs",
50 response = NicDto.class,
51 responseContainer = "List")
52 Response list(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
53 @ApiParam(value = "Vendor software product version Id") @PathParam("versionId") String versionId,
54 @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
56 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
61 @ApiOperation(value = "Create a vendor software product NIC")
62 Response create(@Valid NicRequestDto request,
63 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
64 @ApiParam(value = "Vendor software product version Id") @PathParam("versionId") String versionId,
65 @ApiParam(value = "Vendor software product component Id")
66 @PathParam("componentId") String componentId,
67 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
72 @ApiOperation(value = "Get vendor software product NIC",
73 response = NicDto.class)
74 Response get(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
75 @ApiParam(value = "Vendor software product version Id") @PathParam("versionId") String versionId,
76 @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
78 @ApiParam(value = "Vendor software product NIC Id") @PathParam("nicId") String nicId,
79 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
84 @ApiOperation(value = "Delete vendor software product NIC")
85 Response delete(@ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
86 @ApiParam(value = "Vendor software product 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 NIC Id") @PathParam("nicId")
91 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
96 @ApiOperation(value = "Update vendor software product NIC")
97 Response update(@Valid NicRequestDto request,
98 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
99 @ApiParam(value = "Vendor software product 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 NIC Id") @PathParam("nicId")
104 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
108 @Path("/{nicId}/questionnaire")
109 @ApiOperation(value = "Get vendor software product component NIC questionnaire",
110 response = QuestionnaireResponseDto.class)
111 Response getQuestionnaire(
112 @ApiParam(value = "Vendor software product Id") @PathParam("vspId") String vspId,
113 @ApiParam(value = "Vendor software product version Id") @PathParam("versionId") String versionId,
114 @ApiParam(value = "Vendor software product component Id") @PathParam("componentId")
116 @ApiParam(value = "Vendor software product NIC Id") @PathParam("nicId") String nicId,
117 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
120 @Path("/{nicId}/questionnaire")
121 @ApiOperation(value = "Update vendor software product component NIC questionnaire")
122 Response updateQuestionnaire(@NotNull @IsValidJson String questionnaireData,
123 @ApiParam(value = "Vendor software product Id") @PathParam("vspId")
125 @ApiParam(value = "Vendor software product version Id") @PathParam("versionId") String versionId,
126 @ApiParam(value = "Vendor software product component Id")
127 @PathParam("componentId") String componentId,
128 @ApiParam(value = "Vendor software product NIC Id")
129 @PathParam("nicId") String nicId,
130 @NotNull(message = USER_MISSING_ERROR_MSG)
131 @HeaderParam(USER_ID_HEADER_PARAM) String user);