@Singleton
@Path(value="/v1/jobs")
public class JobsResource
extends java.lang.Object
Constructor and Description |
---|
JobsResource(JobsResourceConfig config)
Initializes a JobResource with
JobProxy from the
JobProxyFactory class specified in the configuration. |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
getInstalledJobs()
Gets the
Job for all the jobs installed on this host. |
javax.ws.rs.core.Response |
getJob(java.lang.String jobName,
java.lang.String jobId)
Gets the
Job for the job instance specified by jobName and jobId if
it is installed on this host. |
javax.ws.rs.core.Response |
updateJobStatus(java.lang.String jobName,
java.lang.String jobId,
java.lang.String status) |
public JobsResource(JobsResourceConfig config)
JobProxy
from the
JobProxyFactory
class specified in the configuration.config
- the configuration containing the JobProxyFactory
class.@GET @Produces(value="application/json") public javax.ws.rs.core.Response getInstalledJobs()
Job
for all the jobs installed on this host.Response.Status.OK
Response
containing a list of
Job
for all the installed Samza jobs installed on this host.@GET @Path(value="/{jobName}/{jobId}") @Produces(value="application/json") public javax.ws.rs.core.Response getJob(@PathParam(value="jobName") java.lang.String jobName, @PathParam(value="jobId") java.lang.String jobId)
Job
for the job instance specified by jobName and jobId if
it is installed on this host.jobName
- the name of the job as configured in JobConfig.JOB_NAME()
.jobId
- the id of the job as configured in JobConfig.JOB_ID()
.Response.Status.OK
Response
containing a Job
for the Samza job if it is
installed on this host. Response.Status.NOT_FOUND
and
Response.Status.INTERNAL_SERVER_ERROR
can occur for corresponding errors.@PUT @Path(value="/{jobName}/{jobId}") @Produces(value="application/json") public javax.ws.rs.core.Response updateJobStatus(@PathParam(value="jobName") java.lang.String jobName, @PathParam(value="jobId") java.lang.String jobId, @QueryParam(value="status") java.lang.String status)
jobName
- the name of the job as configured in JobConfig.JOB_NAME()
.jobId
- the id of the job as configured in JobConfig.JOB_ID()
.status
- the JobStatus
to which the job will transition.Response.Status.ACCEPTED
Response
containing a Job
for the Samza job if it is
installed on this host. Response.Status.NOT_FOUND
Response.Status.BAD_REQUEST
and
Response.Status.INTERNAL_SERVER_ERROR
can occur for corresponding errors.