How to get Spark Job(Completed , Running and Pending) Information such as number of stages , tasks

I want to get the information of spark job such as number of tasks , stages , programatically.

I am able to get the required information for current running jobs from spark statusTracker object.

But is it possible to get the same information for pending or scheduled jobs?