Interface SpallocServiceAPI.JobAPI
- Enclosing interface:
- SpallocServiceAPI
@Path("jobs/{id}")
public static interface SpallocServiceAPI.JobAPI
Interface to a particular job.
- Author:
- Donal Fellows
-
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.Response
Delete the job, or at least mark it as destroyed.void
fastDataRead
(@uk.ac.manchester.spinnaker.machine.ValidX int gatherX, @uk.ac.manchester.spinnaker.machine.ValidY int gatherY, @uk.ac.manchester.spinnaker.machine.ValidX int ethX, @uk.ac.manchester.spinnaker.machine.ValidY int ethY, @IPAddress String ethAddress, int iptag, @uk.ac.manchester.spinnaker.machine.ValidX int x, @uk.ac.manchester.spinnaker.machine.ValidY int y, @uk.ac.manchester.spinnaker.machine.ValidP int p, long address, int size, jakarta.ws.rs.container.AsyncResponse response) Read data from job boards using the fast data download protocol.void
fastDataWrite
(@uk.ac.manchester.spinnaker.machine.ValidX int gatherX, @uk.ac.manchester.spinnaker.machine.ValidY int gatherY, @jakarta.validation.constraints.Positive int gatherP, @uk.ac.manchester.spinnaker.machine.ValidX int ethX, @uk.ac.manchester.spinnaker.machine.ValidY int ethY, @IPAddress String ethAddress, int iptag, @uk.ac.manchester.spinnaker.machine.ValidX int x, @uk.ac.manchester.spinnaker.machine.ValidY int y, long address, byte[] bytes, jakarta.ws.rs.container.AsyncResponse response) Write data to job boards using the fast data protocol.getJobChipLocation
(@uk.ac.manchester.spinnaker.machine.ValidX int x, @uk.ac.manchester.spinnaker.machine.ValidY int y) Get the location description of a board given the job-local coordinates of a chip on that board.Get a description of the (sub-)machine of the job.Get the current power state of the job's sub-machine.void
getState
(boolean wait, jakarta.ws.rs.container.AsyncResponse response) Describe the basic info about a job.Keep the job alive.void
prepareRoutingTables
(jakarta.ws.rs.core.UriInfo uriInfo, jakarta.ws.rs.container.AsyncResponse response) Clear routes, reset counters and install counting filters needed.void
readDataFromJob
(@uk.ac.manchester.spinnaker.machine.ValidX int x, @uk.ac.manchester.spinnaker.machine.ValidY int y, long address, int size, jakarta.ws.rs.container.AsyncResponse response) Read data from job boards.void
reportBoardIssue
(IssueReportRequest report, jakarta.ws.rs.container.AsyncResponse response) Report an issue with some boards.void
setMachinePower
(@NotNull @Valid MachinePower req, jakarta.ws.rs.container.AsyncResponse response) Set the power state of the job's sub-machine.void
writeDataToJob
(@uk.ac.manchester.spinnaker.machine.ValidX int x, @uk.ac.manchester.spinnaker.machine.ValidY int y, long address, byte[] bytes, jakarta.ws.rs.container.AsyncResponse response) Write data to job boards.
-
Method Details
-
getState
@GET @Path("/") @Produces("application/json") void getState(@QueryParam("wait") @DefaultValue("false") boolean wait, @Suspended jakarta.ws.rs.container.AsyncResponse response) Describe the basic info about a job.- Parameters:
wait
- Whether to wait for a change.response
- Filled out with aJobStateResponse
.
-
keepAlive
@PUT @Path("keepalive") @Consumes("text/plain") @Produces("text/plain") String keepAlive(String req) Keep the job alive.- Parameters:
req
- Arbitrary ignored text- Returns:
- A constant response
-
deleteJob
@DELETE @Path("/") @Produces("application/json") jakarta.ws.rs.core.Response deleteJob(@QueryParam("reason") @DefaultValue("") String reason) Delete the job, or at least mark it as destroyed.- Parameters:
reason
- Why the job is destroyed- Returns:
- No content
-
getMachine
Get a description of the (sub-)machine of the job.- Returns:
- An allocated sub-machine description
-
getMachinePower
Get the current power state of the job's sub-machine.- Returns:
- A power descriptor
-
setMachinePower
@POST @Path("machine/power") @Consumes("application/json") @Produces("application/json") void setMachinePower(@NotNull @Valid @NotNull @Valid MachinePower req, @Suspended jakarta.ws.rs.container.AsyncResponse response) Set the power state of the job's sub-machine. Note that the actual change may (will!) take time to process.- Parameters:
req
- What to change to.response
- Filled out with aMachinePower
.
-
getJobChipLocation
@GET @Path("chip") @Produces("application/json") WhereIsResponse getJobChipLocation(@QueryParam("x") @DefaultValue("0") @ValidX @uk.ac.manchester.spinnaker.machine.ValidX int x, @QueryParam("y") @DefaultValue("0") @ValidY @uk.ac.manchester.spinnaker.machine.ValidY int y) Get the location description of a board given the job-local coordinates of a chip on that board.- Parameters:
x
- Chip X coordinatey
- Chip Y coordinate- Returns:
- A board location description
-
reportBoardIssue
@POST @Path("report-issue") @Consumes("application/json") @Produces("application/json") void reportBoardIssue(IssueReportRequest report, @Suspended jakarta.ws.rs.container.AsyncResponse response) Report an issue with some boards.- Parameters:
report
- The problem description.response
- Filled out with anIssueReportResponse
.
-
writeDataToJob
@POST @Path("memory") @Consumes("application/octet-stream") void writeDataToJob(@QueryParam("x") @DefaultValue("0") @ValidX @uk.ac.manchester.spinnaker.machine.ValidX int x, @QueryParam("y") @DefaultValue("0") @ValidY @uk.ac.manchester.spinnaker.machine.ValidY int y, @QueryParam("address") long address, byte[] bytes, @Suspended jakarta.ws.rs.container.AsyncResponse response) Write data to job boards.- Parameters:
x
- Chip X coordinatey
- Chip Y coordinateaddress
- Address to write tobytes
- Data to writeresponse
- Eventual response once request is complete
-
readDataFromJob
@GET @Path("memory") @Produces("application/octet-stream") void readDataFromJob(@QueryParam("x") @DefaultValue("0") @ValidX @uk.ac.manchester.spinnaker.machine.ValidX int x, @QueryParam("y") @DefaultValue("0") @ValidY @uk.ac.manchester.spinnaker.machine.ValidY int y, @QueryParam("address") long address, @QueryParam("size") int size, @Suspended jakarta.ws.rs.container.AsyncResponse response) Read data from job boards.- Parameters:
x
- Chip X coordinatey
- Chip Y coordinateaddress
- Address to read fromsize
- Number of bytes to readresponse
- Filled out with bytes read.
-
fastDataWrite
@POST @Path("fast-data-write") @Consumes("application/octet-stream") void fastDataWrite(@QueryParam("gather_x") @ValidX @uk.ac.manchester.spinnaker.machine.ValidX int gatherX, @QueryParam("gather_y") @ValidY @uk.ac.manchester.spinnaker.machine.ValidY int gatherY, @QueryParam("gather_p") @Positive @jakarta.validation.constraints.Positive int gatherP, @QueryParam("eth_x") @DefaultValue("0") @ValidX @uk.ac.manchester.spinnaker.machine.ValidX int ethX, @QueryParam("eth_y") @DefaultValue("0") @ValidY @uk.ac.manchester.spinnaker.machine.ValidY int ethY, @QueryParam("eth_address") @IPAddress @IPAddress String ethAddress, @QueryParam("iptag") int iptag, @QueryParam("x") @DefaultValue("0") @ValidX @uk.ac.manchester.spinnaker.machine.ValidX int x, @QueryParam("y") @DefaultValue("0") @ValidY @uk.ac.manchester.spinnaker.machine.ValidY int y, @QueryParam("address") long address, byte[] bytes, @Suspended jakarta.ws.rs.container.AsyncResponse response) Write data to job boards using the fast data protocol. Note: it is assumed that the board has been set up before this is called.- Parameters:
gatherX
- X coordinate of the gather coregatherY
- Y coordinate of the gather coregatherP
- Processor ID of the gather coreethX
- X coordinate of the Ethernet chip of x, yethY
- Y coordinate of the Ethernet chip of x, yethAddress
- The Ethernet address of the Ethernet chipiptag
- The IPTag to use for the writex
- The X coordinate of the chip within the job's allocation.y
- The Y coordinate of the chip within the job's allocation.address
- The address to write the data to.bytes
- The data to write.response
- Eventual response once request is complete
-
fastDataRead
@GET @Path("fast-data-read") @Produces("application/octet-stream") void fastDataRead(@QueryParam("gather_x") @ValidX @uk.ac.manchester.spinnaker.machine.ValidX int gatherX, @QueryParam("gather_y") @ValidY @uk.ac.manchester.spinnaker.machine.ValidY int gatherY, @QueryParam("eth_x") @DefaultValue("0") @ValidX @uk.ac.manchester.spinnaker.machine.ValidX int ethX, @QueryParam("eth_y") @DefaultValue("0") @ValidY @uk.ac.manchester.spinnaker.machine.ValidY int ethY, @QueryParam("eth_address") @IPAddress @IPAddress String ethAddress, @QueryParam("iptag") int iptag, @QueryParam("x") @DefaultValue("0") @ValidX @uk.ac.manchester.spinnaker.machine.ValidX int x, @QueryParam("y") @DefaultValue("0") @ValidY @uk.ac.manchester.spinnaker.machine.ValidY int y, @QueryParam("p") @DefaultValue("0") @ValidP @uk.ac.manchester.spinnaker.machine.ValidP int p, @QueryParam("address") long address, @QueryParam("size") int size, @Suspended jakarta.ws.rs.container.AsyncResponse response) Read data from job boards using the fast data download protocol. Note: it is assumed that the board has been set up before this is called.- Parameters:
gatherX
- X coordinate of the gather coregatherY
- Y coordinate of the gather coreethX
- X coordinate of the Ethernet chip of x, yethY
- Y coordinate of the Ethernet chip of x, yethAddress
- The Ethernet address of the Ethernet chipiptag
- The IPTag to use for the writex
- Chip X coordinatey
- Chip Y coordinatep
- Core processoraddress
- Address to read fromsize
- Number of bytes to readresponse
- Filled out with bytes read.
-
prepareRoutingTables
@DELETE @Path("/router") void prepareRoutingTables(@Context jakarta.ws.rs.core.UriInfo uriInfo, @Suspended jakarta.ws.rs.container.AsyncResponse response) Clear routes, reset counters and install counting filters needed.- Parameters:
uriInfo
- The info containing the query parameters of the request, to include filters to be set as n=value where n is the index of the filter to be set and value is the integer word made of the combined flags of the filter.response
- The response to answer with
-