Interface SpallocServiceAPI
- All Known Implementing Classes:
SpallocServiceImpl
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, UriInfo ui, SecurityContext security, AsyncResponse response) Create a job.describeService(UriInfo ui, SecurityContext security, HttpServletRequest request) Get a description of the overall service.voidemergencyStop(String commandCode, AsyncResponse response) Immediately stop all jobs and power down all boards.getJob(@jakarta.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.getMachine(@NotBlank(message="machine name must not be blank") String name, UriInfo ui, SecurityContext security) Get a sub-resource for managing a machine.getMachines(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, UriInfo ui, AsyncResponse response) List jobs.
-
Method Details
-
describeService
@GET @Produces("application/json") @Path("") 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") @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 UriInfo ui, @Suspended AsyncResponse response) List jobs.- Parameters:
wait- Whether we are waiting for a change with a long querydestroyed- Whether to include destroyed jobslimit- Paging support: how many values to bring backstart- Paging support: where in the sequence to startui- 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") @jakarta.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
-
emergencyStop
@GET @Path("/emergencyStop") void emergencyStop(@QueryParam("commandCode") String commandCode, @Suspended AsyncResponse response) Immediately stop all jobs and power down all boards.- Parameters:
commandCode-response-
-