You can call the API directly and get a list of existing agents
You can either use REST API or the APIClient (which can send the same request)
I mean what should I write in a script to import the APIClient? (sorry if I'm not explaining myself properly 😅 )
Just try it out manually and see what you get :)
My guess is to manually read and parse the string that clearml-agent list
returns, but I'm pretty sure there's a cleaner way to do it, isn't there?
But what is the name of that API library in order to have access to those commands from Python SDK?
Hi GiganticTurtle0 ,
You can't set an agent to pull tasks only if other agents are off-line, but you can certainly have some monitoring script checking if the other agents are up and if not, starting this CPU agent - will that work?
Perfect, that's exactly what I was looking for 🙂 Thanks!
Should be something like:
` from clearml.backend_api.session.client import APIClient
client = APIClient()
response = client.workers.get_all() `
Response contains both the raw JSON response as well as an object with properties
But how could I know whether an agent is up or not? Is it from the CLI or SDK?