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.v3.oas.annotations.OpenAPIDefinition;
24 import io.swagger.v3.oas.annotations.Operation;
25 import io.swagger.v3.oas.annotations.Parameter;
26 import io.swagger.v3.oas.annotations.info.Info;
27 import io.swagger.v3.oas.annotations.media.ArraySchema;
28 import io.swagger.v3.oas.annotations.media.Content;
29 import io.swagger.v3.oas.annotations.media.Schema;
30 import io.swagger.v3.oas.annotations.responses.ApiResponse;
31 import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorDto;
32 import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorListResponseDto;
33 import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorRequestDto;
34 import org.springframework.validation.annotation.Validated;
36 import javax.validation.Valid;
37 import javax.validation.constraints.NotNull;
39 import javax.ws.rs.core.MediaType;
40 import javax.ws.rs.core.Response;
42 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
43 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
46 @Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/deployment-flavors")
47 @Produces(MediaType.APPLICATION_JSON)
48 @Consumes(MediaType.APPLICATION_JSON)
49 @OpenAPIDefinition(info = @Info(title = "Vendor Software Product deployment-flavors"))
51 public interface DeploymentFlavors extends VspEntities {
55 @Operation(description = "Create a vendor software product Deployment Flavor")
56 Response create(@Valid DeploymentFlavorRequestDto request,
57 @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
58 @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
59 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
64 @Operation(description = "List vendor software product Deployment Flavor", responses = @ApiResponse(content = @Content(array = @ArraySchema(schema = @Schema(implementation = DeploymentFlavorListResponseDto.class)))))
65 Response list(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
66 @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
67 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
71 @Path("/{deploymentFlavorId}")
72 @Operation(description = "Get vendor software product Deployment Flavor",responses = @ApiResponse(content = @Content(schema = @Schema(implementation = DeploymentFlavorDto.class))))
73 Response get(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
74 @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
75 @Parameter(description = "Vendor software product Deployment Flavor Id") @PathParam
76 ("deploymentFlavorId") String deploymentFlavorId,
77 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
82 Response getSchema(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String
84 @PathParam("versionId") String versionId,
85 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
89 @Path("/{deploymentFlavorId}")
90 @Operation(description = "Delete vendor software product Deployment Flavor")
91 Response delete(@Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
92 @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
93 @Parameter(description = "Vendor software product Deployment Flavor Id")
94 @PathParam("deploymentFlavorId") String deploymentFlavorId,
95 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)
99 @Path("/{deploymentFlavorId}")
100 @Operation(description = "Update vendor software product Deployment Flavor")
101 Response update(@Valid DeploymentFlavorRequestDto request,
102 @Parameter(description = "Vendor software product Id") @PathParam("vspId") String vspId,
103 @Parameter(description = "Version Id") @PathParam("versionId") String versionId,
104 @Parameter(description = "Vendor software product Deployment Flavor Id")
105 @PathParam("deploymentFlavorId") String deploymentFlavorId,
106 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM)