get workergroup workers
curl --request POST \
--url https://run.vast.ai/get_workergroup_workers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"id": 12345
}'import requests
url = "https://run.vast.ai/get_workergroup_workers"
payload = { "id": 12345 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: 12345})
};
fetch('https://run.vast.ai/get_workergroup_workers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://run.vast.ai/get_workergroup_workers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => 12345
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://run.vast.ai/get_workergroup_workers"
payload := strings.NewReader("{\n \"id\": 12345\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://run.vast.ai/get_workergroup_workers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": 12345\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://run.vast.ai/get_workergroup_workers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": 12345\n}"
response = http.request(request)
puts response.read_body{
"workers": [
{
"id": 67890,
"status": "running",
"url": "http://192.168.1.10:8000",
"created_at": "2023-10-01T12:00:00Z"
}
]
}Serverless
get workergroup workers
Retrieves the current list and status of workers for a specific workergroup. Useful for monitoring, debugging connectivity issues, and understanding resource usage within a workergroup.
CLI Usage: vastai get workergroup workers <id>
POST
/
get_workergroup_workers
get workergroup workers
curl --request POST \
--url https://run.vast.ai/get_workergroup_workers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"id": 12345
}'import requests
url = "https://run.vast.ai/get_workergroup_workers"
payload = { "id": 12345 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: 12345})
};
fetch('https://run.vast.ai/get_workergroup_workers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://run.vast.ai/get_workergroup_workers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => 12345
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://run.vast.ai/get_workergroup_workers"
payload := strings.NewReader("{\n \"id\": 12345\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://run.vast.ai/get_workergroup_workers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": 12345\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://run.vast.ai/get_workergroup_workers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": 12345\n}"
response = http.request(request)
puts response.read_body{
"workers": [
{
"id": 67890,
"status": "running",
"url": "http://192.168.1.10:8000",
"created_at": "2023-10-01T12:00:00Z"
}
]
}Authorizations
API key must be provided in the Authorization header
Body
application/json
ID of the workergroup to monitor
Required range:
x >= 1Example:
12345
Response
200 - application/json
Workers successfully retrieved.
List of workers in this workergroup
Show child attributes
Show child attributes
⌘I