Deploy, start, stop or restart
curl --request POST \
--url https://console.cloudblast.io/api/v2/workers/{worker}/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"action": "deploy",
"force": false
}
'import requests
url = "https://console.cloudblast.io/api/v2/workers/{worker}/actions"
payload = {
"action": "deploy",
"force": False
}
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({action: 'deploy', force: false})
};
fetch('https://console.cloudblast.io/api/v2/workers/{worker}/actions', 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}/actions",
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([
'action' => 'deploy',
'force' => 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}/actions"
payload := strings.NewReader("{\n \"action\": \"deploy\",\n \"force\": false\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://console.cloudblast.io/api/v2/workers/{worker}/actions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"action\": \"deploy\",\n \"force\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.cloudblast.io/api/v2/workers/{worker}/actions")
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 \"action\": \"deploy\",\n \"force\": false\n}"
response = http.request(request)
puts response.read_body{
"data": {
"action": "deploy",
"status": "initiated",
"result": {}
}
}{
"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 is not in an active state."
}
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "The given data was invalid.",
"details": {
"name": [
"The name field is required."
]
}
}
}Workers
Deploy, Start, Stop, Restart
Carries out a runtime action:
deploy: build the current commit and roll it out. On a worker that was never provisioned this queues the first build instead.start/stop: bring the containers up or down without rebuilding.restart: stop and start in one step.
All four are asynchronous. The response only says the action was accepted; poll GET /workers/{worker}/status to watch it land.
POST
/
workers
/
{worker}
/
actions
Deploy, start, stop or restart
curl --request POST \
--url https://console.cloudblast.io/api/v2/workers/{worker}/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"action": "deploy",
"force": false
}
'import requests
url = "https://console.cloudblast.io/api/v2/workers/{worker}/actions"
payload = {
"action": "deploy",
"force": False
}
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({action: 'deploy', force: false})
};
fetch('https://console.cloudblast.io/api/v2/workers/{worker}/actions', 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}/actions",
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([
'action' => 'deploy',
'force' => 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}/actions"
payload := strings.NewReader("{\n \"action\": \"deploy\",\n \"force\": false\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://console.cloudblast.io/api/v2/workers/{worker}/actions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"action\": \"deploy\",\n \"force\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.cloudblast.io/api/v2/workers/{worker}/actions")
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 \"action\": \"deploy\",\n \"force\": false\n}"
response = http.request(request)
puts response.read_body{
"data": {
"action": "deploy",
"status": "initiated",
"result": {}
}
}{
"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 is not in an active state."
}
}{
"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
Response
Action accepted
Show child attributes
Show child attributes