Interface SpallocClient
public interface SpallocClient
An API for talking to the Spalloc service.
- Author:
- Donal Fellows
- See Also:
SpallocClientFactory
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
SpallocClient.Job
The services offered relating to a Spalloc job.static interface
SpallocClient.Machine
The services offered relating to a Spalloc machine.static class
SpallocClient.SpallocException
Exception caused by the server sending an error. -
Method Summary
Modifier and Type Method Description SpallocClient.Job
createJob(CreateJob createInstructions)
Create a job.Version
getVersion()
Get the server version ID.default List<SpallocClient.Job>
listJobs()
List the existing non-terminated jobs.List<SpallocClient.Job>
listJobs(boolean waitForChange)
List the existing non-terminated jobs.default Stream<SpallocClient.Job>
listJobsWithDeleted()
List the jobs, including the deleted ones.Stream<SpallocClient.Job>
listJobsWithDeleted(boolean waitForChange)
List the jobs, including the deleted ones.List<SpallocClient.Machine>
listMachines()
Get a list of all Spalloc machines.
-
Method Details
-
getVersion
Get the server version ID.- Returns:
- A version ID.
- Throws:
IOException
- If things go wrong.
-
listMachines
Get a list of all Spalloc machines.- Returns:
- The list of machines.
- Throws:
IOException
- If things go wrong.
-
listJobs
List the existing non-terminated jobs.- Parameters:
waitForChange
- Iftrue
, 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
List the jobs, including the deleted ones.NB: Care should be taken; this may produce a lot of output.
- Parameters:
waitForChange
- Iftrue
, 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
List the existing non-terminated jobs.- Returns:
- A list of jobs.
- Throws:
IOException
- If things go wrong.
-
listJobsWithDeleted
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
Create a job.- Parameters:
createInstructions
- Describes the job to create.- Returns:
- A handle to the created job.
- Throws:
IOException
- If job creation fails.
-