org.apache.nutch.service.resources

## Class JobResource

- java.lang.Object
- - org.apache.nutch.service.resources.AbstractResource
  - - org.apache.nutch.service.resources.JobResource

-     @Path(value="/job")
      public class JobResource
      extends AbstractResource

- - ### Field Summary

    - ### Fields inherited from class org.apache.nutch.service.resources.AbstractResource

      `configManager, jobManager, server`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JobResource()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `abort(java.lang.String id, java.lang.String crawlId)`
    `JobInfo` | `create(JobConfig config)` Create a new job
    `JobInfo` | `getInfo(java.lang.String id, java.lang.String crawlId)` Get job info
    `java.util.Collection<JobInfo>` | `getJobs(java.lang.String crawlId)` Get job history
    `boolean` | `stop(java.lang.String id, java.lang.String crawlId)` Stop Job

    - ### Methods inherited from class org.apache.nutch.service.resources.AbstractResource

      `throwBadRequestException`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JobResource

          public JobResource()

  - ### Method Detail

    - #### getJobs

          @GET
           @Path(value="/")
          public java.util.Collection<JobInfo> getJobs(@QueryParam(value="crawlId")
                                                                              java.lang.String crawlId)

      Get job history
      Parameters:
        `crawlId` -
      Returns:
        A nested JSON object of all the jobs created

    - #### getInfo

          @GET
           @Path(value="/{id}")
          public JobInfo getInfo(@PathParam(value="id")
                                                            java.lang.String id,
                                                            @QueryParam(value="crawlId")
                                                            java.lang.String crawlId)

      Get job info
      Parameters:
        `id` - Job ID
        `crawlId` - Crawl ID
      Returns:
        A JSON object of job parameters

    - #### stop

          @GET
           @Path(value="/{id}/stop")
          public boolean stop(@PathParam(value="id")
                                                              java.lang.String id,
                                                              @QueryParam(value="crawlId")
                                                              java.lang.String crawlId)

      Stop Job
      Parameters:
        `id` - Job ID
        `crawlId` -
      Returns:

    - #### abort

          @GET
           @Path(value="/{id}/abort")
          public boolean abort(@PathParam(value="id")
                                                                java.lang.String id,
                                                                @QueryParam(value="crawlId")
                                                                java.lang.String crawlId)

    - #### create

          @POST
           @Path(value="/create")
           @Consumes(value="application/json")
          public JobInfo create(JobConfig config)

      Create a new job
      Parameters:
        `config` - The parameters of the job to create
      Returns:
        A JSON object of the job created with its details

Copyright © 2019 The Apache Software Foundation