메인 콘텐츠로 건너뛰기
POST
/
endpoints
/
{endpoint_id}
/
scale
레플리카 스케일링
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"
}

인증

Authorization
string
header
필수

API Key를 Bearer 토큰으로 전달합니다. 프로젝트 개요의 API 키 메뉴에서 생성할 수 있습니다.

경로 매개변수

endpoint_id
string
필수

엔드포인트 고유 ID

본문

application/json
num_replicas
integer
필수

변경할 레플리카 수 (1-100)

필수 범위: 1 <= x <= 100
예시:

3

응답

스케일링 결과

endpoint_id
string

엔드포인트 고유 ID

예시:

"51c910f7-ecde-4c6c-88f8-d8e37ca9d598"

previous_replicas
integer

변경 전 레플리카 수

예시:

1

current_replicas
integer

변경 후 레플리카 수

예시:

3

message
string

결과 메시지

예시:

"Successfully scaled from 1 to 3 replicas"