<a href="../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduce_Compatibility_Hadoop1_Hadoop2.html">Compatibilty between Hadoop 1.x and Hadoop 2.x</a>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img alt="Built by Maven" src="./images/logos/maven-feather.png"/>
</a>
</div>
</div>
<div id="bodyColumn">
<div id="contentBox">
<!-- Licensed under the Apache License, Version 2.0 (the "License"); --><!-- you may not use this file except in compliance with the License. --><!-- You may obtain a copy of the License at --><!-- --><!-- http://www.apache.org/licenses/LICENSE-2.0 --><!-- --><!-- Unless required by applicable law or agreed to in writing, software --><!-- distributed under the License is distributed on an "AS IS" BASIS, --><!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --><!-- See the License for the specific language governing permissions and --><!-- limitations under the License. See accompanying LICENSE file. --><div class="section">
<h2>History Server REST API's.<a name="History_Server_REST_APIs."></a></h2>
<p>[ <a href="./index.html">Go Back</a> ]</p>
<ul>
<li><a href="#History_Server_REST_APIs.">History Server REST API's.</a>
<ul>
<li><a href="#Overview">Overview</a></li>
<li><a href="#History_Server_Information_API">History Server Information API</a>
<p>The history server REST API's allow the user to get status on finished applications. Currently it only supports MapReduce and provides information on finished jobs.</p></div>
<div class="section">
<h3>History Server Information API<a name="History_Server_Information_API"></a></h3>
<p>The history server information resource provides overall information about the history server. </p>
<div class="section">
<h4>URI<a name="URI"></a></h4>
<p>Both of the following URI's give you the history server information, from an application id identified by the appid value. </p>
<div>
<pre> * http://<history server http address:port>/ws/v1/history
* http://<history server http address:port>/ws/v1/history/info</pre></div></div>
<p>Multiple paramters can be specified. The started and finished times have a begin and end parameter to allow you to specify ranges. For example, one could request all jobs that started between 1:00am and 2:00pm on 12/19/2011 with startedTimeBegin=1324256400&startedTimeEnd=1324303200. If the Begin parameter is not specfied, it defaults to 0, and if the End parameter is not specified, it defaults to infinity.</p>
<div>
<pre> * user - user name
* state - the job state
* queue - queue name
* limit - total number of app objects to be returned
* startedTimeBegin - jobs with start time beginning with this time, specified in ms since epoch
* startedTimeEnd - jobs with start time ending with this time, specified in ms since epoch
* finishedTimeBegin - jobs with finish time beginning with this time, specified in ms since epoch
* finishedTimeEnd - jobs with finish time ending with this time, specified in ms since epoch</pre></div></div>
<div class="section">
<h5>Elements of the <i>jobs</i> object<a name="Elements_of_the_jobs_object"></a></h5>
<p>When you make a request for the list of jobs, the information will be returned as an array of job objects. See also <a href="#Job_API">Job API</a> for syntax of the job object. Except this is a subset of a full job. Only startTime, finishTime, id, name, queue, user, state, mapsTotal, mapsCompleted, reducesTotal, and reducesCompleted are returned.</p>
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">Item</th>
<th align="left">Data Type</th>
<th align="left">Description</th></tr>
<tr class="b">
<td align="left">job</td>
<td align="left">array of job objects(json)/zero or more job objects(XML)</td>
<td align="left">The collection of job objects</td></tr></table></div>
<p>With the job attempts API, you can obtain a collection of resources that represent a job attempt. When you run a GET operation on this resource, you obtain a collection of Job Attempt Objects. </p>
<div class="section">
<h5>URI<a name="URI"></a></h5>
<div>
<pre> * http://<history server http address:port>/ws/v1/history/mapreduce/jobs/{jobid}/jobattempts</pre></div></div>
<h5>Elements of the <i>conf</i> object<a name="Elements_of_the_conf_object"></a></h5>
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">Item</th>
<th align="left">Data Type</th>
<th align="left">Description</th></tr>
<tr class="b">
<td align="left">path</td>
<td align="left">string</td>
<td align="left">The path to the job configuration file</td></tr>
<tr class="a">
<td align="left">property</td>
<td align="left">array of the configuration properties(JSON)/zero or more configuration properties(XML)</td>
<td align="left">Collection of configuration property objects</td></tr></table></div>
<div class="section">
<h5>Elements of the <i>property</i> object<a name="Elements_of_the_property_object"></a></h5>
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">Item</th>
<th align="left">Data Type</th>
<th align="left">Description</th></tr>
<tr class="b">
<td align="left">name</td>
<td align="left">string</td>
<td align="left">The name of the configuration property</td></tr>
<tr class="a">
<td align="left">value</td>
<td align="left">string</td>
<td align="left">The value of the configuration property</td></tr>
<tr class="b">
<td align="left">source</td>
<td align="left">string</td>
<td align="left">The location this configuration object came from. If there is more then one of these it shows the history with the latest source at the end of the list.</td></tr></table></div>
<p>With the tasks API, you can obtain a collection of resources that represent a task within a job. When you run a GET operation on this resource, you obtain a collection of Task Objects. </p>
<div class="section">
<h5>URI<a name="URI"></a></h5>
<div>
<pre> * http://<history server http address:port>/ws/v1/history/mapreduce/jobs/{jobid}/tasks</pre></div></div>
<pre> * type - type of task, valid values are m or r. m for map task or r for reduce task.</pre></div></div>
<div class="section">
<h5>Elements of the <i>tasks</i> object<a name="Elements_of_the_tasks_object"></a></h5>
<p>When you make a request for the list of tasks , the information will be returned as an array of task objects. See also <a href="#Task_API">Task API</a> for syntax of the task object.</p>
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">Item</th>
<th align="left">Data Type</th>
<th align="left">Description</th></tr>
<tr class="b">
<td align="left">task</td>
<td align="left">array of task objects(JSON)/zero or more task objects(XML)</td>
<td align="left">The collection of task objects.</td></tr></table></div>
<pre> GET http://<history server http address:port>/ws/v1/history/mapreduce/jobs/job_1326381300833_2_2/tasks/task_1326381300833_2_2_m_0</pre></div>
<pre> GET http://<history server http address:port>/ws/v1/history/mapreduce/jobs/job_1326381300833_2_2/tasks/task_1326381300833_2_2_m_0/counters</pre></div>
<p>With the task attempts API, you can obtain a collection of resources that represent a task attempt within a job. When you run a GET operation on this resource, you obtain a collection of Task Attempt Objects. </p>
<div class="section">
<h5>URI<a name="URI"></a></h5>
<div>
<pre> * http://<history server http address:port>/ws/v1/history/mapreduce/jobs/{jobid}/tasks/{taskid}/attempts</pre></div></div>
<h5>Elements of the <i>taskAttempts</i> object<a name="Elements_of_the_taskAttempts_object"></a></h5>
<p>When you make a request for the list of task attempts, the information will be returned as an array of task attempt objects. See also <a href="#Task_Attempt_API">Task Attempt API</a> for syntax of the task object.</p>
<table border="1" class="bodyTable">
<tr class="a">
<th align="left">Item</th>
<th align="left">Data Type</th>
<th align="left">Description</th></tr>
<tr class="b">
<td align="left">taskAttempt</td>
<td align="left">array of task attempt objects(JSON)/zero or more task attempt objects(XML)</td>
<td align="left">The collection of task attempt objects</td></tr></table></div>
<pre> GET http://<history server http address:port>/ws/v1/history/mapreduce/jobs/job_1326381300833_2_2/tasks/task_1326381300833_2_2_m_0/attempts</pre></div>
<pre> GET http://<history server http address:port>/ws/v1/history/mapreduce/jobs/job_1326381300833_2_2/tasks/task_1326381300833_2_2_m_0/attempts/attempt_1326381300833_2_2_m_0_0 </pre></div>
<pre> GET http://<history server http address:port>/ws/v1/history/mapreduce/jobs/job_1326381300833_2_2/tasks/task_1326381300833_2_2_m_0/attempts/attempt_1326381300833_2_2_m_0_0
<pre> GET http://<history server http address:port>/ws/v1/history/mapreduce/jobs/job_1326381300833_2_2/tasks/task_1326381300833_2_2_m_0/attempts/attempt_1326381300833_2_2_m_0_0/counters</pre></div>
<pre> GET http://<history server http address:port>/ws/v1/history/mapreduce/jobs/job_1326381300833_2_2/tasks/task_1326381300833_2_2_m_0/attempts/attempt_1326381300833_2_2_m_0_0/counters