Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escaping: Escape characters +-&|!(){}[]^"~*?:\ with \, e.g. \+
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
Hi Everyone, We Are Using Clearml In Our Setup. I Am Trying To Retrieve Workers And Gpu Utilization From Clearml Api. Can I Get Info How Do I Get Api Token For That And What Endpoints Should Be Useful In That Case? I Need To Retrieve Busy Workers For A Sp

Hi everyone,
We are using ClearML in our setup.
I am trying to retrieve workers and gpu utilization from ClearML API. Can I get info how do I get api token for that and what endpoints should be useful in that case?
I need to retrieve busy workers for a specific time duration.

  
  
Posted 2 years ago
Votes Newest

Answers 5


DrabCockroach54 I think the problem was you were using the web server address instead of the api server address

  
  
Posted 2 years ago

This worked out.
`
from clearml.backend_api.session.client import APIClient

Create an instance of APIClient

client = APIClient()
project_list = client.workers.get_all()
print(project_list) `

  
  
Posted 2 years ago

I see. I am getting error in html output.
<noscript>Please enable JavaScript to continue using this application.</noscript>

  
  
Posted 2 years ago

Thanks for the reply.
So, all requests should be post even when I'm trying to collect data?
For https://clear.ml/docs/latest/docs/references/api/workers#post-workersget_activity_report
when I am trying this
`
import requests, json
from requests.auth import HTTPBasicAuth

request_body = {
"from_date": "1665867715",
"interval": "3600",
"to_date": "1666213315"
}
url = web_server+"/workers.get_activity_report"

response = requests.get(url, auth=HTTPBasicAuth(access_key, secret_key), json=request_body) `I get response as 200
but response.json() throwing error
response.content showing html page output.
What am I missing?

I tried with requests.post but then I got 405 Not Allowed

  
  
Posted 2 years ago

Hi DrabCockroach54 , I think you are looking for these endpoints:
https://clear.ml/docs/latest/docs/references/api/workers#post-workersget_activity_report
https://clear.ml/docs/latest/docs/references/api/workers#post-workersget_stats

Regarding the api token - you can use the key/secret pair that you generated through the ClearML UI

  
  
Posted 2 years ago
1K Views
5 Answers
2 years ago
one year ago
Tags