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.vendorlicense.rest;
23 import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM;
24 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
26 import io.swagger.annotations.Api;
27 import io.swagger.annotations.ApiOperation;
28 import io.swagger.annotations.ApiParam;
29 import org.openecomp.sdc.versioning.dao.types.Version;
30 import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolEntityDto;
31 import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolRequestDto;
32 import org.springframework.validation.annotation.Validated;
34 import javax.validation.Valid;
35 import javax.validation.constraints.NotNull;
36 import javax.validation.constraints.Pattern;
37 import javax.ws.rs.Consumes;
38 import javax.ws.rs.DELETE;
39 import javax.ws.rs.GET;
40 import javax.ws.rs.HeaderParam;
41 import javax.ws.rs.POST;
42 import javax.ws.rs.PUT;
43 import javax.ws.rs.Path;
44 import javax.ws.rs.PathParam;
45 import javax.ws.rs.Produces;
46 import javax.ws.rs.QueryParam;
47 import javax.ws.rs.core.MediaType;
48 import javax.ws.rs.core.Response;
50 @Path("/v1.0/vendor-license-models/{vlmId}/entitlement-pools")
51 @Produces(MediaType.APPLICATION_JSON)
52 @Consumes(MediaType.APPLICATION_JSON)
53 @Api(value = "Vendor License Model - Entitlement Pools")
55 public interface EntitlementPools {
58 @ApiOperation(value = "List vendor entitlement pools",
59 response = EntitlementPoolEntityDto.class,
60 responseContainer = "List")
61 Response listEntitlementPools(
62 @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
63 @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG)
64 @QueryParam("version") String version,
65 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
69 @ApiOperation(value = "Create vendor entitlement pool")
70 Response createEntitlementPool(@Valid EntitlementPoolRequestDto request,
71 @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
73 @NotNull(message = USER_MISSING_ERROR_MSG)
74 @HeaderParam(USER_HEADER_PARAM) String user);
77 @Path("/{entitlementPoolId}")
78 @ApiOperation(value = "Update vendor entitlement pool")
79 Response updateEntitlementPool(@Valid EntitlementPoolRequestDto request,
80 @ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
82 @NotNull(message = USER_MISSING_ERROR_MSG)
83 @PathParam("entitlementPoolId") String entitlementPoolId,
84 @HeaderParam(USER_HEADER_PARAM) String user);
87 @Path("/{entitlementPoolId}")
88 @ApiOperation(value = "Get vendor entitlement pool",
89 response = EntitlementPoolEntityDto.class)
90 Response getEntitlementPool(
91 @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
92 @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG)
93 @QueryParam("version") String version,
94 @PathParam("entitlementPoolId") String entitlementPoolId,
95 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
98 @Path("/{entitlementPoolId}")
99 @ApiOperation(value = "Delete vendor entitlement pool")
100 Response deleteEntitlementPool(
101 @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
102 @PathParam("entitlementPoolId") String entitlementPoolId,
103 @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);