Interface SpallocServiceAPI
- All Known Implementing Classes:
SpallocServiceImpl
public interface SpallocServiceAPI
The REST API for the SpiNNaker machine allocation service.
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
SpallocServiceAPI.JobAPI
Interface to a particular job.static interface
SpallocServiceAPI.MachineAPI
Interface to a particular machine. -
Method Summary
Modifier and Type Method Description void
createJob(@NotNull @Valid CreateJobRequest req, UriInfo ui, SecurityContext security, AsyncResponse response)
Create a job.ServiceDescription
describeService(UriInfo ui, SecurityContext security, HttpServletRequest request)
Get a description of the overall service.SpallocServiceAPI.JobAPI
getJob(@javax.validation.constraints.Positive(message="job ID must be positive") int id, UriInfo ui, HttpServletRequest request, SecurityContext security)
Get a sub-resource for managing a job.SpallocServiceAPI.MachineAPI
getMachine(@NotBlank(message="machine name must not be blank") String name, UriInfo ui, SecurityContext security)
Get a sub-resource for managing a machine.MachinesResponse
getMachines(UriInfo ui)
Get a description of the machines.void
listJobs(boolean wait, boolean destroyed, @javax.validation.constraints.Positive(message="limit must be at least 1") int limit, @javax.validation.constraints.PositiveOrZero(message="start must be at least 0") int start, UriInfo ui, AsyncResponse response)
List jobs.
-
Method Details
-
describeService
@GET @Produces("application/json") ServiceDescription describeService(@Context UriInfo ui, @Context SecurityContext security, @Context HttpServletRequest request)Get a description of the overall service.- Parameters:
ui
- How to build URIssecurity
- What are the user's identity and granted permissions?request
- Details about the request, used to extract the CSRF token.- Returns:
- A wrapped
ServiceDescription
-
getMachines
@GET @Path("machines") @Produces("application/json") @PreAuthorize("hasRole(\'READER\')") MachinesResponse getMachines(@Context UriInfo ui)Get a description of the machines.- Parameters:
ui
- How to build URIs- Returns:
- A list of machines
-
getMachine
@Path("machines/{name}") @PreAuthorize("hasRole(\'READER\')") SpallocServiceAPI.MachineAPI getMachine(@PathParam("name") @NotBlank(message="machine name must not be blank") @NotBlank(message="machine name must not be blank") String name, @Context UriInfo ui, @Context SecurityContext security)Get a sub-resource for managing a machine.- Parameters:
name
- The name of the machineui
- How to build URIssecurity
- What are the user's identity and granted permissions?- Returns:
- The sub-resource
-
listJobs
@GET @Path("jobs") @Produces("application/json") @PreAuthorize("hasRole(\'READER\')") void listJobs(@QueryParam("wait") @DefaultValue("false") boolean wait, @QueryParam("deleted") @DefaultValue("false") boolean destroyed, @QueryParam("limit") @DefaultValue("100") @Positive(message="limit must be at least 1") @javax.validation.constraints.Positive(message="limit must be at least 1") int limit, @QueryParam("start") @DefaultValue("0") @PositiveOrZero(message="start must be at least 0") @javax.validation.constraints.PositiveOrZero(message="start must be at least 0") int start, @Context UriInfo ui, @Suspended AsyncResponse response)List jobs.- Parameters:
wait
- Whether we are waiting for a change with a long querylimit
- Paging support: how many values to bring backstart
- Paging support: where in the sequence to startdestroyed
- Whether to include destroyed jobsui
- How to build URIsresponse
- Filled out with aListJobsResponse
-
createJob
@POST @Path("jobs") @Consumes("application/json") @Produces("application/json") @PreAuthorize("hasRole(\'USER\')") void createJob(@NotNull @Valid @NotNull @Valid CreateJobRequest req, @Context UriInfo ui, @Context SecurityContext security, @Suspended AsyncResponse response)Create a job.- Parameters:
req
- Description of what to createui
- How to build URIssecurity
- Information about the userresponse
- Filled out with aCreateJobResponse
-
getJob
@Path("jobs/{id}") @Produces("application/json") @PreAuthorize("hasRole(\'USER\')") SpallocServiceAPI.JobAPI getJob(@PathParam("id") @Positive(message="job ID must be positive") @javax.validation.constraints.Positive(message="job ID must be positive") int id, @Context UriInfo ui, @Context HttpServletRequest request, @Context SecurityContext security)Get a sub-resource for managing a job.- Parameters:
id
- The ID of the jobui
- How to build URIsrequest
- Information about the requestsecurity
- Information about the user- Returns:
- The sub-resource
-