Set the memory autoscaling policy
curl --request PUT \
--url http://localhost:3001/api/clusters/{clusterName}/autoscaling \
--header 'Content-Type: application/json' \
--cookie token= \
--data '
{
"maxMemoryPerPod": "<string>",
"enabled": true,
"mode": "auto",
"thresholdPercent": 123,
"sustainedMinutes": 123,
"cooldownMinutes": 123,
"scaleUpStepPercent": 123
}
'import requests
url = "http://localhost:3001/api/clusters/{clusterName}/autoscaling"
payload = {
"maxMemoryPerPod": "<string>",
"enabled": True,
"mode": "auto",
"thresholdPercent": 123,
"sustainedMinutes": 123,
"cooldownMinutes": 123,
"scaleUpStepPercent": 123
}
headers = {
"cookie": "token=",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {cookie: 'token=', 'Content-Type': 'application/json'},
body: JSON.stringify({
maxMemoryPerPod: '<string>',
enabled: true,
mode: 'auto',
thresholdPercent: 123,
sustainedMinutes: 123,
cooldownMinutes: 123,
scaleUpStepPercent: 123
})
};
fetch('http://localhost:3001/api/clusters/{clusterName}/autoscaling', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3001",
CURLOPT_URL => "http://localhost:3001/api/clusters/{clusterName}/autoscaling",
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([
'maxMemoryPerPod' => '<string>',
'enabled' => true,
'mode' => 'auto',
'thresholdPercent' => 123,
'sustainedMinutes' => 123,
'cooldownMinutes' => 123,
'scaleUpStepPercent' => 123
]),
CURLOPT_COOKIE => "token=",
CURLOPT_HTTPHEADER => [
"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 := "http://localhost:3001/api/clusters/{clusterName}/autoscaling"
payload := strings.NewReader("{\n \"maxMemoryPerPod\": \"<string>\",\n \"enabled\": true,\n \"mode\": \"auto\",\n \"thresholdPercent\": 123,\n \"sustainedMinutes\": 123,\n \"cooldownMinutes\": 123,\n \"scaleUpStepPercent\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("cookie", "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.put("http://localhost:3001/api/clusters/{clusterName}/autoscaling")
.header("cookie", "token=")
.header("Content-Type", "application/json")
.body("{\n \"maxMemoryPerPod\": \"<string>\",\n \"enabled\": true,\n \"mode\": \"auto\",\n \"thresholdPercent\": 123,\n \"sustainedMinutes\": 123,\n \"cooldownMinutes\": 123,\n \"scaleUpStepPercent\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3001/api/clusters/{clusterName}/autoscaling")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["cookie"] = 'token='
request["Content-Type"] = 'application/json'
request.body = "{\n \"maxMemoryPerPod\": \"<string>\",\n \"enabled\": true,\n \"mode\": \"auto\",\n \"thresholdPercent\": 123,\n \"sustainedMinutes\": 123,\n \"cooldownMinutes\": 123,\n \"scaleUpStepPercent\": 123\n}"
response = http.request(request)
puts response.read_body{
"policy": {
"enabled": true,
"mode": "auto",
"thresholdPercent": 123,
"sustainedMinutes": 123,
"cooldownMinutes": 123,
"scaleUpStepPercent": 123,
"maxMemoryPerPod": "<string>",
"scaleOut": {
"enabled": true,
"stepShards": 123,
"maxShards": 123
}
},
"status": {
"checkedAt": "<string>",
"decision": {
"action": "none",
"reason": "<string>",
"memoryLimit": "<string>",
"shardCount": 123
},
"recommendedOnly": true,
"memoryPercent": 123,
"error": "<string>"
}
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}Autoscaling
Set the memory autoscaling policy
Set the memory autoscaling policy. Only maxMemoryPerPod is required; mode defaults to recommend, which records what it would do without scaling.
PUT
/
api
/
clusters
/
{clusterName}
/
autoscaling
Set the memory autoscaling policy
curl --request PUT \
--url http://localhost:3001/api/clusters/{clusterName}/autoscaling \
--header 'Content-Type: application/json' \
--cookie token= \
--data '
{
"maxMemoryPerPod": "<string>",
"enabled": true,
"mode": "auto",
"thresholdPercent": 123,
"sustainedMinutes": 123,
"cooldownMinutes": 123,
"scaleUpStepPercent": 123
}
'import requests
url = "http://localhost:3001/api/clusters/{clusterName}/autoscaling"
payload = {
"maxMemoryPerPod": "<string>",
"enabled": True,
"mode": "auto",
"thresholdPercent": 123,
"sustainedMinutes": 123,
"cooldownMinutes": 123,
"scaleUpStepPercent": 123
}
headers = {
"cookie": "token=",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {cookie: 'token=', 'Content-Type': 'application/json'},
body: JSON.stringify({
maxMemoryPerPod: '<string>',
enabled: true,
mode: 'auto',
thresholdPercent: 123,
sustainedMinutes: 123,
cooldownMinutes: 123,
scaleUpStepPercent: 123
})
};
fetch('http://localhost:3001/api/clusters/{clusterName}/autoscaling', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3001",
CURLOPT_URL => "http://localhost:3001/api/clusters/{clusterName}/autoscaling",
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([
'maxMemoryPerPod' => '<string>',
'enabled' => true,
'mode' => 'auto',
'thresholdPercent' => 123,
'sustainedMinutes' => 123,
'cooldownMinutes' => 123,
'scaleUpStepPercent' => 123
]),
CURLOPT_COOKIE => "token=",
CURLOPT_HTTPHEADER => [
"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 := "http://localhost:3001/api/clusters/{clusterName}/autoscaling"
payload := strings.NewReader("{\n \"maxMemoryPerPod\": \"<string>\",\n \"enabled\": true,\n \"mode\": \"auto\",\n \"thresholdPercent\": 123,\n \"sustainedMinutes\": 123,\n \"cooldownMinutes\": 123,\n \"scaleUpStepPercent\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("cookie", "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.put("http://localhost:3001/api/clusters/{clusterName}/autoscaling")
.header("cookie", "token=")
.header("Content-Type", "application/json")
.body("{\n \"maxMemoryPerPod\": \"<string>\",\n \"enabled\": true,\n \"mode\": \"auto\",\n \"thresholdPercent\": 123,\n \"sustainedMinutes\": 123,\n \"cooldownMinutes\": 123,\n \"scaleUpStepPercent\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3001/api/clusters/{clusterName}/autoscaling")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["cookie"] = 'token='
request["Content-Type"] = 'application/json'
request.body = "{\n \"maxMemoryPerPod\": \"<string>\",\n \"enabled\": true,\n \"mode\": \"auto\",\n \"thresholdPercent\": 123,\n \"sustainedMinutes\": 123,\n \"cooldownMinutes\": 123,\n \"scaleUpStepPercent\": 123\n}"
response = http.request(request)
puts response.read_body{
"policy": {
"enabled": true,
"mode": "auto",
"thresholdPercent": 123,
"sustainedMinutes": 123,
"cooldownMinutes": 123,
"scaleUpStepPercent": 123,
"maxMemoryPerPod": "<string>",
"scaleOut": {
"enabled": true,
"stepShards": 123,
"maxShards": 123
}
},
"status": {
"checkedAt": "<string>",
"decision": {
"action": "none",
"reason": "<string>",
"memoryLimit": "<string>",
"shardCount": 123
},
"recommendedOnly": true,
"memoryPercent": 123,
"error": "<string>"
}
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}Body
application/json
Was this page helpful?