Interface NMPIQueue
public interface NMPIQueue
The REST API for the HBP Neuromorphic Platform Interface queue.
-
Method Summary
Modifier and TypeMethodDescriptionstatic NMPIQueuecreateClient(String url) Get a client for the API.static com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProviderCreate a JSON provider capable of handling the messages on the NMPI queue.voidSet a job when done.Gets all jobs in the queue.getNextJob(String apiKey, String hardware) Get the next queue item for a specific hardware system.voidupdateJobLog(String apiKey, int id, JobLogOnly log) Update the log of a job.voidupdateJobStatus(String apiKey, int id, JobStatusOnly status) Update the status of a job.
-
Method Details
-
getJobs
@GET @Path("jobs/") @Produces("application/json") List<QueueJobCompat> getJobs(@HeaderParam("x-api-key") String apiKey, @QueryParam("hardware") String hardware, @QueryParam("status") List<String> status) Gets all jobs in the queue.- Parameters:
apiKey- The API key to use.hardware- The hardware to request the jobs for.status- List of accepted statuses.- Returns:
- The list of jobs that meet the criteria.
-
getNextJob
@GET @Path("jobs/next/{hardware}") @Produces("application/json") QueueNextResponse getNextJob(@HeaderParam("x-api-key") String apiKey, @PathParam("hardware") String hardware) Get the next queue item for a specific hardware system.- Parameters:
apiKey- The API key to use.hardware- The hardware ID.- Returns:
- The queue item.
-
updateJobLog
@PUT @Path("jobs/{id}") @Consumes("application/json") void updateJobLog(@HeaderParam("x-api-key") String apiKey, @PathParam("id") int id, JobLogOnly log) Update the log of a job.- Parameters:
apiKey- The API key to use.id- The queue IDlog- the Job Log.
-
updateJobStatus
@PUT @Path("jobs/{id}") @Consumes("application/json") void updateJobStatus(@HeaderParam("x-api-key") String apiKey, @PathParam("id") int id, JobStatusOnly status) Update the status of a job.- Parameters:
apiKey- The API key to use.id- The queue IDstatus- the Job Status.
-
finishJob
@PUT @Path("jobs/{id}") @Consumes("application/json") void finishJob(@HeaderParam("x-api-key") String apiKey, @PathParam("id") int id, JobDone job) Set a job when done.- Parameters:
apiKey- The API key to use.id- The queue IDjob- The details to update
-
createClient
Get a client for the API.- Parameters:
url- The URL to connect to.- Returns:
- A proxy of the API.
-
createProvider
static com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider createProvider()Create a JSON provider capable of handling the messages on the NMPI queue.- Returns:
- The provider.
-