List Task Batches
curl --request GET \
--url https://api.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches', 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://api.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_name": "miner.system.reboot",
"status": "succeed",
"task_count": 4503599627370495,
"succeed_count": 4503599627370495,
"unsuccessful_count": 4503599627370495,
"task_params": {},
"metadata": {},
"created_by": {
"type": "user",
"id": "user_2xGz1234567890",
"name": "John Doe",
"avatar": "https://example.com/avatar.png",
"metadata": {}
},
"created_at": "2023-11-07T05:31:56Z"
}
],
"pagination": {
"total": 4503599627370495,
"page": 123,
"page_size": 123,
"total_pages": 4503599627370495
},
"error": null
}{
"success": false,
"data": null,
"error": {
"code": "VALIDATION_ERROR",
"message": "Validation failed"
}
}{
"success": false,
"data": null,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing credential"
}
}{
"success": false,
"data": null,
"error": {
"code": "FORBIDDEN",
"message": "Access denied"
}
}{
"success": false,
"data": null,
"error": {
"code": "FARM_NOT_FOUND",
"message": "Farm not found"
}
}{
"success": false,
"data": null,
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error"
}
}Task Batches
List Task Batches
GET
/
public-api
/
v2
/
workspaces
/
{workspace_id}
/
farms
/
{farm_id}
/
task-batches
List Task Batches
curl --request GET \
--url https://api.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches', 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://api.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nonce.app/public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_name": "miner.system.reboot",
"status": "succeed",
"task_count": 4503599627370495,
"succeed_count": 4503599627370495,
"unsuccessful_count": 4503599627370495,
"task_params": {},
"metadata": {},
"created_by": {
"type": "user",
"id": "user_2xGz1234567890",
"name": "John Doe",
"avatar": "https://example.com/avatar.png",
"metadata": {}
},
"created_at": "2023-11-07T05:31:56Z"
}
],
"pagination": {
"total": 4503599627370495,
"page": 123,
"page_size": 123,
"total_pages": 4503599627370495
},
"error": null
}{
"success": false,
"data": null,
"error": {
"code": "VALIDATION_ERROR",
"message": "Validation failed"
}
}{
"success": false,
"data": null,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing credential"
}
}{
"success": false,
"data": null,
"error": {
"code": "FORBIDDEN",
"message": "Access denied"
}
}{
"success": false,
"data": null,
"error": {
"code": "FARM_NOT_FOUND",
"message": "Farm not found"
}
}{
"success": false,
"data": null,
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error"
}
}Authorizations
oauth-jwtclerk-api-key
Clerk OAuth JWT access token
Path Parameters
Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Query Parameters
Required range:
x <= 9007199254740991Required range:
x <= 10000Task name filter
Available options:
agent.scan.create, agent.ip_diagnosis.create, agent.self.update, miner.system.reboot, miner.log.get, miner.light.update, miner.power_mode.update, miner.pool.update, miner.pool.lock, miner.firmware.update, miner.tags.update, miner.record.delete, miner.rack_location.update Example:
"miner.system.reboot"