开始使用
实例
实例
查询实例列表
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>"
}
]
}
请求头
Bearer 身份验证格式,例如:Bearer {{API 密钥}}。
查询参数
每页返回的最大条数。整数,取值 >= 0。
获取第几页。整数,取值 >= 0。
实例名称(支持模糊查询)。字符串,长度限制:0-255 字符。
产品名称(支持模糊查询)。字符串,长度限制:0-255 字符。
实例状态。字符串,长度限制:0-63 字符。可选值:
toCreate
:待创建creating
:创建中pulling
:拉取镜像中running
:运行中toStart
:待启动starting
:启动中toStop
:待停止stopping
:停止中exited
:已停止toRestart
:待重启restarting
:重启中toRemove
:待删除removing
:删除中removed
:已删除toReset
:待重置(升级)resetting
:重置中migrating
:迁移中freezing
:冻结中
响应参数
实例信息。
实例 ID。
实例名称。
集群 ID。
集群名称。
实例状态。
容器镜像地址。
镜像仓库认证信息。
容器启动命令。
实例的 CPU 数。单位为核。
实例的内存大小。单位为 GB。
实例的 GPU 卡数。
用于部署实例的产品 ID。
用于部署实例的产品名称。
系统盘大小。单位为 GB。
实例类型。
实例的计费方式。取值:
-
onDemand:按量计费。
-
monthly:包年包月。
包年包月实例到期时间。若是按量计费实例,则返回 -1。
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>"
}
]
}