In some cases, users may not be able to access the Dr.elephant UI interface, but they need to interact with dr.elephant to get some of the dr.elephant's results. Dr.elephant provides the rest API to meet the needs of the user.
get app information by ID
Depending on the ID of the task, you can get the details of the task and the analysis results of the heuristic algorithm.
Uri
Http://<dr-elephant-host:port>/rest/job
Request parameters
Parameter |
Description |
Id |
The app or job ID to search |
return body
Parameter |
Description |
Id |
The Application ID |
Name |
The name of the application |
Username |
User who submitted the application |
QueueName |
The queue the application was submitted to |
StartTime |
The time in which application started |
Finishtime |
The time in which application finished |
Trackingurl |
The Job history page of the app |
JobType |
Type of the job e.g. Pig |
Severity |
Aggregate severity of all the heuristics. Ranges from 0 (Low) to 4 (CRITICAL) |
Score |
The application score which is the sum of heuristic scores |
Workflowdepth |
The application depth in the scheduled flow. Depth starts from 0 |
Scheduler |
The scheduler which triggered the application |
JobName |
The name of the job in the flow to which this app belongs |
Jobexecid |
A unique reference to a specific execution of the job/action (job in the workflow). |
Flowexecid |
A unique reference to a specific flow execution. |
Jobdefid |
A unique reference to the job in the entire flow independent of the execution. |
Flowdefid |
A unique reference to the entire flow independent of any execution. |
Jobexecurl |
A URL to the job execution on the schedule |
Flowexecurl |
A URL to the flow execution on the scheduler |
Jobdefurl |
A URL to the job definition on the scheduler |
Flowdefurl |
A URL to the flow definition on the scheduler |
Yarnappheuristicresults |
Detailed results on individual heuristics |
Get app information based on execution ID
All task information can be obtained based on the execution ID of the task or the execution URL of the Azkaban.
Uri
Http://<dr-elephant-host:port>/rest/jobexec
Request parameters
Parameter |
Description |
Id |
The job execution ID or job execution URL (Azkaban) to search |
return results
The returned result contains all the subtasks and jobs for this task. This return result sequence table can refer to the " get application information by ID " section above
get apps based on task flow ID
The details of the task flow can be obtained based on the ID of the task flow or the Azkaban task execution URL.
Uri
Http://<dr-elephant-host:port>/rest/flowexec
Request parameters
Parameter |
Description |
Id |
The flow execution id or flow execution URL (Azkaban) to search |
return results
The return result contains all the subtasks and jobs for this task flow. This return result sequence table can refer to the " get application information by ID " section above
Search tasks
The task and task flow can be searched according to certain parameters. The Rest API supports searching with all parameters.
Uri
Http://<dr-elephant-host:port>/rest/search
Request parameters
Parameter |
Description |
Id |
The Job/app execution ID to search. If This is provided, no other parameter is valid |
Flow-exec-id |
The flow execution ID or URL (azkaban) to search, if this is provided, no other parameter is valid |
Username |
To filter jobs by the user |
Severity |
To filter all jobs based on severity |
Job-type |
The type of jobs to search |
Analysis |
The heuristic name. This goes together with severity. |
Finished-time-begin |
The start range of finish time. (Milliseconds since epoch) |
Finished-time-end |
The end range of finish time. (Milliseconds since epoch) |
Started-time-begin |
The start range of start time. (Milliseconds since epoch) |
Started-time-end |
The end range of start time. (Milliseconds since epoch)
|
return results
The return result contains all the tasks for this task flow. This return result sequence table can refer to the " get application information by ID " section above
compare the execution of a task
Given the IDs of two tasks, the results of two task comparisons are returned
Uri
Http://<dr-elephant-host:port>/rest/compare
Request parameters
Parameter |
Description |
Flow-exec-id1 |
Flow execution ID or URL (azkaban) of first flow |
Flow-exec-id2 |
Flow execution ID or URL (azkaban) of second flow
|
return results
The resulting format is as follows:
{
JOB_DEF_ID1: {
FLOW_EXEC_ID1: {
App1_details,
App2_details
},
Flow_exec_id2: {
App1_details,
App2_details
}
},
Job_def_id2: {
FLOW_EXEC_ID1: {
App1_details,
App2_details,
App3_details
},
Flow_exec_id2: {
App1_details,
App2_details
App3_details
}
}
}
The result of the app1_details is the detailed return result of the application, which can be referenced in the " get application information by ID " section of the return result sequence table
Author Profile: Cussaur, interested in high-concurrency system design and development, is now focusing on big data development efforts. served as a background development engineer of Xiaomi Technology company, now serves as Senior development engineer of Everstring data platform Group.
Dr.elephant Rest API-"dr.elephant series article-7"