Update a worker
curl --request PATCH \
--url https://console.cloudblast.io/api/v2/workers/{worker} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"git_repository": "<string>",
"git_branch": "<string>",
"ports_exposes": "<string>",
"base_directory": "<string>",
"publish_directory": "<string>",
"install_command": "<string>",
"build_command": "<string>",
"start_command": "<string>",
"is_spa": true,
"redeploy": false
}
'import requests
url = "https://console.cloudblast.io/api/v2/workers/{worker}"
payload = {
"name": "<string>",
"git_repository": "<string>",
"git_branch": "<string>",
"ports_exposes": "<string>",
"base_directory": "<string>",
"publish_directory": "<string>",
"install_command": "<string>",
"build_command": "<string>",
"start_command": "<string>",
"is_spa": True,
"redeploy": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
git_repository: '<string>',
git_branch: '<string>',
ports_exposes: '<string>',
base_directory: '<string>',
publish_directory: '<string>',
install_command: '<string>',
build_command: '<string>',
start_command: '<string>',
is_spa: true,
redeploy: false
})
};
fetch('https://console.cloudblast.io/api/v2/workers/{worker}', 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://console.cloudblast.io/api/v2/workers/{worker}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'git_repository' => '<string>',
'git_branch' => '<string>',
'ports_exposes' => '<string>',
'base_directory' => '<string>',
'publish_directory' => '<string>',
'install_command' => '<string>',
'build_command' => '<string>',
'start_command' => '<string>',
'is_spa' => true,
'redeploy' => false
]),
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://console.cloudblast.io/api/v2/workers/{worker}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"git_repository\": \"<string>\",\n \"git_branch\": \"<string>\",\n \"ports_exposes\": \"<string>\",\n \"base_directory\": \"<string>\",\n \"publish_directory\": \"<string>\",\n \"install_command\": \"<string>\",\n \"build_command\": \"<string>\",\n \"start_command\": \"<string>\",\n \"is_spa\": true,\n \"redeploy\": false\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://console.cloudblast.io/api/v2/workers/{worker}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"git_repository\": \"<string>\",\n \"git_branch\": \"<string>\",\n \"ports_exposes\": \"<string>\",\n \"base_directory\": \"<string>\",\n \"publish_directory\": \"<string>\",\n \"install_command\": \"<string>\",\n \"build_command\": \"<string>\",\n \"start_command\": \"<string>\",\n \"is_spa\": true,\n \"redeploy\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.cloudblast.io/api/v2/workers/{worker}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"git_repository\": \"<string>\",\n \"git_branch\": \"<string>\",\n \"ports_exposes\": \"<string>\",\n \"base_directory\": \"<string>\",\n \"publish_directory\": \"<string>\",\n \"install_command\": \"<string>\",\n \"build_command\": \"<string>\",\n \"start_command\": \"<string>\",\n \"is_spa\": true,\n \"redeploy\": false\n}"
response = http.request(request)
puts response.read_body{
"data": {
"uuid": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"name": "api-worker",
"status": "active",
"runtime_status": "running",
"runtime_status_at": "2023-11-07T05:31:56Z",
"provisioned": true,
"last_deployment_status": "finished",
"last_deployment_at": "2023-11-07T05:31:56Z",
"last_error": "<string>",
"fqdn": "api-worker.workers.cloudblast.io",
"location_id": 1,
"git_source": "public",
"git_repository": "https://github.com/example/app",
"git_branch": "main",
"build_pack": "nixpacks",
"ports_exposes": "3000",
"base_directory": "<string>",
"publish_directory": "<string>",
"install_command": "<string>",
"build_command": "<string>",
"start_command": "<string>",
"is_spa": false,
"limits": {
"cpu": 1,
"memory_mb": 1024,
"disk_mb": 5120
},
"usage": {
"cpu_percent": 3.5,
"memory_mb": 184,
"disk_mb": 612
},
"billing_type": "hourly",
"suspended_at": "2023-11-07T05:31:56Z",
"suspension_reason": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"location": {
"id": 1,
"name": "Frankfurt",
"short_code": "fra",
"description": "Germany",
"out_of_stock": false
}
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Missing or invalid Authorization header. Use: Authorization: Bearer <token>"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Server not found."
}
}{
"error": {
"code": "WORKER_STATE_CONFLICT",
"message": "Worker has not been provisioned yet."
}
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "The given data was invalid.",
"details": {
"name": [
"The name field is required."
]
}
}
}Workers
Update Worker
Updates build and runtime settings. Every field is optional; only what you send is changed.
Settings are written through either way, but a running worker keeps serving the build it already has. Pass redeploy: true to rebuild immediately, or call POST /workers/{worker}/actions with deploy later.
PATCH
/
workers
/
{worker}
Update a worker
curl --request PATCH \
--url https://console.cloudblast.io/api/v2/workers/{worker} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"git_repository": "<string>",
"git_branch": "<string>",
"ports_exposes": "<string>",
"base_directory": "<string>",
"publish_directory": "<string>",
"install_command": "<string>",
"build_command": "<string>",
"start_command": "<string>",
"is_spa": true,
"redeploy": false
}
'import requests
url = "https://console.cloudblast.io/api/v2/workers/{worker}"
payload = {
"name": "<string>",
"git_repository": "<string>",
"git_branch": "<string>",
"ports_exposes": "<string>",
"base_directory": "<string>",
"publish_directory": "<string>",
"install_command": "<string>",
"build_command": "<string>",
"start_command": "<string>",
"is_spa": True,
"redeploy": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
git_repository: '<string>',
git_branch: '<string>',
ports_exposes: '<string>',
base_directory: '<string>',
publish_directory: '<string>',
install_command: '<string>',
build_command: '<string>',
start_command: '<string>',
is_spa: true,
redeploy: false
})
};
fetch('https://console.cloudblast.io/api/v2/workers/{worker}', 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://console.cloudblast.io/api/v2/workers/{worker}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'git_repository' => '<string>',
'git_branch' => '<string>',
'ports_exposes' => '<string>',
'base_directory' => '<string>',
'publish_directory' => '<string>',
'install_command' => '<string>',
'build_command' => '<string>',
'start_command' => '<string>',
'is_spa' => true,
'redeploy' => false
]),
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://console.cloudblast.io/api/v2/workers/{worker}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"git_repository\": \"<string>\",\n \"git_branch\": \"<string>\",\n \"ports_exposes\": \"<string>\",\n \"base_directory\": \"<string>\",\n \"publish_directory\": \"<string>\",\n \"install_command\": \"<string>\",\n \"build_command\": \"<string>\",\n \"start_command\": \"<string>\",\n \"is_spa\": true,\n \"redeploy\": false\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://console.cloudblast.io/api/v2/workers/{worker}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"git_repository\": \"<string>\",\n \"git_branch\": \"<string>\",\n \"ports_exposes\": \"<string>\",\n \"base_directory\": \"<string>\",\n \"publish_directory\": \"<string>\",\n \"install_command\": \"<string>\",\n \"build_command\": \"<string>\",\n \"start_command\": \"<string>\",\n \"is_spa\": true,\n \"redeploy\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.cloudblast.io/api/v2/workers/{worker}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"git_repository\": \"<string>\",\n \"git_branch\": \"<string>\",\n \"ports_exposes\": \"<string>\",\n \"base_directory\": \"<string>\",\n \"publish_directory\": \"<string>\",\n \"install_command\": \"<string>\",\n \"build_command\": \"<string>\",\n \"start_command\": \"<string>\",\n \"is_spa\": true,\n \"redeploy\": false\n}"
response = http.request(request)
puts response.read_body{
"data": {
"uuid": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"name": "api-worker",
"status": "active",
"runtime_status": "running",
"runtime_status_at": "2023-11-07T05:31:56Z",
"provisioned": true,
"last_deployment_status": "finished",
"last_deployment_at": "2023-11-07T05:31:56Z",
"last_error": "<string>",
"fqdn": "api-worker.workers.cloudblast.io",
"location_id": 1,
"git_source": "public",
"git_repository": "https://github.com/example/app",
"git_branch": "main",
"build_pack": "nixpacks",
"ports_exposes": "3000",
"base_directory": "<string>",
"publish_directory": "<string>",
"install_command": "<string>",
"build_command": "<string>",
"start_command": "<string>",
"is_spa": false,
"limits": {
"cpu": 1,
"memory_mb": 1024,
"disk_mb": 5120
},
"usage": {
"cpu_percent": 3.5,
"memory_mb": 184,
"disk_mb": 612
},
"billing_type": "hourly",
"suspended_at": "2023-11-07T05:31:56Z",
"suspension_reason": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"location": {
"id": 1,
"name": "Frankfurt",
"short_code": "fra",
"description": "Germany",
"out_of_stock": false
}
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Missing or invalid Authorization header. Use: Authorization: Bearer <token>"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Server not found."
}
}{
"error": {
"code": "WORKER_STATE_CONFLICT",
"message": "Worker has not been provisioned yet."
}
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "The given data was invalid.",
"details": {
"name": [
"The name field is required."
]
}
}
}Authorizations
API token from your CloudBlast account settings. Pass as Authorization: Bearer <token>.
Path Parameters
Worker UUID, as returned in the uuid field.
Body
application/json
Every field is optional. Only what you send is changed.
Maximum string length:
191Maximum string length:
500Available options:
public, github, template, database Maximum string length:
191Available options:
nixpacks, static, dockerfile Maximum string length:
64Maximum string length:
255Maximum string length:
255Maximum string length:
1000Maximum string length:
1000Maximum string length:
1000Rebuild straight away so the new settings take effect.
Response
Updated worker
Show child attributes
Show child attributes