public static Result restApplicationFromApplicationId(String applicationid) {

    if (applicationid == null || applicationid.isEmpty()) {
      JsonObject parent = new JsonObject();
      parent.add(JsonKeys.APPLICATIONS, new JsonObject());
      return notFound(new Gson().toJson(parent));
    }

    if (applicationid.startsWith("job")) {
      applicationid = applicationid.replaceAll("job", "application");
    }

    JsonObject applicationObject = new JsonObject();
    JsonArray heuristicsArray = new JsonArray();

    AppResult result = getAppResultFromApplicationId(applicationid);

    if (result == null) {
      JsonObject parent = new JsonObject();
      parent.add(JsonKeys.APPLICATIONS, new JsonObject());
      return notFound(new Gson().toJson(parent));
    }

    for (AppHeuristicResult appHeuristicResult : result.yarnAppHeuristicResults) {
      JsonArray detailsArray = new JsonArray();
      JsonObject heuristicResultObject = new JsonObject();
      for (AppHeuristicResultDetails details : appHeuristicResult.yarnAppHeuristicResultDetails) {
        JsonObject detailsObject = new JsonObject();
        detailsObject.addProperty(JsonKeys.NAME, details.name);
        detailsObject.addProperty(JsonKeys.VALUE, details.value);
        detailsObject.addProperty(JsonKeys.DETAILS, details.details);
        detailsArray.add(detailsObject);
      }
      heuristicResultObject.addProperty(JsonKeys.NAME, appHeuristicResult.heuristicName);
      heuristicResultObject.addProperty(JsonKeys.SEVERITY, appHeuristicResult.severity.getText());
      heuristicResultObject.add(JsonKeys.DETAILS, detailsArray);
      heuristicsArray.add(heuristicResultObject);
    }

    applicationObject.addProperty(JsonKeys.ID, result.id);
    applicationObject.addProperty(JsonKeys.USERNAME, result.username);
    applicationObject.addProperty(JsonKeys.JOB_TYPE, result.jobType);
    applicationObject.addProperty(JsonKeys.MAPREDUCE_JOB_NAME, result.jobName);
    applicationObject.addProperty(JsonKeys.START_TIME, result.startTime);
    applicationObject.addProperty(JsonKeys.FINISH_TIME, result.finishTime);
    applicationObject.addProperty(JsonKeys.RUNTIME, result.finishTime - result.startTime);
    applicationObject.addProperty(JsonKeys.WAITTIME, result.totalDelay);
    applicationObject.addProperty(JsonKeys.RESOURCE_USED, result.resourceUsed);
    applicationObject.addProperty(JsonKeys.RESOURCE_WASTED, result.resourceWasted);
    applicationObject.addProperty(JsonKeys.SEVERITY, result.severity.getText());
    applicationObject.addProperty(JsonKeys.TRACKING_URL, result.trackingUrl);
    applicationObject.addProperty(JsonKeys.JOB_EXEC_ID, result.jobExecId);
    applicationObject.addProperty(JsonKeys.JOB_DEF_ID, result.jobDefId);
    applicationObject.addProperty(JsonKeys.FLOW_EXEC_ID, result.flowExecId);
    applicationObject.addProperty(JsonKeys.FLOW_DEF_ID, result.flowDefId);
    applicationObject.addProperty(JsonKeys.QUEUE, result.queueName);

    applicationObject.add(JsonKeys.YARN_APP_HEURISTIC_RESULTS, heuristicsArray);

    JsonObject parent = new JsonObject();
    parent.add(JsonKeys.APPLICATIONS, applicationObject);
    return ok(new Gson().toJson(parent));
  }
@param applicationId
@return
<pre>
 {
 "applications": {
   "id": "application_id",
   "username": "username",
   "jobtype": "Pig",
   "mapreducejobname": "mapreducejobname",
   "starttime": 1471910835628,
   "finishtime": 1471911099238,
   "runtime": 263610,
   "waittime": 46234,
   "resourceused": 101382144,
   "resourcewasted": 15993417,
   "severity": "Moderate",
   "trackingurl": "jobtracker_address",
   "jobexecid": "jobexecutionid",
   "jobdefid": "jobdefinitionid",
   "flowexeid": "flowexecutionid",
   "flowdefid": "flowdefinitionid",
   "yarnappheuristicresults": [
     {
       "name": "Mapper Data Skew",
       "severity": "None",
       "details": [
         {
           "name": "Group A",
           "value": "236 tasks @ 506 MB avg"
         },
         {
           "name": "Group B",
           "value": "234 tasks @ 507 MB avg"
         },
         {
           "name": "Number of tasks",
           "value": "470"
         }
       ]
     },
     {
       "name": "Mapper GC",
       "severity": "None",
       "details": [
         {
           "name": "Avg task CPU time (ms)",
           "value": "111717"
         },
         {
           "name": "Avg task GC time (ms)",
           "value": "3197"
         },
         {
           "name": "Avg task runtime (ms)",
           "value": "105633"
         },
         {
           "name": "Number of tasks",
           "value": "470"
         },
         {
           "name": "Task GC\/CPU ratio",
           "value": "0.028616951762041588"
         }
       ]
     }..
   ]
 }
}
</pre>
app/controllers/api/v1/Web.java