From 280f8015d06af1f41a3ef12e8300801c7a5e0d54 Mon Sep 17 00:00:00 2001 From: AviZi Date: Fri, 9 Jun 2017 02:39:56 +0300 Subject: [SDC-29] Amdocs OnBoard 1707 initial commit. Change-Id: Ie4d12a3f574008b792899b368a0902a8b46b5370 Signed-off-by: AviZi --- .../vendorlicense/rest/LicenseKeyGroups.java | 33 +++++++++++----------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseKeyGroups.java') 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/LicenseKeyGroups.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseKeyGroups.java index d66945d63c..973e3c22d4 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseKeyGroups.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseKeyGroups.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.LicenseKeyGroupEntityDto; import org.openecomp.sdcrests.vendorlicense.types.LicenseKeyGroupRequestDto; 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,14 @@ 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}/license-key-groups") +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}/license-key-groups") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Api(value = "Vendor License Model - License Key Groups") @@ -60,9 +58,8 @@ public interface LicenseKeyGroups { responseContainer = "List") Response listLicenseKeyGroups( @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, - @HeaderParam(USER_HEADER_PARAM) String user); + @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId, + @HeaderParam(USER_ID_HEADER_PARAM) String user); @POST @Path("/") @@ -70,8 +67,10 @@ public interface LicenseKeyGroups { Response createLicenseKeyGroup(@Valid LicenseKeyGroupRequestDto 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("/{licenseKeyGroupId}") @@ -79,9 +78,11 @@ public interface LicenseKeyGroups { Response updateLicenseKeyGroup(@Valid LicenseKeyGroupRequestDto request, @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @ApiParam(value = "Vendor license model version Id") + @PathParam("versionId") String versionId, @PathParam("licenseKeyGroupId") String licenseKeyGroupId, @NotNull(message = USER_MISSING_ERROR_MSG) - @HeaderParam(USER_HEADER_PARAM) String user); + @HeaderParam(USER_ID_HEADER_PARAM) String user); @GET @Path("/{licenseKeyGroupId}") @@ -89,16 +90,16 @@ public interface LicenseKeyGroups { response = LicenseKeyGroupEntityDto.class) Response getLicenseKeyGroup( @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("licenseKeyGroupId") String licenseKeyGroupId, - @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("/{licenseKeyGroupId}") @ApiOperation(value = "Delete vendor license key group") Response deleteLicenseKeyGroup( @ApiParam(value = "Vendor license model Id") @PathParam("vlmId") String vlmId, + @ApiParam(value = "Vendor license model version Id") @PathParam("versionId") String versionId, @PathParam("licenseKeyGroupId") String licenseKeyGroupId, - @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); } -- cgit 1.2.3-korg