创建 Endpoint
curl --request POST \
--url https://api.ppio.com/gpu-instance/openapi/v1/endpoint/create \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"endpoint": {
"name": "<string>",
"appName": "<string>",
"workerConfig": {
"minNum": 123,
"maxNum": 123,
"freeTimeout": 123,
"maxConcurrent": 123,
"gpuNum": 123,
"requestTimeout": 123
},
"ports": [
{
"port": "<string>"
}
],
"policy": {
"type": "<string>",
"value": 123
},
"image": {
"image": "<string>",
"authId": "<string>",
"command": "<string>"
},
"products": [
{
"id": "<string>"
}
],
"rootfsSize": 123,
"volumeMounts": [
{
"type": "<string>",
"size": 123,
"id": "<string>",
"mountPath": "<string>"
}
],
"clusterID": "<string>",
"envs": [
{
"key": "<string>",
"value": "<string>"
}
],
"healthy": {
"path": "<string>"
}
}
}
'import requests
url = "https://api.ppio.com/gpu-instance/openapi/v1/endpoint/create"
payload = { "endpoint": {
"name": "<string>",
"appName": "<string>",
"workerConfig": {
"minNum": 123,
"maxNum": 123,
"freeTimeout": 123,
"maxConcurrent": 123,
"gpuNum": 123,
"requestTimeout": 123
},
"ports": [{ "port": "<string>" }],
"policy": {
"type": "<string>",
"value": 123
},
"image": {
"image": "<string>",
"authId": "<string>",
"command": "<string>"
},
"products": [{ "id": "<string>" }],
"rootfsSize": 123,
"volumeMounts": [
{
"type": "<string>",
"size": 123,
"id": "<string>",
"mountPath": "<string>"
}
],
"clusterID": "<string>",
"envs": [
{
"key": "<string>",
"value": "<string>"
}
],
"healthy": { "path": "<string>" }
} }
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
endpoint: {
name: '<string>',
appName: '<string>',
workerConfig: {
minNum: 123,
maxNum: 123,
freeTimeout: 123,
maxConcurrent: 123,
gpuNum: 123,
requestTimeout: 123
},
ports: [{port: '<string>'}],
policy: {type: '<string>', value: 123},
image: {image: '<string>', authId: '<string>', command: '<string>'},
products: [{id: '<string>'}],
rootfsSize: 123,
volumeMounts: [{type: '<string>', size: 123, id: '<string>', mountPath: '<string>'}],
clusterID: '<string>',
envs: [{key: '<string>', value: '<string>'}],
healthy: {path: '<string>'}
}
})
};
fetch('https://api.ppio.com/gpu-instance/openapi/v1/endpoint/create', 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://api.ppio.com/gpu-instance/openapi/v1/endpoint/create",
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([
'endpoint' => [
'name' => '<string>',
'appName' => '<string>',
'workerConfig' => [
'minNum' => 123,
'maxNum' => 123,
'freeTimeout' => 123,
'maxConcurrent' => 123,
'gpuNum' => 123,
'requestTimeout' => 123
],
'ports' => [
[
'port' => '<string>'
]
],
'policy' => [
'type' => '<string>',
'value' => 123
],
'image' => [
'image' => '<string>',
'authId' => '<string>',
'command' => '<string>'
],
'products' => [
[
'id' => '<string>'
]
],
'rootfsSize' => 123,
'volumeMounts' => [
[
'type' => '<string>',
'size' => 123,
'id' => '<string>',
'mountPath' => '<string>'
]
],
'clusterID' => '<string>',
'envs' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'healthy' => [
'path' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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://api.ppio.com/gpu-instance/openapi/v1/endpoint/create"
payload := strings.NewReader("{\n \"endpoint\": {\n \"name\": \"<string>\",\n \"appName\": \"<string>\",\n \"workerConfig\": {\n \"minNum\": 123,\n \"maxNum\": 123,\n \"freeTimeout\": 123,\n \"maxConcurrent\": 123,\n \"gpuNum\": 123,\n \"requestTimeout\": 123\n },\n \"ports\": [\n {\n \"port\": \"<string>\"\n }\n ],\n \"policy\": {\n \"type\": \"<string>\",\n \"value\": 123\n },\n \"image\": {\n \"image\": \"<string>\",\n \"authId\": \"<string>\",\n \"command\": \"<string>\"\n },\n \"products\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"rootfsSize\": 123,\n \"volumeMounts\": [\n {\n \"type\": \"<string>\",\n \"size\": 123,\n \"id\": \"<string>\",\n \"mountPath\": \"<string>\"\n }\n ],\n \"clusterID\": \"<string>\",\n \"envs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"healthy\": {\n \"path\": \"<string>\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ppio.com/gpu-instance/openapi/v1/endpoint/create")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"endpoint\": {\n \"name\": \"<string>\",\n \"appName\": \"<string>\",\n \"workerConfig\": {\n \"minNum\": 123,\n \"maxNum\": 123,\n \"freeTimeout\": 123,\n \"maxConcurrent\": 123,\n \"gpuNum\": 123,\n \"requestTimeout\": 123\n },\n \"ports\": [\n {\n \"port\": \"<string>\"\n }\n ],\n \"policy\": {\n \"type\": \"<string>\",\n \"value\": 123\n },\n \"image\": {\n \"image\": \"<string>\",\n \"authId\": \"<string>\",\n \"command\": \"<string>\"\n },\n \"products\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"rootfsSize\": 123,\n \"volumeMounts\": [\n {\n \"type\": \"<string>\",\n \"size\": 123,\n \"id\": \"<string>\",\n \"mountPath\": \"<string>\"\n }\n ],\n \"clusterID\": \"<string>\",\n \"envs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"healthy\": {\n \"path\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ppio.com/gpu-instance/openapi/v1/endpoint/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"endpoint\": {\n \"name\": \"<string>\",\n \"appName\": \"<string>\",\n \"workerConfig\": {\n \"minNum\": 123,\n \"maxNum\": 123,\n \"freeTimeout\": 123,\n \"maxConcurrent\": 123,\n \"gpuNum\": 123,\n \"requestTimeout\": 123\n },\n \"ports\": [\n {\n \"port\": \"<string>\"\n }\n ],\n \"policy\": {\n \"type\": \"<string>\",\n \"value\": 123\n },\n \"image\": {\n \"image\": \"<string>\",\n \"authId\": \"<string>\",\n \"command\": \"<string>\"\n },\n \"products\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"rootfsSize\": 123,\n \"volumeMounts\": [\n {\n \"type\": \"<string>\",\n \"size\": 123,\n \"id\": \"<string>\",\n \"mountPath\": \"<string>\"\n }\n ],\n \"clusterID\": \"<string>\",\n \"envs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"healthy\": {\n \"path\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>"
}Endpoint
创建 Endpoint
POST
/
gpu-instance
/
openapi
/
v1
/
endpoint
/
create
创建 Endpoint
curl --request POST \
--url https://api.ppio.com/gpu-instance/openapi/v1/endpoint/create \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"endpoint": {
"name": "<string>",
"appName": "<string>",
"workerConfig": {
"minNum": 123,
"maxNum": 123,
"freeTimeout": 123,
"maxConcurrent": 123,
"gpuNum": 123,
"requestTimeout": 123
},
"ports": [
{
"port": "<string>"
}
],
"policy": {
"type": "<string>",
"value": 123
},
"image": {
"image": "<string>",
"authId": "<string>",
"command": "<string>"
},
"products": [
{
"id": "<string>"
}
],
"rootfsSize": 123,
"volumeMounts": [
{
"type": "<string>",
"size": 123,
"id": "<string>",
"mountPath": "<string>"
}
],
"clusterID": "<string>",
"envs": [
{
"key": "<string>",
"value": "<string>"
}
],
"healthy": {
"path": "<string>"
}
}
}
'import requests
url = "https://api.ppio.com/gpu-instance/openapi/v1/endpoint/create"
payload = { "endpoint": {
"name": "<string>",
"appName": "<string>",
"workerConfig": {
"minNum": 123,
"maxNum": 123,
"freeTimeout": 123,
"maxConcurrent": 123,
"gpuNum": 123,
"requestTimeout": 123
},
"ports": [{ "port": "<string>" }],
"policy": {
"type": "<string>",
"value": 123
},
"image": {
"image": "<string>",
"authId": "<string>",
"command": "<string>"
},
"products": [{ "id": "<string>" }],
"rootfsSize": 123,
"volumeMounts": [
{
"type": "<string>",
"size": 123,
"id": "<string>",
"mountPath": "<string>"
}
],
"clusterID": "<string>",
"envs": [
{
"key": "<string>",
"value": "<string>"
}
],
"healthy": { "path": "<string>" }
} }
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
endpoint: {
name: '<string>',
appName: '<string>',
workerConfig: {
minNum: 123,
maxNum: 123,
freeTimeout: 123,
maxConcurrent: 123,
gpuNum: 123,
requestTimeout: 123
},
ports: [{port: '<string>'}],
policy: {type: '<string>', value: 123},
image: {image: '<string>', authId: '<string>', command: '<string>'},
products: [{id: '<string>'}],
rootfsSize: 123,
volumeMounts: [{type: '<string>', size: 123, id: '<string>', mountPath: '<string>'}],
clusterID: '<string>',
envs: [{key: '<string>', value: '<string>'}],
healthy: {path: '<string>'}
}
})
};
fetch('https://api.ppio.com/gpu-instance/openapi/v1/endpoint/create', 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://api.ppio.com/gpu-instance/openapi/v1/endpoint/create",
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([
'endpoint' => [
'name' => '<string>',
'appName' => '<string>',
'workerConfig' => [
'minNum' => 123,
'maxNum' => 123,
'freeTimeout' => 123,
'maxConcurrent' => 123,
'gpuNum' => 123,
'requestTimeout' => 123
],
'ports' => [
[
'port' => '<string>'
]
],
'policy' => [
'type' => '<string>',
'value' => 123
],
'image' => [
'image' => '<string>',
'authId' => '<string>',
'command' => '<string>'
],
'products' => [
[
'id' => '<string>'
]
],
'rootfsSize' => 123,
'volumeMounts' => [
[
'type' => '<string>',
'size' => 123,
'id' => '<string>',
'mountPath' => '<string>'
]
],
'clusterID' => '<string>',
'envs' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'healthy' => [
'path' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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://api.ppio.com/gpu-instance/openapi/v1/endpoint/create"
payload := strings.NewReader("{\n \"endpoint\": {\n \"name\": \"<string>\",\n \"appName\": \"<string>\",\n \"workerConfig\": {\n \"minNum\": 123,\n \"maxNum\": 123,\n \"freeTimeout\": 123,\n \"maxConcurrent\": 123,\n \"gpuNum\": 123,\n \"requestTimeout\": 123\n },\n \"ports\": [\n {\n \"port\": \"<string>\"\n }\n ],\n \"policy\": {\n \"type\": \"<string>\",\n \"value\": 123\n },\n \"image\": {\n \"image\": \"<string>\",\n \"authId\": \"<string>\",\n \"command\": \"<string>\"\n },\n \"products\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"rootfsSize\": 123,\n \"volumeMounts\": [\n {\n \"type\": \"<string>\",\n \"size\": 123,\n \"id\": \"<string>\",\n \"mountPath\": \"<string>\"\n }\n ],\n \"clusterID\": \"<string>\",\n \"envs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"healthy\": {\n \"path\": \"<string>\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ppio.com/gpu-instance/openapi/v1/endpoint/create")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"endpoint\": {\n \"name\": \"<string>\",\n \"appName\": \"<string>\",\n \"workerConfig\": {\n \"minNum\": 123,\n \"maxNum\": 123,\n \"freeTimeout\": 123,\n \"maxConcurrent\": 123,\n \"gpuNum\": 123,\n \"requestTimeout\": 123\n },\n \"ports\": [\n {\n \"port\": \"<string>\"\n }\n ],\n \"policy\": {\n \"type\": \"<string>\",\n \"value\": 123\n },\n \"image\": {\n \"image\": \"<string>\",\n \"authId\": \"<string>\",\n \"command\": \"<string>\"\n },\n \"products\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"rootfsSize\": 123,\n \"volumeMounts\": [\n {\n \"type\": \"<string>\",\n \"size\": 123,\n \"id\": \"<string>\",\n \"mountPath\": \"<string>\"\n }\n ],\n \"clusterID\": \"<string>\",\n \"envs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"healthy\": {\n \"path\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ppio.com/gpu-instance/openapi/v1/endpoint/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"endpoint\": {\n \"name\": \"<string>\",\n \"appName\": \"<string>\",\n \"workerConfig\": {\n \"minNum\": 123,\n \"maxNum\": 123,\n \"freeTimeout\": 123,\n \"maxConcurrent\": 123,\n \"gpuNum\": 123,\n \"requestTimeout\": 123\n },\n \"ports\": [\n {\n \"port\": \"<string>\"\n }\n ],\n \"policy\": {\n \"type\": \"<string>\",\n \"value\": 123\n },\n \"image\": {\n \"image\": \"<string>\",\n \"authId\": \"<string>\",\n \"command\": \"<string>\"\n },\n \"products\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"rootfsSize\": 123,\n \"volumeMounts\": [\n {\n \"type\": \"<string>\",\n \"size\": 123,\n \"id\": \"<string>\",\n \"mountPath\": \"<string>\"\n }\n ],\n \"clusterID\": \"<string>\",\n \"envs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"healthy\": {\n \"path\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>"
}请求头
枚举值:application/json。
Bearer 身份验证格式,例如:Bearer {{API 密钥}}。
请求体
Endpoint 配置信息。
隐藏 properties
隐藏 properties
Endpoint 名称。字符串,长度限制:0-220 字符。
应用名称(体现在 url 中)。应用名称是 Endpoint URL 的组成部分,支持自定义,默认为 Endpoint ID。
HTTP 端口。仅支持一个。支持的端口号范围:1-65535,其中 2222、2223、2224 为内部端口,不可使用。
显示 properties
显示 properties
HTTP 端口。
系统盘大小(GB)。当前填固定值 100。
集群信息,挂载云存储必填。且需要与云存储所在集群 ID 一致。字符串,长度限制:0-255 字符。
响应参数
创建的 Endpoint ID。
最后修改于 2026年6月16日
⌘I