From b26c489fc464599d312f32b3977f7428a21d3db0 Mon Sep 17 00:00:00 2001 From: tbeerbower Date: Mon, 15 Jul 2013 14:54:47 -0400 Subject: AMBARI-2485 - API: Document task resource status values --- ambari-server/docs/api/v1/index.md | 9 ++ ambari-server/docs/api/v1/request_resources.md | 45 ++++++++ ambari-server/docs/api/v1/requests.md | 90 ++++++++++++++++ ambari-server/docs/api/v1/task_resources.md | 139 +++++++++++++++++++++++++ ambari-server/docs/api/v1/tasks.md | 92 ++++++++++++++++ 5 files changed, 375 insertions(+) create mode 100644 ambari-server/docs/api/v1/request_resources.md create mode 100644 ambari-server/docs/api/v1/requests.md create mode 100644 ambari-server/docs/api/v1/task_resources.md create mode 100644 ambari-server/docs/api/v1/tasks.md (limited to 'ambari-server/docs') diff --git a/ambari-server/docs/api/v1/index.md b/ambari-server/docs/api/v1/index.md index d843b703fa..de2de5818c 100644 --- a/ambari-server/docs/api/v1/index.md +++ b/ambari-server/docs/api/v1/index.md @@ -295,6 +295,15 @@ Configuration resources are sets of key/value pairs that configure the services [Configuration Resource Overview](configuration.md) +#### requests +Request resources are groups of tasks that were created to carry out an instruction. + +[Request Resources](request-resources.md) + +#### tasks +Task resources are the individual tasks that make up a request resource. + +[Task Resources](task-resources.md) #### workflows Workflow resources are DAGs of MapReduce jobs in a Hadoop cluster. diff --git a/ambari-server/docs/api/v1/request_resources.md b/ambari-server/docs/api/v1/request_resources.md new file mode 100644 index 0000000000..0618214332 --- /dev/null +++ b/ambari-server/docs/api/v1/request_resources.md @@ -0,0 +1,45 @@ + + +# Request Resources + + +###API Summary + +- [List requests](requests.md) + +###Properties + + + + + + + + + + + + + + + + + + +
PropertyDescription
Requests/idThe request id
Requests/cluster_nameThe name of the parent cluster
Requests/request_contextThe context
+ diff --git a/ambari-server/docs/api/v1/requests.md b/ambari-server/docs/api/v1/requests.md new file mode 100644 index 0000000000..474ea856fd --- /dev/null +++ b/ambari-server/docs/api/v1/requests.md @@ -0,0 +1,90 @@ + + +List Requests +===== + +[Back to Resources](index.md#resources) + +**Summary** + +Returns a collection of all requests for the cluster identified by ":clusterName". + + GET /clusters/:clusterName/requests + +**Response** + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
HTTP CODEDescription
200OK
400Bad Request
401Unauthorized
403Forbidden
404Not Found
500Internal Server Error
+ + + +**Example** + +Get the collection of the requests for the cluster named "c1". + + GET /clusters/c1/requests?fields=Requests/request_context + + 200 OK + { + "href" : "http://your.ambari.server/api/v1/clusters/c1/requests?fields=Requests/request_context", + "items" : [ + { + "href" : "http://your.ambari.server/api/v1/clusters/c1/requests/1", + "Requests" : { + "cluster_name" : "c1", + "id" : 1, + "request_context" : "Install Services" + } + }, + { + "href" : "http://your.ambari.server/api/v1/clusters/c1/requests/2", + "Requests" : { + "cluster_name" : "c1", + "id" : 2, + "request_context" : "Start Services" + } + } + ] + } diff --git a/ambari-server/docs/api/v1/task_resources.md b/ambari-server/docs/api/v1/task_resources.md new file mode 100644 index 0000000000..ef22cfbffd --- /dev/null +++ b/ambari-server/docs/api/v1/task_resources.md @@ -0,0 +1,139 @@ + + +# Task Resources + + +###API Summary + +- [List tasks](tasks.md) + +###Properties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyDescription
Tasks/idThe task id
Tasks/request_idThe parent request id
Tasks/cluster_nameThe name of the parent cluster
Tasks/attempt_cntThe number of attempts at completing this task
Tasks/commandThe task command
Tasks/exit_codeThe exit code
Tasks/host_nameThe name of the host
Tasks/roleThe role
Tasks/stage_idThe stage id
Tasks/start_timeThe task start time
Tasks/statusThe task status
Tasks/stderrThe stderr from running the taks
Tasks/stdoutThe 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. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
StateDescription
PENDINGNot queued for a host.
QUEUEDQueued for a host.
IN_PROGRESSHost reported it is working.
COMPLETEDHost reported success.
FAILEDFailed.
TIMEDOUTHost did not respond in time.
ABORTEDOperation was abandoned.
+ diff --git a/ambari-server/docs/api/v1/tasks.md b/ambari-server/docs/api/v1/tasks.md new file mode 100644 index 0000000000..a06790f1d8 --- /dev/null +++ b/ambari-server/docs/api/v1/tasks.md @@ -0,0 +1,92 @@ + + +List Tasks +===== + +[Back to Resources](index.md#resources) + +**Summary** + +Returns a collection of all tasks for the request identified by ":requestId" and the cluster identified by ":clusterName". + + GET /clusters/:clusterName/requests/:requestId/tasks + +**Response** + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
HTTP CODEDescription
200OK
400Bad Request
401Unauthorized
403Forbidden
404Not Found
500Internal Server Error
+ + + +**Example** + +Get the collection of the tasks for the request 2 and the cluster named "c1". + + GET /clusters/c1/requests/2/tasks?fields=Tasks/status + + 200 OK + { + "href" : "http://your.ambari.server/api/v1/clusters/c1/requests/2/tasks?fields=Tasks/status", + "items" : [ + { + "href" : "http://your.ambari.server/api/v1/clusters/c1/requests/2/tasks/12", + "Tasks" : { + "cluster_name" : "c1", + "id" : 12, + "request_id" : 2, + "status" : "COMPLETED" + } + }, + { + "href" : "http://your.ambari.server/api/v1/clusters/c1/requests/2/tasks/13", + "Tasks" : { + "cluster_name" : "c1", + "id" : 13, + "request_id" : 2, + "status" : "IN_PROGRESS" + } + } + ] + } -- cgit v1.2.3