Endpoints
Scale Endpoint Replicas
POST
/
endpoints
/
{endpoint_id}
/
scale
Scale Endpoint Replicas
curl --request POST \
--url https://external.aieev.cloud:5007/external/api/v1/endpoints/{endpoint_id}/scale \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"num_replicas": 3
}
'import requests
url = "https://external.aieev.cloud:5007/external/api/v1/endpoints/{endpoint_id}/scale"
payload = { "num_replicas": 3 }
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({num_replicas: 3})
};
fetch('https://external.aieev.cloud:5007/external/api/v1/endpoints/{endpoint_id}/scale', 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 => "5007",
CURLOPT_URL => "https://external.aieev.cloud:5007/external/api/v1/endpoints/{endpoint_id}/scale",
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([
'num_replicas' => 3
]),
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://external.aieev.cloud:5007/external/api/v1/endpoints/{endpoint_id}/scale"
payload := strings.NewReader("{\n \"num_replicas\": 3\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://external.aieev.cloud:5007/external/api/v1/endpoints/{endpoint_id}/scale")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"num_replicas\": 3\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://external.aieev.cloud:5007/external/api/v1/endpoints/{endpoint_id}/scale")
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 \"num_replicas\": 3\n}"
response = http.request(request)
puts response.read_body{
"endpoint_id": "51c910f7-ecde-4c6c-88f8-d8e37ca9d598",
"previous_replicas": 1,
"current_replicas": 3,
"message": "Successfully scaled from 1 to 3 replicas"
}Authorizations
Pass your API key as a Bearer token. Create API keys in the project overview.
Path Parameters
Unique endpoint ID.
Body
application/json
Desired number of replicas (1-100).
Required range:
1 <= x <= 100Example:
3
Response
Scale result.
⌘I
Scale Endpoint Replicas
curl --request POST \
--url https://external.aieev.cloud:5007/external/api/v1/endpoints/{endpoint_id}/scale \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"num_replicas": 3
}
'import requests
url = "https://external.aieev.cloud:5007/external/api/v1/endpoints/{endpoint_id}/scale"
payload = { "num_replicas": 3 }
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({num_replicas: 3})
};
fetch('https://external.aieev.cloud:5007/external/api/v1/endpoints/{endpoint_id}/scale', 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 => "5007",
CURLOPT_URL => "https://external.aieev.cloud:5007/external/api/v1/endpoints/{endpoint_id}/scale",
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([
'num_replicas' => 3
]),
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://external.aieev.cloud:5007/external/api/v1/endpoints/{endpoint_id}/scale"
payload := strings.NewReader("{\n \"num_replicas\": 3\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://external.aieev.cloud:5007/external/api/v1/endpoints/{endpoint_id}/scale")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"num_replicas\": 3\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://external.aieev.cloud:5007/external/api/v1/endpoints/{endpoint_id}/scale")
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 \"num_replicas\": 3\n}"
response = http.request(request)
puts response.read_body{
"endpoint_id": "51c910f7-ecde-4c6c-88f8-d8e37ca9d598",
"previous_replicas": 1,
"current_replicas": 3,
"message": "Successfully scaled from 1 to 3 replicas"
}
