开始使用
实例
Endpoint
创建 Endpoint
POST
/
gpu-instance
/
openapi
/
v1
/
endpoint
/
create
curl --request POST \
--url https://api.ppinfra.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
}
],
"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>"
}
}
}'
{
"id": "<string>"
}
请求头
枚举值:application/json。
Bearer 身份验证格式,例如:Bearer {{API 密钥}}。
请求体
Endpoint 配置信息。
Endpoint 名称。字符串,长度限制:0-220 字符。
应用名称(体现在 url 中)。应用名称是 Endpoint URL 的组成部分,支持自定义,默认为 Endpoint ID。
HTTP 端口。仅支持一个。支持的端口号范围:1-65535,其中 2222、2223、2224 为内部端口,不可使用。
HTTP 端口。
系统盘大小(GB)。当前填固定值 100。
集群信息,挂载云存储必填。且需要与云存储所在集群 ID 一致。字符串,长度限制:0-255 字符。
响应参数
创建的 Endpoint ID。
curl --request POST \
--url https://api.ppinfra.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
}
],
"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>"
}
}
}'
{
"id": "<string>"
}