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 Type Method Description
    Response deleteJob​(String reason)
    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, 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, @javax.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, AsyncResponse response)
    Write data to job boards using the fast data protocol.
    WhereIsResponse 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.
    SubMachineResponse getMachine()
    Get a description of the (sub-)machine of the job.
    MachinePower getMachinePower()
    Get the current power state of the job's sub-machine.
    void getState​(boolean wait, AsyncResponse response)
    Describe the basic info about a job.
    String keepAlive​(String req)
    Keep the job alive.
    void prepareRoutingTables​(UriInfo uriInfo, 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, AsyncResponse response)
    Read data from job boards.
    void reportBoardIssue​(IssueReportRequest report, AsyncResponse response)
    Report an issue with some boards.
    void setMachinePower​(@NotNull @Valid MachinePower req, 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, AsyncResponse response)
    Write data to job boards.
  • Method Details

    • getState

      @GET @Path("/") @Produces("application/json") void getState​(@QueryParam("wait") @DefaultValue("false") boolean wait, @Suspended AsyncResponse response)
      Describe the basic info about a job.
      Parameters:
      wait - Whether to wait for a change.
      response - Filled out with a JobStateResponse.
    • 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") 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 @Path("machine") @Produces("application/json") SubMachineResponse getMachine()
      Get a description of the (sub-)machine of the job.
      Returns:
      An allocated sub-machine description
    • getMachinePower

      @GET @Path("machine/power") @Produces("application/json") MachinePower 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 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 a MachinePower.
    • 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 coordinate
      y - Chip Y coordinate
      Returns:
      A board location description
    • reportBoardIssue

      @POST @Path("report-issue") @Consumes("application/json") @Produces("application/json") void reportBoardIssue​(IssueReportRequest report, @Suspended AsyncResponse response)
      Report an issue with some boards.
      Parameters:
      report - The problem description.
      response - Filled out with an IssueReportResponse.
    • 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 AsyncResponse response)
      Write data to job boards.
      Parameters:
      x - Chip X coordinate
      y - Chip Y coordinate
      address - Address to write to
      bytes - Data to write
      response - 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 AsyncResponse response)
      Read data from job boards.
      Parameters:
      x - Chip X coordinate
      y - Chip Y coordinate
      address - Address to read from
      size - Number of bytes to read
      response - 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 @javax.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 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 core
      gatherY - Y coordinate of the gather core
      gatherP - Processor ID of the gather core
      ethX - X coordinate of the Ethernet chip of x, y
      ethY - Y coordinate of the Ethernet chip of x, y
      ethAddress - The Ethernet address of the Ethernet chip
      iptag - The IPTag to use for the write
      x - 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 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 core
      gatherY - Y coordinate of the gather core
      ethX - X coordinate of the Ethernet chip of x, y
      ethY - Y coordinate of the Ethernet chip of x, y
      ethAddress - The Ethernet address of the Ethernet chip
      iptag - The IPTag to use for the write
      x - Chip X coordinate
      y - Chip Y coordinate
      p - Core processor
      address - Address to read from
      size - Number of bytes to read
      response - Filled out with bytes read.
    • prepareRoutingTables

      @DELETE @Path("/router") void prepareRoutingTables​(@Context UriInfo uriInfo, @Suspended 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