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>",
  "imageUrl": "<string>",
  "imageAuth": "<string>",
  "imageAuthId": "<string>",
  "ports": "<string>",
  "envs": [
    {
      "key": "<string>",
      "value": "<string>"
    }
  ],
  "tools": [
    {
      "name": "<string>",
      "port": "<string>",
      "type": "<string>"
    }
  ],
  "command": "<string>",
  "clusterId": "<string>",
  "localStorageMountPoint": "<string>",
  "networkStorages": [
    {
      "Id": "<string>",
      "mountPoint": "<string>"
    }
  ],
  "networkId": "<string>",
  "kind": "<string>"
}'
{
  "id": "<string>"
}

请求头

Content-Type
string
required

枚举值:application/json。

Authorization
string
required

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

请求体

name
string

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

productId
string
required

用于部署实例的产品 ID。可以调用获取 CPU 产品列表接口查询。字符串,长度限制:1-255 字符。

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

容器启动命令。该配置会覆盖 Docker 镜像的 CMD。字符串,长度限制:0-2047 字符。

clusterId
string

指定集群 ID 创建实例,填空值则随机在一个集群创建实例。字符串,长度限制:0-255 字符。

localStorageMountPoint
string

本地存储的挂载路径。默认值:“/workspace”,字符串,长度限制:1-4095 字符。

networkStorages
object[]

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

networkId
string

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

kind
string
required

实例类型。可选值:cpu、gpu。取值固定为 cpu。

响应参数

id
string

创建的实例 ID。