Check whether the cluster has room to schedule a prospective deployment
curl --request POST \
--url http://localhost:3001/api/system/capacity-check \
--header 'Content-Type: application/json' \
--cookie token= \
--data '
{
"topology": {
"mode": "standalone",
"replicas": 2,
"shards": 4,
"replicasPerShard": 3
},
"nodes": {
"resources": {
"requests": {
"cpu": "<string>",
"memory": "<string>"
},
"limits": {
"cpu": "<string>",
"memory": "<string>"
}
},
"scheduling": {
"nodeSelector": {},
"tolerations": [
{
"key": "<string>",
"operator": "Equal",
"value": "<string>",
"effect": "NoSchedule",
"tolerationSeconds": 1
}
]
}
},
"sentinels": {
"replicas": 2,
"resources": {
"requests": {
"cpu": "<string>",
"memory": "<string>"
},
"limits": {
"cpu": "<string>",
"memory": "<string>"
}
},
"storage": {
"size": "<string>",
"storageClass": "<string>"
},
"scheduling": {
"nodeSelector": {},
"tolerations": [
{
"key": "<string>",
"operator": "Equal",
"value": "<string>",
"effect": "NoSchedule",
"tolerationSeconds": 1
}
]
}
}
}
'import requests
url = "http://localhost:3001/api/system/capacity-check"
payload = {
"topology": {
"mode": "standalone",
"replicas": 2,
"shards": 4,
"replicasPerShard": 3
},
"nodes": {
"resources": {
"requests": {
"cpu": "<string>",
"memory": "<string>"
},
"limits": {
"cpu": "<string>",
"memory": "<string>"
}
},
"scheduling": {
"nodeSelector": {},
"tolerations": [
{
"key": "<string>",
"operator": "Equal",
"value": "<string>",
"effect": "NoSchedule",
"tolerationSeconds": 1
}
]
}
},
"sentinels": {
"replicas": 2,
"resources": {
"requests": {
"cpu": "<string>",
"memory": "<string>"
},
"limits": {
"cpu": "<string>",
"memory": "<string>"
}
},
"storage": {
"size": "<string>",
"storageClass": "<string>"
},
"scheduling": {
"nodeSelector": {},
"tolerations": [
{
"key": "<string>",
"operator": "Equal",
"value": "<string>",
"effect": "NoSchedule",
"tolerationSeconds": 1
}
]
}
}
}
headers = {
"cookie": "token=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'token=', 'Content-Type': 'application/json'},
body: JSON.stringify({
topology: {mode: 'standalone', replicas: 2, shards: 4, replicasPerShard: 3},
nodes: {
resources: {
requests: {cpu: '<string>', memory: '<string>'},
limits: {cpu: '<string>', memory: '<string>'}
},
scheduling: {
nodeSelector: {},
tolerations: [
{
key: '<string>',
operator: 'Equal',
value: '<string>',
effect: 'NoSchedule',
tolerationSeconds: 1
}
]
}
},
sentinels: {
replicas: 2,
resources: {
requests: {cpu: '<string>', memory: '<string>'},
limits: {cpu: '<string>', memory: '<string>'}
},
storage: {size: '<string>', storageClass: '<string>'},
scheduling: {
nodeSelector: {},
tolerations: [
{
key: '<string>',
operator: 'Equal',
value: '<string>',
effect: 'NoSchedule',
tolerationSeconds: 1
}
]
}
}
})
};
fetch('http://localhost:3001/api/system/capacity-check', 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/system/capacity-check",
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([
'topology' => [
'mode' => 'standalone',
'replicas' => 2,
'shards' => 4,
'replicasPerShard' => 3
],
'nodes' => [
'resources' => [
'requests' => [
'cpu' => '<string>',
'memory' => '<string>'
],
'limits' => [
'cpu' => '<string>',
'memory' => '<string>'
]
],
'scheduling' => [
'nodeSelector' => [
],
'tolerations' => [
[
'key' => '<string>',
'operator' => 'Equal',
'value' => '<string>',
'effect' => 'NoSchedule',
'tolerationSeconds' => 1
]
]
]
],
'sentinels' => [
'replicas' => 2,
'resources' => [
'requests' => [
'cpu' => '<string>',
'memory' => '<string>'
],
'limits' => [
'cpu' => '<string>',
'memory' => '<string>'
]
],
'storage' => [
'size' => '<string>',
'storageClass' => '<string>'
],
'scheduling' => [
'nodeSelector' => [
],
'tolerations' => [
[
'key' => '<string>',
'operator' => 'Equal',
'value' => '<string>',
'effect' => 'NoSchedule',
'tolerationSeconds' => 1
]
]
]
]
]),
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/system/capacity-check"
payload := strings.NewReader("{\n \"topology\": {\n \"mode\": \"standalone\",\n \"replicas\": 2,\n \"shards\": 4,\n \"replicasPerShard\": 3\n },\n \"nodes\": {\n \"resources\": {\n \"requests\": {\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\"\n },\n \"limits\": {\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\"\n }\n },\n \"scheduling\": {\n \"nodeSelector\": {},\n \"tolerations\": [\n {\n \"key\": \"<string>\",\n \"operator\": \"Equal\",\n \"value\": \"<string>\",\n \"effect\": \"NoSchedule\",\n \"tolerationSeconds\": 1\n }\n ]\n }\n },\n \"sentinels\": {\n \"replicas\": 2,\n \"resources\": {\n \"requests\": {\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\"\n },\n \"limits\": {\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\"\n }\n },\n \"storage\": {\n \"size\": \"<string>\",\n \"storageClass\": \"<string>\"\n },\n \"scheduling\": {\n \"nodeSelector\": {},\n \"tolerations\": [\n {\n \"key\": \"<string>\",\n \"operator\": \"Equal\",\n \"value\": \"<string>\",\n \"effect\": \"NoSchedule\",\n \"tolerationSeconds\": 1\n }\n ]\n }\n }\n}")
req, _ := http.NewRequest("POST", 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.post("http://localhost:3001/api/system/capacity-check")
.header("cookie", "token=")
.header("Content-Type", "application/json")
.body("{\n \"topology\": {\n \"mode\": \"standalone\",\n \"replicas\": 2,\n \"shards\": 4,\n \"replicasPerShard\": 3\n },\n \"nodes\": {\n \"resources\": {\n \"requests\": {\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\"\n },\n \"limits\": {\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\"\n }\n },\n \"scheduling\": {\n \"nodeSelector\": {},\n \"tolerations\": [\n {\n \"key\": \"<string>\",\n \"operator\": \"Equal\",\n \"value\": \"<string>\",\n \"effect\": \"NoSchedule\",\n \"tolerationSeconds\": 1\n }\n ]\n }\n },\n \"sentinels\": {\n \"replicas\": 2,\n \"resources\": {\n \"requests\": {\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\"\n },\n \"limits\": {\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\"\n }\n },\n \"storage\": {\n \"size\": \"<string>\",\n \"storageClass\": \"<string>\"\n },\n \"scheduling\": {\n \"nodeSelector\": {},\n \"tolerations\": [\n {\n \"key\": \"<string>\",\n \"operator\": \"Equal\",\n \"value\": \"<string>\",\n \"effect\": \"NoSchedule\",\n \"tolerationSeconds\": 1\n }\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3001/api/system/capacity-check")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["cookie"] = 'token='
request["Content-Type"] = 'application/json'
request.body = "{\n \"topology\": {\n \"mode\": \"standalone\",\n \"replicas\": 2,\n \"shards\": 4,\n \"replicasPerShard\": 3\n },\n \"nodes\": {\n \"resources\": {\n \"requests\": {\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\"\n },\n \"limits\": {\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\"\n }\n },\n \"scheduling\": {\n \"nodeSelector\": {},\n \"tolerations\": [\n {\n \"key\": \"<string>\",\n \"operator\": \"Equal\",\n \"value\": \"<string>\",\n \"effect\": \"NoSchedule\",\n \"tolerationSeconds\": 1\n }\n ]\n }\n },\n \"sentinels\": {\n \"replicas\": 2,\n \"resources\": {\n \"requests\": {\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\"\n },\n \"limits\": {\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\"\n }\n },\n \"storage\": {\n \"size\": \"<string>\",\n \"storageClass\": \"<string>\"\n },\n \"scheduling\": {\n \"nodeSelector\": {},\n \"tolerations\": [\n {\n \"key\": \"<string>\",\n \"operator\": \"Equal\",\n \"value\": \"<string>\",\n \"effect\": \"NoSchedule\",\n \"tolerationSeconds\": 1\n }\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"checkedAt": "2023-11-07T05:31:56Z",
"status": "fits",
"required": {
"pods": 1,
"cpu": 123,
"memory": 123,
"storage": 123
},
"available": {
"nodes": 1,
"cpu": 123,
"memory": 123
},
"unplaced": [
{
"component": "<string>",
"count": 1,
"cpu": 123,
"memory": 123
}
],
"storage": [
{
"storageClass": "<string>",
"required": 123,
"volumeCount": 1,
"status": "ok"
}
],
"issues": [
{
"severity": "error",
"message": "<string>"
}
],
"notes": [
"<string>"
]
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}System
Check whether the cluster has room to schedule a prospective deployment
POST
/
api
/
system
/
capacity-check
Check whether the cluster has room to schedule a prospective deployment
curl --request POST \
--url http://localhost:3001/api/system/capacity-check \
--header 'Content-Type: application/json' \
--cookie token= \
--data '
{
"topology": {
"mode": "standalone",
"replicas": 2,
"shards": 4,
"replicasPerShard": 3
},
"nodes": {
"resources": {
"requests": {
"cpu": "<string>",
"memory": "<string>"
},
"limits": {
"cpu": "<string>",
"memory": "<string>"
}
},
"scheduling": {
"nodeSelector": {},
"tolerations": [
{
"key": "<string>",
"operator": "Equal",
"value": "<string>",
"effect": "NoSchedule",
"tolerationSeconds": 1
}
]
}
},
"sentinels": {
"replicas": 2,
"resources": {
"requests": {
"cpu": "<string>",
"memory": "<string>"
},
"limits": {
"cpu": "<string>",
"memory": "<string>"
}
},
"storage": {
"size": "<string>",
"storageClass": "<string>"
},
"scheduling": {
"nodeSelector": {},
"tolerations": [
{
"key": "<string>",
"operator": "Equal",
"value": "<string>",
"effect": "NoSchedule",
"tolerationSeconds": 1
}
]
}
}
}
'import requests
url = "http://localhost:3001/api/system/capacity-check"
payload = {
"topology": {
"mode": "standalone",
"replicas": 2,
"shards": 4,
"replicasPerShard": 3
},
"nodes": {
"resources": {
"requests": {
"cpu": "<string>",
"memory": "<string>"
},
"limits": {
"cpu": "<string>",
"memory": "<string>"
}
},
"scheduling": {
"nodeSelector": {},
"tolerations": [
{
"key": "<string>",
"operator": "Equal",
"value": "<string>",
"effect": "NoSchedule",
"tolerationSeconds": 1
}
]
}
},
"sentinels": {
"replicas": 2,
"resources": {
"requests": {
"cpu": "<string>",
"memory": "<string>"
},
"limits": {
"cpu": "<string>",
"memory": "<string>"
}
},
"storage": {
"size": "<string>",
"storageClass": "<string>"
},
"scheduling": {
"nodeSelector": {},
"tolerations": [
{
"key": "<string>",
"operator": "Equal",
"value": "<string>",
"effect": "NoSchedule",
"tolerationSeconds": 1
}
]
}
}
}
headers = {
"cookie": "token=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'token=', 'Content-Type': 'application/json'},
body: JSON.stringify({
topology: {mode: 'standalone', replicas: 2, shards: 4, replicasPerShard: 3},
nodes: {
resources: {
requests: {cpu: '<string>', memory: '<string>'},
limits: {cpu: '<string>', memory: '<string>'}
},
scheduling: {
nodeSelector: {},
tolerations: [
{
key: '<string>',
operator: 'Equal',
value: '<string>',
effect: 'NoSchedule',
tolerationSeconds: 1
}
]
}
},
sentinels: {
replicas: 2,
resources: {
requests: {cpu: '<string>', memory: '<string>'},
limits: {cpu: '<string>', memory: '<string>'}
},
storage: {size: '<string>', storageClass: '<string>'},
scheduling: {
nodeSelector: {},
tolerations: [
{
key: '<string>',
operator: 'Equal',
value: '<string>',
effect: 'NoSchedule',
tolerationSeconds: 1
}
]
}
}
})
};
fetch('http://localhost:3001/api/system/capacity-check', 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/system/capacity-check",
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([
'topology' => [
'mode' => 'standalone',
'replicas' => 2,
'shards' => 4,
'replicasPerShard' => 3
],
'nodes' => [
'resources' => [
'requests' => [
'cpu' => '<string>',
'memory' => '<string>'
],
'limits' => [
'cpu' => '<string>',
'memory' => '<string>'
]
],
'scheduling' => [
'nodeSelector' => [
],
'tolerations' => [
[
'key' => '<string>',
'operator' => 'Equal',
'value' => '<string>',
'effect' => 'NoSchedule',
'tolerationSeconds' => 1
]
]
]
],
'sentinels' => [
'replicas' => 2,
'resources' => [
'requests' => [
'cpu' => '<string>',
'memory' => '<string>'
],
'limits' => [
'cpu' => '<string>',
'memory' => '<string>'
]
],
'storage' => [
'size' => '<string>',
'storageClass' => '<string>'
],
'scheduling' => [
'nodeSelector' => [
],
'tolerations' => [
[
'key' => '<string>',
'operator' => 'Equal',
'value' => '<string>',
'effect' => 'NoSchedule',
'tolerationSeconds' => 1
]
]
]
]
]),
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/system/capacity-check"
payload := strings.NewReader("{\n \"topology\": {\n \"mode\": \"standalone\",\n \"replicas\": 2,\n \"shards\": 4,\n \"replicasPerShard\": 3\n },\n \"nodes\": {\n \"resources\": {\n \"requests\": {\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\"\n },\n \"limits\": {\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\"\n }\n },\n \"scheduling\": {\n \"nodeSelector\": {},\n \"tolerations\": [\n {\n \"key\": \"<string>\",\n \"operator\": \"Equal\",\n \"value\": \"<string>\",\n \"effect\": \"NoSchedule\",\n \"tolerationSeconds\": 1\n }\n ]\n }\n },\n \"sentinels\": {\n \"replicas\": 2,\n \"resources\": {\n \"requests\": {\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\"\n },\n \"limits\": {\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\"\n }\n },\n \"storage\": {\n \"size\": \"<string>\",\n \"storageClass\": \"<string>\"\n },\n \"scheduling\": {\n \"nodeSelector\": {},\n \"tolerations\": [\n {\n \"key\": \"<string>\",\n \"operator\": \"Equal\",\n \"value\": \"<string>\",\n \"effect\": \"NoSchedule\",\n \"tolerationSeconds\": 1\n }\n ]\n }\n }\n}")
req, _ := http.NewRequest("POST", 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.post("http://localhost:3001/api/system/capacity-check")
.header("cookie", "token=")
.header("Content-Type", "application/json")
.body("{\n \"topology\": {\n \"mode\": \"standalone\",\n \"replicas\": 2,\n \"shards\": 4,\n \"replicasPerShard\": 3\n },\n \"nodes\": {\n \"resources\": {\n \"requests\": {\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\"\n },\n \"limits\": {\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\"\n }\n },\n \"scheduling\": {\n \"nodeSelector\": {},\n \"tolerations\": [\n {\n \"key\": \"<string>\",\n \"operator\": \"Equal\",\n \"value\": \"<string>\",\n \"effect\": \"NoSchedule\",\n \"tolerationSeconds\": 1\n }\n ]\n }\n },\n \"sentinels\": {\n \"replicas\": 2,\n \"resources\": {\n \"requests\": {\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\"\n },\n \"limits\": {\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\"\n }\n },\n \"storage\": {\n \"size\": \"<string>\",\n \"storageClass\": \"<string>\"\n },\n \"scheduling\": {\n \"nodeSelector\": {},\n \"tolerations\": [\n {\n \"key\": \"<string>\",\n \"operator\": \"Equal\",\n \"value\": \"<string>\",\n \"effect\": \"NoSchedule\",\n \"tolerationSeconds\": 1\n }\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3001/api/system/capacity-check")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["cookie"] = 'token='
request["Content-Type"] = 'application/json'
request.body = "{\n \"topology\": {\n \"mode\": \"standalone\",\n \"replicas\": 2,\n \"shards\": 4,\n \"replicasPerShard\": 3\n },\n \"nodes\": {\n \"resources\": {\n \"requests\": {\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\"\n },\n \"limits\": {\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\"\n }\n },\n \"scheduling\": {\n \"nodeSelector\": {},\n \"tolerations\": [\n {\n \"key\": \"<string>\",\n \"operator\": \"Equal\",\n \"value\": \"<string>\",\n \"effect\": \"NoSchedule\",\n \"tolerationSeconds\": 1\n }\n ]\n }\n },\n \"sentinels\": {\n \"replicas\": 2,\n \"resources\": {\n \"requests\": {\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\"\n },\n \"limits\": {\n \"cpu\": \"<string>\",\n \"memory\": \"<string>\"\n }\n },\n \"storage\": {\n \"size\": \"<string>\",\n \"storageClass\": \"<string>\"\n },\n \"scheduling\": {\n \"nodeSelector\": {},\n \"tolerations\": [\n {\n \"key\": \"<string>\",\n \"operator\": \"Equal\",\n \"value\": \"<string>\",\n \"effect\": \"NoSchedule\",\n \"tolerationSeconds\": 1\n }\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"checkedAt": "2023-11-07T05:31:56Z",
"status": "fits",
"required": {
"pods": 1,
"cpu": 123,
"memory": 123,
"storage": 123
},
"available": {
"nodes": 1,
"cpu": 123,
"memory": 123
},
"unplaced": [
{
"component": "<string>",
"count": 1,
"cpu": 123,
"memory": 123
}
],
"storage": [
{
"storageClass": "<string>",
"required": 123,
"volumeCount": 1,
"status": "ok"
}
],
"issues": [
{
"severity": "error",
"message": "<string>"
}
],
"notes": [
"<string>"
]
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}{
"error": "<string>",
"statusCode": 123,
"message": "<string>"
}Body
application/json
Response
Default Response
Was this page helpful?