GET
/
gpu-instance
/
openapi
/
v1
/
gpu
/
instances
curl --request GET \
  --url https://api.ppinfra.com/gpu-instance/openapi/v1/gpu/instances \
  --header 'Authorization: <authorization>'
{
  "instances": [
    {
      "id": "<string>",
      "name": "<string>",
      "clusterId": "<string>",
      "clusterName": "<string>",
      "status": "<string>",
      "imageUrl": "<string>",
      "imageAuthId": "<string>",
      "command": "<string>",
      "cpuNum": "<string>",
      "memory": "<string>",
      "gpuNum": "<string>",
      "portMappings": [
        {
          "port": 123,
          "type": "<string>"
        }
      ],
      "productId": "<string>",
      "productName": "<string>",
      "rootfsSize": 123,
      "volumeMounts": [
        {
          "type": "<string>",
          "size": "<string>",
          "id": "<string>",
          "mountPath": "<string>"
        }
      ],
      "statusError": {
        "state": "<string>",
        "message": "<string>"
      },
      "envs": [
        {
          "key": "<string>",
          "value": "<string>"
        }
      ],
      "kind": "<string>",
      "billingMode": "<string>",
      "endTime": "<string>"
    }
  ]
}

请求头

Authorization
string
required

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

查询参数

pageSize
integer
required

每页返回的最大条数。整数,取值 >= 0。

pageNum
integer
required

获取第几页。整数,取值 >= 0。

name
string

实例名称(支持模糊查询)。字符串,长度限制:0-255 字符。

productName
string

产品名称(支持模糊查询)。字符串,长度限制:0-255 字符。

status
string

实例状态。字符串,长度限制:0-63 字符。可选值:

  • toCreate:待创建
  • creating:创建中
  • pulling:拉取镜像中
  • running:运行中
  • toStart:待启动
  • starting:启动中
  • toStop:待停止
  • stopping:停止中
  • exited:已停止
  • toRestart:待重启
  • restarting:重启中
  • toRemove:待删除
  • removing:删除中
  • removed:已删除
  • toReset:待重置(升级)
  • resetting:重置中
  • migrating:迁移中
  • freezing:冻结中

响应参数

instances
object[]
required

实例信息。