Affects Version/s: 1.4.1
Fix Version/s: None
Component/s: HTTP API
I noticed that the Task information returned by a mesos agent is different from the task information returned by the mesos master.
Agent's /state endpoint, when returning each task, includes the directory field (inside the executors array), which is super useful if we want to browse this task's sandbox files. But at the same time, the agent HTTP API does not provide a way to get a task by its ID.
So we need to talk to the Mesos master to get a task by its ID and we can do it using the /tasks?task_id=<task_id endpoint. But here we do not have any information about this task's executor.
So given a TaskID, to be able to download/browse its sandbox files we need 3+ API calls:
- One to the master (/tasks) to get the task's JSON;
- Anoter to the master (/slaves?slave_id=<slave-id> to get the slave IP address;
- Another to this slave (//state) to get all its tasks. Then we iterate the lists of tasks (of each executor) searching for our TaskID; get the directory field.
- And then, the final API call, made on endpoint (/files/browse?path=) to get the contents of the required file
I would like to know if it's possible to the Master to include this directory field when returning info about a specific task.
Also, is there a easier way to do what I described here? GIven a TaskID, get the content of a file inside its sandbox (stdout/stderr would be the most common options)
Thanks a lot.
Here is one example of each JSON returned (only the important parts)
Master /tasks?task_id=<task_id> endpoint
Slave's /state endpoint