Interface SpallocServiceAPI
- All Known Implementing Classes:
SpallocServiceImpl
@Path("spalloc")
public interface SpallocServiceAPI
The REST API for the SpiNNaker machine allocation service.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceInterface to a particular job.static interfaceInterface to a particular machine. -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateJob(@NotNull @Valid CreateJobRequest req, jakarta.ws.rs.core.UriInfo ui, jakarta.ws.rs.core.SecurityContext security, jakarta.ws.rs.container.AsyncResponse response) Create a job.describeService(jakarta.ws.rs.core.UriInfo ui, jakarta.ws.rs.core.SecurityContext security, jakarta.servlet.http.HttpServletRequest request) Get a description of the overall service.voidemergencyStop(String commandCode, jakarta.ws.rs.container.AsyncResponse response) Immediately stop all jobs and power down all boards.getJob(@jakarta.validation.constraints.Positive(message="job ID must be positive") int id, jakarta.ws.rs.core.UriInfo ui, jakarta.servlet.http.HttpServletRequest request, jakarta.ws.rs.core.SecurityContext security) Get a sub-resource for managing a job.getMachine(@NotBlank(message="machine name must not be blank") String name, jakarta.ws.rs.core.UriInfo ui, jakarta.ws.rs.core.SecurityContext security) Get a sub-resource for managing a machine.getMachines(jakarta.ws.rs.core.UriInfo ui) Get a description of the machines.voidlistJobs(boolean wait, boolean destroyed, @jakarta.validation.constraints.Positive(message="limit must be at least 1") int limit, @jakarta.validation.constraints.PositiveOrZero(message="start must be at least 0") int start, jakarta.ws.rs.core.UriInfo ui, jakarta.ws.rs.container.AsyncResponse response) List jobs.
-
Method Details
-
describeService
@GET @Produces("application/json") @Path("") ServiceDescription describeService(@Context jakarta.ws.rs.core.UriInfo ui, @Context jakarta.ws.rs.core.SecurityContext security, @Context jakarta.servlet.http.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 jakarta.ws.rs.core.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 jakarta.ws.rs.core.UriInfo ui, @Context jakarta.ws.rs.core.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") @jakarta.validation.constraints.Positive(message="limit must be at least 1") int limit, @QueryParam("start") @DefaultValue("0") @PositiveOrZero(message="start must be at least 0") @jakarta.validation.constraints.PositiveOrZero(message="start must be at least 0") int start, @Context jakarta.ws.rs.core.UriInfo ui, @Suspended jakarta.ws.rs.container.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 jakarta.ws.rs.core.UriInfo ui, @Context jakarta.ws.rs.core.SecurityContext security, @Suspended jakarta.ws.rs.container.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") @jakarta.validation.constraints.Positive(message="job ID must be positive") int id, @Context jakarta.ws.rs.core.UriInfo ui, @Context jakarta.servlet.http.HttpServletRequest request, @Context jakarta.ws.rs.core.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
-
emergencyStop
@GET @Path("/emergencyStop") void emergencyStop(@QueryParam("commandCode") String commandCode, @Suspended jakarta.ws.rs.container.AsyncResponse response) Immediately stop all jobs and power down all boards.- Parameters:
commandCode-response-
-