创建镜像预热任务
curl --request POST \
--url https://api.ppio.com/gpu-instance/openapi/v1/image/prewarm \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"imageUrl": "<string>",
"repositoryAuth": "<string>",
"clusterId": "<string>",
"productIds": {},
"note": "<string>"
}
'import requests
url = "https://api.ppio.com/gpu-instance/openapi/v1/image/prewarm"
payload = {
"imageUrl": "<string>",
"repositoryAuth": "<string>",
"clusterId": "<string>",
"productIds": {},
"note": "<string>"
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
imageUrl: '<string>',
repositoryAuth: '<string>',
clusterId: '<string>',
productIds: {},
note: '<string>'
})
};
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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'imageUrl' => '<string>',
'repositoryAuth' => '<string>',
'clusterId' => '<string>',
'productIds' => [
],
'note' => '<string>'
]),
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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ppio.com/gpu-instance/openapi/v1/image/prewarm"
payload := strings.NewReader("{\n \"imageUrl\": \"<string>\",\n \"repositoryAuth\": \"<string>\",\n \"clusterId\": \"<string>\",\n \"productIds\": {},\n \"note\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://api.ppio.com/gpu-instance/openapi/v1/image/prewarm")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"imageUrl\": \"<string>\",\n \"repositoryAuth\": \"<string>\",\n \"clusterId\": \"<string>\",\n \"productIds\": {},\n \"note\": \"<string>\"\n}")
.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::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"imageUrl\": \"<string>\",\n \"repositoryAuth\": \"<string>\",\n \"clusterId\": \"<string>\",\n \"productIds\": {},\n \"note\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>"
}镜像
创建镜像预热任务
POST
/
gpu-instance
/
openapi
/
v1
/
image
/
prewarm
创建镜像预热任务
curl --request POST \
--url https://api.ppio.com/gpu-instance/openapi/v1/image/prewarm \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"imageUrl": "<string>",
"repositoryAuth": "<string>",
"clusterId": "<string>",
"productIds": {},
"note": "<string>"
}
'import requests
url = "https://api.ppio.com/gpu-instance/openapi/v1/image/prewarm"
payload = {
"imageUrl": "<string>",
"repositoryAuth": "<string>",
"clusterId": "<string>",
"productIds": {},
"note": "<string>"
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
imageUrl: '<string>',
repositoryAuth: '<string>',
clusterId: '<string>',
productIds: {},
note: '<string>'
})
};
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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'imageUrl' => '<string>',
'repositoryAuth' => '<string>',
'clusterId' => '<string>',
'productIds' => [
],
'note' => '<string>'
]),
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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ppio.com/gpu-instance/openapi/v1/image/prewarm"
payload := strings.NewReader("{\n \"imageUrl\": \"<string>\",\n \"repositoryAuth\": \"<string>\",\n \"clusterId\": \"<string>\",\n \"productIds\": {},\n \"note\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://api.ppio.com/gpu-instance/openapi/v1/image/prewarm")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"imageUrl\": \"<string>\",\n \"repositoryAuth\": \"<string>\",\n \"clusterId\": \"<string>\",\n \"productIds\": {},\n \"note\": \"<string>\"\n}")
.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::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"imageUrl\": \"<string>\",\n \"repositoryAuth\": \"<string>\",\n \"clusterId\": \"<string>\",\n \"productIds\": {},\n \"note\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>"
}请求头
枚举值:application/json。
Bearer 身份验证格式,例如:Bearer {{API 密钥}}。
请求体
镜像地址。
镜像认证 ID。
集群 ID。
产品 ID 列表。
任务备注。
示例
curl --location --request POST 'https://api.ppio.com/gpu-instance/openapi/v1/image/prewarm' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{API_KEY}}' \
--data-raw '{
"imageUrl": "nginx:latest",
"repositoryAuth": "",
"clusterId": "dev-test",
"productIds": [],
"note": "test"
}'
响应参数
预热任务 ID。
响应示例
{
"id": "nzd5nyi4keefsv2d"
}
最后修改于 2026年6月16日
⌘I