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.v3.oas.annotations.Operation;
24 import io.swagger.v3.oas.annotations.Parameter;
25 import io.swagger.v3.oas.annotations.info.Info;
26 import io.swagger.v3.oas.annotations.media.ArraySchema;
27 import io.swagger.v3.oas.annotations.media.Content;
28 import io.swagger.v3.oas.annotations.media.Schema;
29 import io.swagger.v3.oas.annotations.responses.ApiResponse;
30 import io.swagger.v3.oas.annotations.tags.Tag;
31 import io.swagger.v3.oas.annotations.tags.Tags;
32 import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicDto;
33 import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicRequestDto;
34 import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto;
35 import org.openecomp.sdcrests.vendorsoftwareproducts.types.validation.IsValidJson;
36 import org.springframework.validation.annotation.Validated;
38 import javax.validation.Valid;
39 import javax.validation.constraints.NotNull;
41 import javax.ws.rs.core.MediaType;
42 import javax.ws.rs.core.Response;
44 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
45 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
47 @Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/components/{componentId}/nics")
48 @Produces(MediaType.APPLICATION_JSON)
49 @Consumes(MediaType.APPLICATION_JSON)
50 @Tags({@Tag(name = "SDCE-1 APIs"), @Tag(name = "Vendor Software Product Component NICs")})
52 public interface Nics extends VspEntities {
55 @Operation(description = "List vendor software product component NICs",responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = NicDto.class)))))
56 Response list(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
57 @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
58 @Parameter(description = "Vendor software product component Id") @PathParam("componentId")
60 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
65 @Operation(description = "Create a vendor software product NIC")
66 Response create(@Valid NicRequestDto request,
67 @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
68 @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
69 @Parameter(description = "Vendor software product component Id")
70 @PathParam("componentId") String componentId,
71 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
76 @Operation(description = "Get vendor software product NIC", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = NicDto.class))))
77 Response get(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
78 @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
79 @Parameter(description = "Vendor software product component Id") @PathParam("componentId")
81 @Parameter(description = "Vendor software product NIC Id") @PathParam("nicId") String nicId,
82 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
87 @Operation(description = "Delete vendor software product NIC")
88 Response delete(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
89 @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
90 @Parameter(description = "Vendor software product component Id")
91 @PathParam("componentId") String componentId,
92 @Parameter(description = "Vendor software product NIC Id") @PathParam("nicId")
94 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
99 @Operation(description = "Update vendor software product NIC")
100 Response update(@Valid NicRequestDto request,
101 @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
102 @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
103 @Parameter(description = "Vendor software product component Id")
104 @PathParam("componentId") String componentId,
105 @Parameter(description = "Vendor software product NIC Id") @PathParam("nicId")
107 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
111 @Path("/{nicId}/questionnaire")
112 @Operation(description = "Get vendor software product component NIC questionnaire", responses = @ApiResponse(content = @Content(schema = @Schema(implementation = QuestionnaireResponseDto.class))))
113 Response getQuestionnaire(
114 @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
115 @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
116 @Parameter(description = "Vendor software product component Id") @PathParam("componentId")
118 @Parameter(description = "Vendor software product NIC Id") @PathParam("nicId") String nicId,
119 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
122 @Path("/{nicId}/questionnaire")
123 @Operation(description = "Update vendor software product component NIC questionnaire")
124 Response updateQuestionnaire(@NotNull @IsValidJson String questionnaireData,
125 @Parameter(description = "Vendor software product Id") @PathParam("vspId")
127 @Parameter(description = "Vendor software product version Id") @PathParam("versionId") String versionId,
128 @Parameter(description = "Vendor software product component Id")
129 @PathParam("componentId") String componentId,
130 @Parameter(description = "Vendor software product NIC Id")
131 @PathParam("nicId") String nicId,
132 @NotNull(message = USER_MISSING_ERROR_MSG)
133 @HeaderParam(USER_ID_HEADER_PARAM) String user);