GET
/
gpu-instance
/
openapi
/
v1
/
gpu
/
instance
curl --request GET \
  --url https://api.ppinfra.com/gpu-instance/openapi/v1/gpu/instance \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>'
{
  "id": "<string>",
  "name": "<string>",
  "clusterId": "<string>",
  "clusterName": "<string>",
  "status": "<string>",
  "sshCommand": "<string>",
  "sshPassword": "<string>",
  "imageUrl": "<string>",
  "imageAuthId": "<string>",
  "command": "<string>",
  "cpuNum": "<string>",
  "memory": "<string>",
  "gpuNum": "<string>",
  "createdAt": "<string>",
  "lastStartedAt": "<string>",
  "lastStoppedAt": "<string>",
  "useTime": "<string>",
  "portMappings": [
    {
      "port": 123,
      "endpoint": "<string>",
      "type": "<string>"
    }
  ],
  "billingMode": "<string>",
  "productId": "<string>",
  "productName": "<string>",
  "rootfsSize": 123,
  "volumeMounts": [
    {
      "type": "<string>",
      "size": 123,
      "Id": "<string>",
      "mountPath": "<string>"
    }
  ],
  "tools": {},
  "statusError": {
    "state": "<string>",
    "message": "<string>"
  },
  "envs": [
    {
      "key": "<string>",
      "value": "<string>"
    }
  ],
  "diskSize": 123,
  "instancePrice": "<string>",
  "localStoragePrice": "<string>",
  "exitedLocalStoragePrice": "<string>",
  "connectComponentSSH": {
    "port": 123,
    "address": "<string>",
    "systemLogAddress": "<string>",
    "instanceLogAddress": "<string>",
    "sshCommand": "<string>",
    "username": "<string>",
    "password": "<string>",
    "isRunning": true
  },
  "connectComponentWebTerminal": {
    "port": 123,
    "address": "<string>",
    "systemLogAddress": "<string>",
    "instanceLogAddress": "<string>",
    "sshCommand": "<string>",
    "username": "<string>",
    "password": "<string>",
    "isRunning": true
  },
  "connectComponentJupyter": {
    "port": 123,
    "address": "<string>",
    "systemLogAddress": "<string>",
    "instanceLogAddress": "<string>",
    "sshCommand": "<string>",
    "username": "<string>",
    "password": "<string>",
    "isRunning": true
  },
  "connectComponentLog": {
    "port": 123,
    "address": "<string>",
    "systemLogAddress": "<string>",
    "instanceLogAddress": "<string>",
    "sshCommand": "<string>",
    "username": "<string>",
    "password": "<string>",
    "isRunning": true
  }
}

请求头

Content-Type
string
required

枚举值: application/json

Authorization
string
required

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

查询参数

instanceId
string

要查询的实例 ID

响应参数

id
string

实例 ID

name
string

实例名称

clusterId
string

集群 ID

clusterName
string

集群名称

status
string

实例状态

sshCommand
string

用于远程登录的 SSH 命令。

sshPassword
string

用于远程登录的 SSH 密码。

imageUrl
string

实例的 Docker 镜像地址

imageAuthId
string

Docker 镜像的认证 ID

command
string

实例启动的命令

cpuNum
string

分配给实例的 CPU 数量(核/卡)

memory
string

分配给实例的内存(GB/卡)

gpuNum
string

分配给实例的 GPU 数量

createdAt
string

实例创建的时间戳

lastStartedAt
string

实例最后启动的时间戳

lastStoppedAt
string

实例最后停止的时间戳

useTime
string

实例已使用的总时间

portMappings
object[]
billingMode
string

实例的计费模式

productId
string

产品 ID

productName
string

产品名称

rootfsSize
integer

系统盘大小(GB)

volumeMounts
object[]
tools
[string]

官方镜像内置工具

statusError
object
envs
object[]
diskSize
integer

实例分配的本地磁盘空间(GB)

instancePrice
string

实例价格

localStoragePrice
string

本地存储价格

exitedLocalStoragePrice
string

已退出本地存储的价格

connectComponentSSH
object

实例 SSH 连接信息

connectComponentWebTerminal
object

实例 WebSSH 连接信息

connectComponentJupyter
object

实例 Jupyter 连接信息

connectComponentLog
object

实例日志连接信息。
如果实例日志需要持续获得日志输出,可以添加以下参数:
follow:是否持续输出日志,传 1 开启
sse:是否格式化输出日志(日志按行返回,以 data: 开头),传 1 开启
timestamps:是否需要时间戳,传 1 开启
tail:初始化日志时获取最后 x 行
示例(系统日志):https://c092dad5a76a3da2-2224.gpu-instance.ppinfra.com/sys?follow=1&sse=1&amptimestamps=1&tail=200
示例(实例日志):https://c092dad5a76a3da2-2224.gpu-instance.ppinfra.com/pod?follow=1&sse=1&amptimestamps=1&tail=200