layout: page title: Tasks Resource

This resource exposes endpoints to support operations at the tasks scope. The initial implementation includes the ability to list all the tasks for a particular job. This is a sub-resource of the Jobs Resource ยป and is not intended to be used independently.

Responses of individual endpoints will vary in accordance with their functionality and scope. However, the error messages of all of the tasks resource end points will be of the following form.

Error Message

Every error response will have the following structure:

{% highlight json %} { “message”: “Unrecognized status parameter: null” } {% endhighlight %} message is the only field in the response and contains a description of the problem.

Get All Tasks

Lists the complete details about all the tasks for a particular job

######Request GET /v1/jobs/{jobName}/{jobId}/tasks

######Response Status: 200 OK

{% highlight json %} [ { “preferredHost” : “samza-preferredHost”, “taskName” : “Samza task”, “containerId” : “0”, “partitions” : [{ “system” : “kafka”, “stream” : “topic-name”, “partitionId” : “0” }] } ] {% endhighlight %}

######Response codes

###Design ###Abstractions There are two primary abstractions that are required by the TasksResource that users can implement to handle any details specific to their environment.

  1. TaskProxy: This interface is the central point of interacting with Samza tasks. It exposes a method to get all the tasks of a Samza job.
  2. InstallationFinder: The InstallationFinder provides a generic interface to discover all the installed jobs, hiding any customizations in the job package structure and its location. The InstallationFinder also resolves the job configuration, which is used to validate and identify the job.

Configuration

The TasksResource properties should be specified in the same file as the Samza REST configuration.