curl --request PUT \
--url https://app.miget.com/api/v1/apps/{uuid}/workers/{name} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"replicas": 123,
"auto_scaling_enabled": true,
"auto_min_replicas": 123,
"auto_max_replicas": 123,
"cpu_threshold": 123,
"memory_threshold": 123,
"period_enabled": true,
"scaling_start_time": "<string>",
"scaling_end_time": "<string>"
}
'import requests
url = "https://app.miget.com/api/v1/apps/{uuid}/workers/{name}"
payload = {
"replicas": 123,
"auto_scaling_enabled": True,
"auto_min_replicas": 123,
"auto_max_replicas": 123,
"cpu_threshold": 123,
"memory_threshold": 123,
"period_enabled": True,
"scaling_start_time": "<string>",
"scaling_end_time": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
replicas: 123,
auto_scaling_enabled: true,
auto_min_replicas: 123,
auto_max_replicas: 123,
cpu_threshold: 123,
memory_threshold: 123,
period_enabled: true,
scaling_start_time: '<string>',
scaling_end_time: '<string>'
})
};
fetch('https://app.miget.com/api/v1/apps/{uuid}/workers/{name}', 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://app.miget.com/api/v1/apps/{uuid}/workers/{name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'replicas' => 123,
'auto_scaling_enabled' => true,
'auto_min_replicas' => 123,
'auto_max_replicas' => 123,
'cpu_threshold' => 123,
'memory_threshold' => 123,
'period_enabled' => true,
'scaling_start_time' => '<string>',
'scaling_end_time' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://app.miget.com/api/v1/apps/{uuid}/workers/{name}"
payload := strings.NewReader("{\n \"replicas\": 123,\n \"auto_scaling_enabled\": true,\n \"auto_min_replicas\": 123,\n \"auto_max_replicas\": 123,\n \"cpu_threshold\": 123,\n \"memory_threshold\": 123,\n \"period_enabled\": true,\n \"scaling_start_time\": \"<string>\",\n \"scaling_end_time\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.put("https://app.miget.com/api/v1/apps/{uuid}/workers/{name}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"replicas\": 123,\n \"auto_scaling_enabled\": true,\n \"auto_min_replicas\": 123,\n \"auto_max_replicas\": 123,\n \"cpu_threshold\": 123,\n \"memory_threshold\": 123,\n \"period_enabled\": true,\n \"scaling_start_time\": \"<string>\",\n \"scaling_end_time\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.miget.com/api/v1/apps/{uuid}/workers/{name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"replicas\": 123,\n \"auto_scaling_enabled\": true,\n \"auto_min_replicas\": 123,\n \"auto_max_replicas\": 123,\n \"cpu_threshold\": 123,\n \"memory_threshold\": 123,\n \"period_enabled\": true,\n \"scaling_start_time\": \"<string>\",\n \"scaling_end_time\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"state": "running",
"replicas": 123,
"quota": {}
}Scale a worker
Scales one worker of the application, a process its Procfile runs besides the web, on its own: a fixed number of replicas, or autoscaling between a minimum and a maximum on CPU or memory use, optionally inside a daily window. The web and the application’s other workers keep theirs. Like anything app.json declares, the change lasts until the next deploy, which sets the replicas app.json’s formation gives the worker again. On Usage Billing, a worker may run up to the workspace’s replicas_per_process limit (GET /api/v1/workspace/limits); on a resource, as many as the RAM the web and the other workers leave on it; on free compute, none until the workspace starts Usage Billing. Growing past that answers 422; scaling down is always accepted. Takes apps:deploy, apps:operate or apps:manage, as the application’s own scaling does. Not available on free plans. Returns the worker.
curl --request PUT \
--url https://app.miget.com/api/v1/apps/{uuid}/workers/{name} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"replicas": 123,
"auto_scaling_enabled": true,
"auto_min_replicas": 123,
"auto_max_replicas": 123,
"cpu_threshold": 123,
"memory_threshold": 123,
"period_enabled": true,
"scaling_start_time": "<string>",
"scaling_end_time": "<string>"
}
'import requests
url = "https://app.miget.com/api/v1/apps/{uuid}/workers/{name}"
payload = {
"replicas": 123,
"auto_scaling_enabled": True,
"auto_min_replicas": 123,
"auto_max_replicas": 123,
"cpu_threshold": 123,
"memory_threshold": 123,
"period_enabled": True,
"scaling_start_time": "<string>",
"scaling_end_time": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
replicas: 123,
auto_scaling_enabled: true,
auto_min_replicas: 123,
auto_max_replicas: 123,
cpu_threshold: 123,
memory_threshold: 123,
period_enabled: true,
scaling_start_time: '<string>',
scaling_end_time: '<string>'
})
};
fetch('https://app.miget.com/api/v1/apps/{uuid}/workers/{name}', 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://app.miget.com/api/v1/apps/{uuid}/workers/{name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'replicas' => 123,
'auto_scaling_enabled' => true,
'auto_min_replicas' => 123,
'auto_max_replicas' => 123,
'cpu_threshold' => 123,
'memory_threshold' => 123,
'period_enabled' => true,
'scaling_start_time' => '<string>',
'scaling_end_time' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://app.miget.com/api/v1/apps/{uuid}/workers/{name}"
payload := strings.NewReader("{\n \"replicas\": 123,\n \"auto_scaling_enabled\": true,\n \"auto_min_replicas\": 123,\n \"auto_max_replicas\": 123,\n \"cpu_threshold\": 123,\n \"memory_threshold\": 123,\n \"period_enabled\": true,\n \"scaling_start_time\": \"<string>\",\n \"scaling_end_time\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.put("https://app.miget.com/api/v1/apps/{uuid}/workers/{name}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"replicas\": 123,\n \"auto_scaling_enabled\": true,\n \"auto_min_replicas\": 123,\n \"auto_max_replicas\": 123,\n \"cpu_threshold\": 123,\n \"memory_threshold\": 123,\n \"period_enabled\": true,\n \"scaling_start_time\": \"<string>\",\n \"scaling_end_time\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.miget.com/api/v1/apps/{uuid}/workers/{name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"replicas\": 123,\n \"auto_scaling_enabled\": true,\n \"auto_min_replicas\": 123,\n \"auto_max_replicas\": 123,\n \"cpu_threshold\": 123,\n \"memory_threshold\": 123,\n \"period_enabled\": true,\n \"scaling_start_time\": \"<string>\",\n \"scaling_end_time\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"state": "running",
"replicas": 123,
"quota": {}
}Authorizations
Path Parameters
Body
Scale a worker
Response
Scale a worker
Api_V1_Entities_Worker model

