-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I obtain current job state and slave where it is executed via REST API? #599
Comments
I found that: curl -L -X GET http://chronos-node:4400/scheduler/graph/csv obtains the current state of the job. Nothing about the node... |
what's update? |
To get the state in a json format you can use something like the following:
Unfortunately that leaves out most of the data from the regular To get the current state, if you have access to the Mesos leader endpoint, and your job is named 'myjob', you can use this Mesos /master/tasks API do something like this:
Use the nested quotes on the grep argument to make sure that the job name is literally 'myjob' and does not just start with that. The chronos framework creates the mesos task as In the JSON value this returns, it gives you the 'slave_id', 'framework_id', and the 'state' as fields. The state here is the mesos task state, which does not directly match up with the Chronos job state returned by the first curl command. If you need the hostname for the mesos slave that ran that chronos job you can use the /master/slaves API, but unfortunately it seems like the slave_id query param is not working to filter down to the particular slave, so you'll have to filter it manually again. For this one there isn't a huge return value so you can filter it just in python.
And in the 'slaves' field of the json dict it returns, there is a list of slave objects, each with the 'id' and 'hostname' fields. |
Hi,
I need to obtain the info about the state of the job and the slave that is executing the job (if proceed) to use it inside a python program. I have used the command provided in the Chronos documentation (curl -L -X GET chronos-node:8080/scheduler/jobs) to obtain the info about current jobs in Chronos 2.4.0 via its REST API, but information I need is not provided. I have read that it is possible to obtain those data using Cassandra (http://wjb-tech.blogspot.com.es/), but I was not willing to install it. Is there any way to obtain this info without installing Cassandra?
Thanks!
The text was updated successfully, but these errors were encountered: