获取镜像预热任务列表
curl --request GET \
--url https://api.ppio.com/gpu-instance/openapi/v1/image/prewarm \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>'import requests
url = "https://api.ppio.com/gpu-instance/openapi/v1/image/prewarm"
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'}
};
fetch('https://api.ppio.com/gpu-instance/openapi/v1/image/prewarm', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ppio.com/gpu-instance/openapi/v1/image/prewarm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ppio.com/gpu-instance/openapi/v1/image/prewarm"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ppio.com/gpu-instance/openapi/v1/image/prewarm")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ppio.com/gpu-instance/openapi/v1/image/prewarm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"imageName": "<string>",
"imageUrl": "<string>",
"repositoryAuth": "<string>",
"clusterId": "<string>",
"clusterName": "<string>",
"products": [
{
"productId": "<string>",
"productName": "<string>"
}
],
"imageSize": "<string>",
"createTime": "<string>",
"state": "<string>",
"completeTime": "<string>",
"note": "<string>",
"reason": {}
}
],
"total": 123
}镜像
获取镜像预热任务列表
GET
/
gpu-instance
/
openapi
/
v1
/
image
/
prewarm
获取镜像预热任务列表
curl --request GET \
--url https://api.ppio.com/gpu-instance/openapi/v1/image/prewarm \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>'import requests
url = "https://api.ppio.com/gpu-instance/openapi/v1/image/prewarm"
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'}
};
fetch('https://api.ppio.com/gpu-instance/openapi/v1/image/prewarm', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ppio.com/gpu-instance/openapi/v1/image/prewarm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ppio.com/gpu-instance/openapi/v1/image/prewarm"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ppio.com/gpu-instance/openapi/v1/image/prewarm")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ppio.com/gpu-instance/openapi/v1/image/prewarm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"imageName": "<string>",
"imageUrl": "<string>",
"repositoryAuth": "<string>",
"clusterId": "<string>",
"clusterName": "<string>",
"products": [
{
"productId": "<string>",
"productName": "<string>"
}
],
"imageSize": "<string>",
"createTime": "<string>",
"state": "<string>",
"completeTime": "<string>",
"note": "<string>",
"reason": {}
}
],
"total": 123
}请求头
string
必填
枚举值:application/json。
string
必填
Bearer 身份验证格式,例如:Bearer {{API 密钥}}。
查询参数
integer
页码,默认 1。
integer
每页数量,默认 10。
string
预热任务状态。可选值:
Pending:待处理Running:进行中Succeeded:成功Failed:失败
string
集群 ID。
string
镜像名或任务备注。
示例
curl --location --request GET 'https://api.ppio.com/gpu-instance/openapi/v1/image/prewarm' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{API_KEY}}'
响应参数
object[]
必填
任务列表。
隐藏 properties
隐藏 properties
string
必填
任务 ID。
string
必填
镜像名(取最后一段,去除 tag 部分)。
string
必填
镜像地址。
string
镜像认证 ID。
string
必填
集群 ID。
string
必填
集群名称。
string
必填
镜像大小(字节)。
string
必填
任务创建时间(Unix 时间戳秒)。
string
必填
任务状态。可选值:
Pending:待处理Running:进行中Succeeded:成功Failed:失败
string
任务完成时间(Unix 时间戳秒)。
string
任务备注。
[string]
任务原因或说明。
integer
必填
任务总数。
响应示例
{
"data": [
{
"id": "nzd5nyi4keefsv2d",
"imageName": "nginx",
"imageUrl": "nginx",
"clusterId": "cn-dev-1",
"clusterName": "v2测试(cn-dev-1)",
"products": [],
"imageSize": "72298048",
"createTime": "1757656178",
"state": "Succeeded",
"completeTime": "1757656207",
"note": "",
"reason": [],
"repositoryAuth": ""
},
{
"id": "fexahnwdp4l1ajva",
"imageName": "pytorch",
"imageUrl": "test-image.ppinfra.com/test-public/pytorch:v2",
"clusterId": "cn-dev-1",
"clusterName": "v2测试(cn-dev-1)",
"products": [
{
"productId": "4090.18c.60g.18c60g",
"productName": "RTX 4090 24GB 18c"
}
],
"imageSize": "6762128493",
"createTime": "1756361365",
"state": "Succeeded",
"completeTime": "1756361371",
"note": "",
"reason": [
"image pulled successfully"
],
"repositoryAuth": ""
}
],
"total": 2
}
最后修改于 2026年6月16日
⌘I