Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
org.lockss.laaws.poller.api.PollsApi Maven / Gradle / Ivy
/**
* NOTE: This class is auto generated by the swagger code generator program (3.0.52).
* https://github.com/swagger-api/swagger-codegen
* Do not edit the class manually.
*/
package org.lockss.laaws.poller.api;
import org.lockss.laaws.poller.model.ErrorResult;
import org.lockss.util.rest.poller.PollDesc;
import org.lockss.laaws.poller.model.PollerDetail;
import org.lockss.laaws.poller.model.PollerPager;
import org.lockss.laaws.poller.model.PollerSummary;
import org.lockss.laaws.poller.model.RepairPager;
import org.lockss.laaws.poller.model.UrlPager;
import org.lockss.laaws.poller.model.VoterDetail;
import org.lockss.laaws.poller.model.VoterPager;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.bind.annotation.CookieValue;
import jakarta.validation.Valid;
import jakarta.validation.constraints.*;
import java.util.List;
import java.util.Map;
@Validated
public interface PollsApi {
PollsApiDelegate getDelegate();
@Operation(summary = "Send a request to call a poll to the poller", description = "Use the information found in the descriptor object to initiate a poll.", security = {
@SecurityRequirement(name = "basicAuth") }, tags={ "service" })
@ApiResponses(value = {
@ApiResponse(responseCode = "202", description = "The Poll request has been accepted and added to the queue.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))),
@ApiResponse(responseCode = "200", description = "The resulting error payload.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResult.class))) })
@RequestMapping(value = "/polls",
produces = { "application/json" },
consumes = { "application/json" },
method = RequestMethod.POST)
default ResponseEntity callPoll(@Parameter(in = ParameterIn.DEFAULT, description = "A poll descriptor object used to define the poll being requested.", required=true, schema=@Schema()) @Valid @RequestBody PollDesc body
) {
return getDelegate().callPoll(body);
}
@Operation(summary = "Stop a poll and remove from queue.", description = "Stop a running poll and delete any schecduled polls for poll with the poll service id.", security = {
@SecurityRequirement(name = "basicAuth") }, tags={ "service" })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Poll successfully stopped"),
@ApiResponse(responseCode = "200", description = "The resulting error payload.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResult.class))) })
@RequestMapping(value = "/polls/{psId}",
produces = { "application/json" },
method = RequestMethod.DELETE)
default ResponseEntity cancelPoll(@Parameter(in = ParameterIn.PATH, description = "The poll id.", required=true, schema=@Schema()) @PathVariable("psId") String psId
) {
return getDelegate().cancelPoll(psId);
}
@Operation(summary = "Poll Peer Data", description = "Return the list of urls of vote type for a given peer in a specific poll.", security = {
@SecurityRequirement(name = "basicAuth") }, tags={ "poll-detail" })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "A pagable list of voter urls with a given status.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = UrlPager.class))),
@ApiResponse(responseCode = "200", description = "The resulting error payload.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResult.class))) })
@RequestMapping(value = "/polls/{pollKey}/peer/{peerId}",
produces = { "application/json" },
method = RequestMethod.GET)
default ResponseEntity getPollPeerVoteUrls(@Parameter(in = ParameterIn.PATH, description = "The pollKey from the PollDetail.", required=true, schema=@Schema()) @PathVariable("pollKey") String pollKey
, @Parameter(in = ParameterIn.PATH, description = "The peerId from the Poll Detail.PeerData.", required=true, schema=@Schema()) @PathVariable("peerId") String peerId
, @NotNull @Parameter(in = ParameterIn.QUERY, description = "The voter urls to return." ,required=true,schema=@Schema(allowableValues={ "agreed", "disagreed", "pollerOnly", "voterOnly" }
)) @Valid @RequestParam(value = "urls", required = true) String urls
, @Parameter(in = ParameterIn.QUERY, description = "The page number" ,schema=@Schema()) @Valid @RequestParam(value = "page", required = false) Integer page
, @Parameter(in = ParameterIn.QUERY, description = "The page size" ,schema=@Schema()) @Valid @RequestParam(value = "size", required = false) Integer size
) {
return getDelegate().getPollPeerVoteUrls(pollKey, peerId, urls, page, size);
}
@Operation(summary = "Get queued poll status", description = "Get the status of a previously queued poll.", security = {
@SecurityRequirement(name = "basicAuth") }, tags={ "service" })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Poll info returned.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = PollerSummary.class))),
@ApiResponse(responseCode = "200", description = "The resulting error payload.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResult.class))) })
@RequestMapping(value = "/polls/{psId}",
produces = { "application/json" },
method = RequestMethod.GET)
default ResponseEntity getPollStatus(@Parameter(in = ParameterIn.PATH, description = "The poll id.", required=true, schema=@Schema()) @PathVariable("psId") String psId
) {
return getDelegate().getPollStatus(psId);
}
@Operation(summary = "PollerDetails", description = "Return the detailed information about a poll.", security = {
@SecurityRequirement(name = "basicAuth") }, tags={ "poller-polls" })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Detailed poll info returned.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = PollerDetail.class))),
@ApiResponse(responseCode = "200", description = "The resulting error payload.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResult.class))) })
@RequestMapping(value = "/polls/poller/{pollKey}",
produces = { "application/json" },
method = RequestMethod.GET)
default ResponseEntity getPollerPollDetails(@Parameter(in = ParameterIn.PATH, description = "The key assigned by the PollManager.", required=true, schema=@Schema()) @PathVariable("pollKey") String pollKey
) {
return getDelegate().getPollerPollDetails(pollKey);
}
@Operation(summary = "Get the list of recent polls as poller.", description = "Get the list of recent polls as poller from the poll queue. if size and page are passed in use those arguments to limit return data.", security = {
@SecurityRequirement(name = "basicAuth") }, tags={ "poller-polls" })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "A pagable list has been returned.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = PollerPager.class))),
@ApiResponse(responseCode = "200", description = "The resulting error payload.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResult.class))) })
@RequestMapping(value = "/polls/poller",
produces = { "application/json" },
method = RequestMethod.GET)
default ResponseEntity getPollsAsPoller(@Parameter(in = ParameterIn.QUERY, description = "Size of the page to retrieve." ,schema=@Schema()) @Valid @RequestParam(value = "size", required = false) Integer size
, @Parameter(in = ParameterIn.QUERY, description = "Number of the page to retrieve." ,schema=@Schema()) @Valid @RequestParam(value = "page", required = false) Integer page
) {
return getDelegate().getPollsAsPoller(size, page);
}
@Operation(summary = "Get the list of recent voter only polls.", description = "Get the list of recent polls as voter from the poll queue. if size and page are passed in use those arguments to limit return data.", security = {
@SecurityRequirement(name = "basicAuth") }, tags={ "voter-polls" })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "A pagable list has been returned.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = VoterPager.class))),
@ApiResponse(responseCode = "200", description = "The resulting error payload.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResult.class))) })
@RequestMapping(value = "/polls/voter",
produces = { "application/json" },
method = RequestMethod.GET)
default ResponseEntity getPollsAsVoter(@Parameter(in = ParameterIn.QUERY, description = "Size of the page to retrieve." ,schema=@Schema()) @Valid @RequestParam(value = "size", required = false) Integer size
, @Parameter(in = ParameterIn.QUERY, description = "Number of the page to retrieve." ,schema=@Schema()) @Valid @RequestParam(value = "page", required = false) Integer page
) {
return getDelegate().getPollsAsVoter(size, page);
}
@Operation(summary = "Poll Repairs", description = "Return the repair status for a specific poll.", security = {
@SecurityRequirement(name = "basicAuth") }, tags={ "poll-detail" })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "A pagable list of repair queue elements.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = RepairPager.class))),
@ApiResponse(responseCode = "200", description = "The resulting error payload.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResult.class))) })
@RequestMapping(value = "/polls/{pollKey}/repairs",
produces = { "application/json" },
method = RequestMethod.GET)
default ResponseEntity getRepairQueueData(@Parameter(in = ParameterIn.PATH, description = "The pollKey as listed in the PollDetail object.", required=true, schema=@Schema()) @PathVariable("pollKey") String pollKey
, @NotNull @Parameter(in = ParameterIn.QUERY, description = "The repair queue elements to return." ,required=true,schema=@Schema(allowableValues={ "pending", "active", "completed" }
)) @Valid @RequestParam(value = "repair", required = true) String repair
, @Parameter(in = ParameterIn.QUERY, description = "The page number." ,schema=@Schema()) @Valid @RequestParam(value = "page", required = false) Integer page
, @Parameter(in = ParameterIn.QUERY, description = "The size of the page." ,schema=@Schema()) @Valid @RequestParam(value = "size", required = false) Integer size
) {
return getDelegate().getRepairQueueData(pollKey, repair, page, size);
}
@Operation(summary = "Page Tally", description = "Return the vote tallies for a specific poll.", security = {
@SecurityRequirement(name = "basicAuth") }, tags={ "poll-detail" })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "A pagable list of urls for given tally type.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = UrlPager.class))),
@ApiResponse(responseCode = "200", description = "The resulting error payload.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResult.class))) })
@RequestMapping(value = "/polls/{pollKey}/tallies",
produces = { "application/json" },
method = RequestMethod.GET)
default ResponseEntity getTallyUrls(@Parameter(in = ParameterIn.PATH, description = "The pollKey as listed in the PollDetail object.", required=true, schema=@Schema()) @PathVariable("pollKey") String pollKey
, @NotNull @Parameter(in = ParameterIn.QUERY, description = "The kind of tally element to return." ,required=true,schema=@Schema(allowableValues={ "agree", "disagree", "error", "noQuorum", "tooClose" }
)) @Valid @RequestParam(value = "tally", required = true) String tally
, @Parameter(in = ParameterIn.QUERY, description = "The page number." ,schema=@Schema()) @Valid @RequestParam(value = "page", required = false) Integer page
, @Parameter(in = ParameterIn.QUERY, description = "The size of the page." ,schema=@Schema()) @Valid @RequestParam(value = "size", required = false) Integer size
) {
return getDelegate().getTallyUrls(pollKey, tally, page, size);
}
@Operation(summary = "VoterDetails", description = "Return the detailed information about a poll.", security = {
@SecurityRequirement(name = "basicAuth") }, tags={ "voter-polls" })
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Detailed poll info returned.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = VoterDetail.class))),
@ApiResponse(responseCode = "200", description = "The resulting error payload.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResult.class))) })
@RequestMapping(value = "/polls/voter/{pollKey}",
produces = { "application/json" },
method = RequestMethod.GET)
default ResponseEntity getVoterPollDetails(@Parameter(in = ParameterIn.PATH, description = "The key assigned by the PollManager.", required=true, schema=@Schema()) @PathVariable("pollKey") String pollKey
) {
return getDelegate().getVoterPollDetails(pollKey);
}
}