task-resources.md 3.0 KB

Task Resources

###API Summary

###Properties

Property Description
Tasks/id The task id
Tasks/request_id The parent request id
Tasks/cluster_name The name of the parent cluster
Tasks/attempt_cnt The number of attempts at completing this task
Tasks/command The task command
Tasks/exit_code The exit code
Tasks/host_name The name of the host
Tasks/role The role
Tasks/stage_id The stage id
Tasks/start_time The task start time
Tasks/status The task status
Tasks/stderr The stderr from running the taks
Tasks/stdout The stdout from running the task

###Status

The current status of a task resource can be determined by looking at the Tasks/status property.

GET api/v1/clusters/c1/requests/2/tasks/12?fields=Tasks/status

200 OK
{
  "href" : "your.ambari.server/api/v1/clusters/c1/requests/2/tasks/12?fields=Tasks/status",
  "Tasks" : {
  "cluster_name" : "c1",
  "id" : 12,
  "request_id" : 2,
  "status" : "COMPLETED"
}

The following table lists the possible values of the task resource Tasks/status.

<th>State</th>
<th>Description</th>

<td>PENDING</td>
<td>Not queued for a host.</td>  

<td>QUEUED</td>
<td>Queued for a host.</td>  

<td>IN_PROGRESS</td>
<td>Host reported it is working.</td>  

<td>COMPLETED</td>
<td>Host reported success.</td>  

<td>FAILED</td>
<td>Failed.</td>  

<td>TIMEDOUT</td>
<td>Host did not respond in time.</td>  

<td>ABORTED</td>
<td>Operation was abandoned.</td>