Interface NMPIv3API
@Path("/") public interface NMPIv3API
The REST API for the NMPI Service.
-
Method Summary
Modifier and Type Method Description static NMPIv3API
createClient(String url)
Get a client for the API.SessionResponse
createSession(String apiKey, SessionRequest session)
Create a new session.Job
getJob(String apiKey, int jobId)
Get an NMPI Job.List<Project>
getProjects(String apiKey, String status, String collab)
Get a list of projects that match the parameters.void
setJobResources(String apiKey, int jobId, JobResourceUpdate resources)
Update the resources of a Job.void
setSessionStatusAndResources(String apiKey, int sessionId, SessionResourceUpdate resources)
Update a session.
-
Method Details
-
getJob
@GET @Path("jobs/{job_id}") @Produces("application/json") Job getJob(@HeaderParam("x-api-key") String apiKey, @PathParam("job_id") int jobId)Get an NMPI Job.- Parameters:
apiKey
- The API key to authenticate with.jobId
- The job id.- Returns:
- The job.
-
setJobResources
@PUT @Path("jobs/{job_id}") @Consumes("application/json") void setJobResources(@HeaderParam("x-api-key") String apiKey, @PathParam("job_id") int jobId, JobResourceUpdate resources)Update the resources of a Job.- Parameters:
apiKey
- The API key to authenticate with.jobId
- The job id.resources
- The resources to set.
-
getProjects
@GET @Path("projects/") @Produces("application/json") List<Project> getProjects(@HeaderParam("x-api-key") String apiKey, @QueryParam("status") String status, @QueryParam("collab") String collab)Get a list of projects that match the parameters.- Parameters:
apiKey
- The API key to authenticate with.status
- The status of the project to get.collab
- The name of the collab of the project.- Returns:
- A list of matching projects.
-
createSession
@POST @Path("sessions/") @Consumes("application/json") @Produces("application/json") SessionResponse createSession(@HeaderParam("x-api-key") String apiKey, SessionRequest session)Create a new session.- Parameters:
apiKey
- The API key to authenticate with.session
- The session details.- Returns:
- The created session details.
-
setSessionStatusAndResources
@PUT @Path("sessions/{session_id}") @Consumes("application/json") void setSessionStatusAndResources(@HeaderParam("x-api-key") String apiKey, @PathParam("session_id") int sessionId, SessionResourceUpdate resources)Update a session.- Parameters:
apiKey
- The API key to authenticate with.sessionId
- The identifier of the session.resources
- The resources to set.
-
createClient
Get a client for the API.- Parameters:
url
- The URL to connect to.- Returns:
- A proxy of the API.
-