Interface SpallocClient


public interface SpallocClient
An API for talking to the Spalloc service.
Author:
Donal Fellows
See Also:
  • Method Details

    • getVersion

      Version getVersion() throws IOException
      Get the server version ID.
      Returns:
      A version ID.
      Throws:
      IOException - If things go wrong.
    • listMachines

      List<SpallocClient.Machine> listMachines() throws IOException
      Get a list of all Spalloc machines.
      Returns:
      The list of machines.
      Throws:
      IOException - If things go wrong.
    • listJobs

      List<SpallocClient.Job> listJobs(boolean waitForChange) throws IOException
      List the existing non-terminated jobs.
      Parameters:
      waitForChange - If true, will wait until the list of jobs may have changed. (Best-effort only; waiting time is bounded at 30 seconds.)
      Returns:
      A list of jobs.
      Throws:
      IOException - If things go wrong.
    • listJobsWithDeleted

      Stream<SpallocClient.Job> listJobsWithDeleted(boolean waitForChange) throws IOException
      List the jobs, including the deleted ones.

      NB: Care should be taken; this may produce a lot of output.

      Parameters:
      waitForChange - If true, will wait until the list of jobs may have changed. (Best-effort only; waiting time is bounded at 30 seconds.)
      Returns:
      A stream of jobs.
      Throws:
      IOException - If things go wrong.
    • listJobs

      default List<SpallocClient.Job> listJobs() throws IOException
      List the existing non-terminated jobs.
      Returns:
      A list of jobs.
      Throws:
      IOException - If things go wrong.
    • listJobsWithDeleted

      default Stream<SpallocClient.Job> listJobsWithDeleted() throws IOException
      List the jobs, including the deleted ones.

      NB: Care should be taken; this may produce a lot of output.

      Returns:
      A stream of jobs.
      Throws:
      IOException - If things go wrong.
    • createJob

      SpallocClient.Job createJob(CreateJob createInstructions) throws IOException
      Create a job.
      Parameters:
      createInstructions - Describes the job to create.
      Returns:
      A handle to the created job.
      Throws:
      IOException - If job creation fails.