aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/EntitlementPools.java
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/EntitlementPools.java')
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/EntitlementPools.java34
1 files changed, 18 insertions, 16 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/EntitlementPools.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/EntitlementPools.java
index 9dea767f7d..1f88e4c475 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/EntitlementPools.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/EntitlementPools.java
@@ -20,20 +20,15 @@
package org.openecomp.sdcrests.vendorlicense.rest;
-import static org.openecomp.sdcrests.common.RestConstants.USER_HEADER_PARAM;
-import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
-
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
-import org.openecomp.sdc.versioning.dao.types.Version;
import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolEntityDto;
import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolRequestDto;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Pattern;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
@@ -43,11 +38,13 @@ import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-@Path("/v1.0/vendor-license-models/{vlmId}/entitlement-pools")
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
+
+@Path("/v1.0/vendor-license-models/{vlmId}/versions/{versionId}/entitlement-pools")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Api(value = "Vendor License Model - Entitlement Pools")
@@ -60,9 +57,9 @@ public interface EntitlementPools {
responseContainer = "List")
Response listEntitlementPools(
@ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
- @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG)
- @QueryParam("version") String version,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
+ @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
+
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
@POST
@Path("/")
@@ -70,8 +67,11 @@ public interface EntitlementPools {
Response createEntitlementPool(@Valid EntitlementPoolRequestDto request,
@ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
String vlmId,
+ @ApiParam(value = "Vendor license model version Id") @PathParam
+ ("versionId")
+ String versionId,
@NotNull(message = USER_MISSING_ERROR_MSG)
- @HeaderParam(USER_HEADER_PARAM) String user);
+ @HeaderParam(USER_ID_HEADER_PARAM) String user);
@PUT
@Path("/{entitlementPoolId}")
@@ -79,9 +79,11 @@ public interface EntitlementPools {
Response updateEntitlementPool(@Valid EntitlementPoolRequestDto request,
@ApiParam(value = "Vendor license model Id") @PathParam("vlmId")
String vlmId,
+ @ApiParam(value = "Vendor license model version Id")
+ @PathParam("versionId") String versionId,
@NotNull(message = USER_MISSING_ERROR_MSG)
@PathParam("entitlementPoolId") String entitlementPoolId,
- @HeaderParam(USER_HEADER_PARAM) String user);
+ @HeaderParam(USER_ID_HEADER_PARAM) String user);
@GET
@Path("/{entitlementPoolId}")
@@ -89,17 +91,17 @@ public interface EntitlementPools {
response = EntitlementPoolEntityDto.class)
Response getEntitlementPool(
@ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
- @Pattern(regexp = Version.VERSION_REGEX, message = Version.VERSION_STRING_VIOLATION_MSG)
- @QueryParam("version") String version,
+ @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
@PathParam("entitlementPoolId") String entitlementPoolId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
@DELETE
@Path("/{entitlementPoolId}")
@ApiOperation(value = "Delete vendor entitlement pool")
Response deleteEntitlementPool(
@ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId,
+ @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId,
@PathParam("entitlementPoolId") String entitlementPoolId,
- @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_HEADER_PARAM) String user);
+ @NotNull(message = USER_MISSING_ERROR_MSG) @HeaderParam(USER_ID_HEADER_PARAM) String user);
}