diff options
Diffstat (limited to 'cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/TicketManagement.java')
-rw-r--r-- | cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/TicketManagement.java | 79 |
1 files changed, 36 insertions, 43 deletions
diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/TicketManagement.java b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/TicketManagement.java index 13e7f6d..96c2ada 100644 --- a/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/TicketManagement.java +++ b/cmso-ticketmgt/src/main/java/org/onap/optf/ticketmgt/service/rs/TicketManagement.java @@ -31,6 +31,11 @@ package org.onap.optf.ticketmgt.service.rs; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; import javax.ws.rs.DELETE; import javax.ws.rs.DefaultValue; import javax.ws.rs.GET; @@ -42,16 +47,9 @@ import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; - import org.onap.optf.cmso.common.CMSRequestError; import org.onap.optf.ticketmgt.service.rs.models.TicketData; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; - @Api("Ticket Management") @Path("/{apiVersion}") @Produces({MediaType.APPLICATION_JSON}) @@ -61,39 +59,36 @@ public interface TicketManagement { @Path("/ticket/{id}") @Produces({MediaType.APPLICATION_JSON}) @ApiOperation(value = "Fetch Ticket", notes = "Returns ticket information for the provided ticket id.", - response = TicketData.class) + response = TicketData.class) @ApiResponses(value = {@ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 404, message = "No record found", response = CMSRequestError.class), - @ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)}) - public Response fetchTicket( - @ApiParam(value = "v1") @PathParam("apiVersion") @DefaultValue("v1") String apiVersion, - @ApiParam(value = "Unique ticket identifier") @PathParam("id") String id); + @ApiResponse(code = 404, message = "No record found", response = CMSRequestError.class), + @ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)}) + public Response fetchTicket(@ApiParam(value = "v1") @PathParam("apiVersion") @DefaultValue("v1") String apiVersion, + @ApiParam(value = "Unique ticket identifier") @PathParam("id") String id); // ****************************************************************** @POST @Path("/ticket/") @Produces({MediaType.APPLICATION_JSON}) @ApiOperation(value = "Create Ticket", notes = "Creates a ticket for the passed data") - @ApiResponses( - value = {@ApiResponse(code = 200, message = "Ticket Created. Ticket Id returned.", response=TicketData.class), + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Ticket Created. Ticket Id returned.", + response = TicketData.class), @ApiResponse(code = 400, message = "Bad request.", response = CMSRequestError.class), @ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)}) - public Response createTicket( - @ApiParam(value = "v1") @PathParam("apiVersion") @DefaultValue("v1") String apiVersion, - @ApiParam(value = "Data for creating a ticket") TicketData ticketData); + public Response createTicket(@ApiParam(value = "v1") @PathParam("apiVersion") @DefaultValue("v1") String apiVersion, + @ApiParam(value = "Data for creating a ticket") TicketData ticketData); // ****************************************************************** @PUT @Path("/ticket/") @Produces({MediaType.APPLICATION_JSON}) @ApiOperation(value = "Update Ticket", notes = "Updates a ticket to the passed data") - @ApiResponses( - value = {@ApiResponse(code = 204, message = "Ticket Updated."), + @ApiResponses(value = {@ApiResponse(code = 204, message = "Ticket Updated."), @ApiResponse(code = 400, message = "Bad request.", response = CMSRequestError.class), @ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)}) - public Response updateTicket( - @ApiParam(value = "v1") @PathParam("apiVersion") @DefaultValue("v1") String apiVersion, - @ApiParam(value = "Data for updating a ticket") TicketData ticketData); + public Response updateTicket(@ApiParam(value = "v1") @PathParam("apiVersion") @DefaultValue("v1") String apiVersion, + @ApiParam(value = "Data for updating a ticket") TicketData ticketData); // ****************************************************************** @DELETE @@ -101,35 +96,33 @@ public interface TicketManagement { @Produces({MediaType.APPLICATION_JSON}) @ApiOperation(value = "Cancel the ticket", notes = "Cancels the ticket.") @ApiResponses(value = {@ApiResponse(code = 204, message = "Delete successful"), - @ApiResponse(code = 404, message = "No record found", response = CMSRequestError.class), - @ApiResponse(code = 400, message = "Bad request", response = CMSRequestError.class), - @ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)}) + @ApiResponse(code = 404, message = "No record found", response = CMSRequestError.class), + @ApiResponse(code = 400, message = "Bad request", response = CMSRequestError.class), + @ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)}) public Response deleteScheduleRequest( - @ApiParam(value = "v1") @PathParam("apiVersion") @DefaultValue("v1") String apiVersion, - @ApiParam(value = "Ticket id to uniquely identify the ticket being deleted.") @PathParam("id") String id); + @ApiParam(value = "v1") @PathParam("apiVersion") @DefaultValue("v1") String apiVersion, + @ApiParam(value = "Ticket id to uniquely identify the ticket being deleted.") @PathParam("id") String id); + - // ****************************************************************** @GET @Path("/tickets") @Produces({MediaType.APPLICATION_JSON}) @ApiOperation(value = "Search Tickets", notes = "Returns a list of based upon the filter criteria.", - response = TicketData.class, responseContainer = "List") + response = TicketData.class, responseContainer = "List") @ApiResponses(value = {@ApiResponse(code = 200, message = "OK"), - @ApiResponse(code = 400, message = "Bad request", response = CMSRequestError.class), - @ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)}) + @ApiResponse(code = 400, message = "Bad request", response = CMSRequestError.class), + @ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)}) public Response searchTcikets( - @ApiParam(value = "v1") @PathParam("apiVersion") @DefaultValue("v1") String apiVersion, - @ApiParam(value = "Ticket identifier", - allowMultiple = true) @QueryParam("id") String id, - @ApiParam(value = "Element Id", - allowMultiple = true) @QueryParam("elementId") String elementId, - @ApiParam(value = "Start time <low>,<high>", - allowMultiple = true) @QueryParam("startTime") String startTime, - @ApiParam(value = "Finish time <low>,<high>", - allowMultiple = true) @QueryParam("finishTime") String finishTime, - @ApiParam(value = "Maximum number of tickets to return") @QueryParam("maxTickets") Integer maxTickets, - @ApiParam(value = "Return tickets > last id") @QueryParam("lastId") String lastId); + @ApiParam(value = "v1") @PathParam("apiVersion") @DefaultValue("v1") String apiVersion, + @ApiParam(value = "Ticket identifier", allowMultiple = true) @QueryParam("id") String id, + @ApiParam(value = "Element Id", allowMultiple = true) @QueryParam("elementId") String elementId, + @ApiParam(value = "Start time <low>,<high>", + allowMultiple = true) @QueryParam("startTime") String startTime, + @ApiParam(value = "Finish time <low>,<high>", + allowMultiple = true) @QueryParam("finishTime") String finishTime, + @ApiParam(value = "Maximum number of tickets to return") @QueryParam("maxTickets") Integer maxTickets, + @ApiParam(value = "Return tickets > last id") @QueryParam("lastId") String lastId); } |