POST
/
gpu-instance
/
openapi
/
v1
/
gpu
/
instance
/
create
curl --request POST \
  --url https://api.ppinfra.com/gpu-instance/openapi/v1/gpu/instance/create \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '{
  "name": "<string>",
  "productId": "<string>",
  "gpuNum": 123,
  "rootfsSize": 123,
  "imageUrl": "<string>",
  "imageAuth": "<string>",
  "imageAuthId": "<string>",
  "ports": "<string>",
  "envs": [
    {
      "key": "<string>",
      "value": "<string>"
    }
  ],
  "tools": [
    {
      "name": "<string>",
      "port": "<string>",
      "type": "<string>"
    }
  ],
  "command": "<string>",
  "clusterId": "<string>",
  "networkStorages": [
    {
      "Id": "<string>",
      "mountPoint": "<string>"
    }
  ],
  "networkId": "<string>",
  "kind": "<string>",
  "month": 123
}'
{
  "id": "<string>"
}

请求头

Content-Type
string
required

枚举值:application/json。

Authorization
string
required

Bearer 身份验证格式,例如:Bearer {{API 密钥}}。

请求体

name
string

实例名称。字符串,长度限制:0-255 字符。

productId
string
required

GPU 产品 ID。字符串,长度限制:1-255 字符。可以调用获取 GPU 产品列表接口查询。

gpuNum
integer
required

GPU 数量。整数,取值范围:[1, 8]。

rootfsSize
integer
required

系统盘大小。整数,取值范围:[10, 6144]。最小值小于 10 GB 时,系统会默认设置为 10GB。最大值上限受可用存储资源限制动态变化,可通过产品列表接口查询。

imageUrl
string
required

镜像地址。字符串,长度限制:1-500 字符。

imageAuth
string

镜像认证(username:password)。字符串,长度限制:0-10239 字符。

imageAuthId
string

镜像仓库认证ID。

ports
string

实例开放端口,示例: 80/http, 3306/tcp。支持的端口号范围:[1-65535],其中 2222, 2223, 2224 为内部端口,不可使用。支持的端口类型为 [tcp、http]。ports + tools 最多使用 15 个端口。

envs
object[]

实例环境变量。最多创建 30 组环境变量。

tools
object[]

是否开启官方镜像支持工具。目前部分官方镜像仅包含 Jupyter。ports + tools 最多使用 15 个端口。

command
string

实例启动命令。字符串,长度限制:0-2047 字符。

clusterId
string

指定集群 ID 创建实例,填空值则随机在一个集群创建实例。

networkStorages
object[]

云挂载配置。最多支持挂载 30 个云存储。

networkId
string

vpc网络ID,不使用 vpc 网络则填空值。

kind
string
required

实例类型。取值范围:[gpu、cpu]。

month
integer

包年包月实例月份,填 0 则创建按量付费实例。整数,取值范围:大于等于 0。

响应参数

id
string

创建的实例 ID。