升级实例
curl --request POST \
--url https://api.ppio.com/gpu-instance/openapi/v1/gpu/instance/upgrade \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"instanceId": "<string>",
"imageUrl": "<string>",
"imageAuthId": "<string>",
"envs": [
{
"key": "<string>",
"value": "<string>"
}
],
"command": "<string>",
"entrypoint": "<string>",
"save": true,
"networkVolume": {
"volumeMounts": [
{
"type": "<string>",
"id": "<string>",
"mountPath": "<string>"
}
]
}
}
'import requests
url = "https://api.ppio.com/gpu-instance/openapi/v1/gpu/instance/upgrade"
payload = {
"instanceId": "<string>",
"imageUrl": "<string>",
"imageAuthId": "<string>",
"envs": [
{
"key": "<string>",
"value": "<string>"
}
],
"command": "<string>",
"entrypoint": "<string>",
"save": True,
"networkVolume": { "volumeMounts": [
{
"type": "<string>",
"id": "<string>",
"mountPath": "<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({
instanceId: '<string>',
imageUrl: '<string>',
imageAuthId: '<string>',
envs: [{key: '<string>', value: '<string>'}],
command: '<string>',
entrypoint: '<string>',
save: true,
networkVolume: {volumeMounts: [{type: '<string>', id: '<string>', mountPath: '<string>'}]}
})
};
fetch('https://api.ppio.com/gpu-instance/openapi/v1/gpu/instance/upgrade', 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/gpu/instance/upgrade",
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([
'instanceId' => '<string>',
'imageUrl' => '<string>',
'imageAuthId' => '<string>',
'envs' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'command' => '<string>',
'entrypoint' => '<string>',
'save' => true,
'networkVolume' => [
'volumeMounts' => [
[
'type' => '<string>',
'id' => '<string>',
'mountPath' => '<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/gpu/instance/upgrade"
payload := strings.NewReader("{\n \"instanceId\": \"<string>\",\n \"imageUrl\": \"<string>\",\n \"imageAuthId\": \"<string>\",\n \"envs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"command\": \"<string>\",\n \"entrypoint\": \"<string>\",\n \"save\": true,\n \"networkVolume\": {\n \"volumeMounts\": [\n {\n \"type\": \"<string>\",\n \"id\": \"<string>\",\n \"mountPath\": \"<string>\"\n }\n ]\n }\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/gpu/instance/upgrade")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"instanceId\": \"<string>\",\n \"imageUrl\": \"<string>\",\n \"imageAuthId\": \"<string>\",\n \"envs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"command\": \"<string>\",\n \"entrypoint\": \"<string>\",\n \"save\": true,\n \"networkVolume\": {\n \"volumeMounts\": [\n {\n \"type\": \"<string>\",\n \"id\": \"<string>\",\n \"mountPath\": \"<string>\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ppio.com/gpu-instance/openapi/v1/gpu/instance/upgrade")
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 \"instanceId\": \"<string>\",\n \"imageUrl\": \"<string>\",\n \"imageAuthId\": \"<string>\",\n \"envs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"command\": \"<string>\",\n \"entrypoint\": \"<string>\",\n \"save\": true,\n \"networkVolume\": {\n \"volumeMounts\": [\n {\n \"type\": \"<string>\",\n \"id\": \"<string>\",\n \"mountPath\": \"<string>\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body实例
升级实例
POST
/
gpu-instance
/
openapi
/
v1
/
gpu
/
instance
/
upgrade
升级实例
curl --request POST \
--url https://api.ppio.com/gpu-instance/openapi/v1/gpu/instance/upgrade \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"instanceId": "<string>",
"imageUrl": "<string>",
"imageAuthId": "<string>",
"envs": [
{
"key": "<string>",
"value": "<string>"
}
],
"command": "<string>",
"entrypoint": "<string>",
"save": true,
"networkVolume": {
"volumeMounts": [
{
"type": "<string>",
"id": "<string>",
"mountPath": "<string>"
}
]
}
}
'import requests
url = "https://api.ppio.com/gpu-instance/openapi/v1/gpu/instance/upgrade"
payload = {
"instanceId": "<string>",
"imageUrl": "<string>",
"imageAuthId": "<string>",
"envs": [
{
"key": "<string>",
"value": "<string>"
}
],
"command": "<string>",
"entrypoint": "<string>",
"save": True,
"networkVolume": { "volumeMounts": [
{
"type": "<string>",
"id": "<string>",
"mountPath": "<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({
instanceId: '<string>',
imageUrl: '<string>',
imageAuthId: '<string>',
envs: [{key: '<string>', value: '<string>'}],
command: '<string>',
entrypoint: '<string>',
save: true,
networkVolume: {volumeMounts: [{type: '<string>', id: '<string>', mountPath: '<string>'}]}
})
};
fetch('https://api.ppio.com/gpu-instance/openapi/v1/gpu/instance/upgrade', 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/gpu/instance/upgrade",
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([
'instanceId' => '<string>',
'imageUrl' => '<string>',
'imageAuthId' => '<string>',
'envs' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'command' => '<string>',
'entrypoint' => '<string>',
'save' => true,
'networkVolume' => [
'volumeMounts' => [
[
'type' => '<string>',
'id' => '<string>',
'mountPath' => '<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/gpu/instance/upgrade"
payload := strings.NewReader("{\n \"instanceId\": \"<string>\",\n \"imageUrl\": \"<string>\",\n \"imageAuthId\": \"<string>\",\n \"envs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"command\": \"<string>\",\n \"entrypoint\": \"<string>\",\n \"save\": true,\n \"networkVolume\": {\n \"volumeMounts\": [\n {\n \"type\": \"<string>\",\n \"id\": \"<string>\",\n \"mountPath\": \"<string>\"\n }\n ]\n }\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/gpu/instance/upgrade")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"instanceId\": \"<string>\",\n \"imageUrl\": \"<string>\",\n \"imageAuthId\": \"<string>\",\n \"envs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"command\": \"<string>\",\n \"entrypoint\": \"<string>\",\n \"save\": true,\n \"networkVolume\": {\n \"volumeMounts\": [\n {\n \"type\": \"<string>\",\n \"id\": \"<string>\",\n \"mountPath\": \"<string>\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ppio.com/gpu-instance/openapi/v1/gpu/instance/upgrade")
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 \"instanceId\": \"<string>\",\n \"imageUrl\": \"<string>\",\n \"imageAuthId\": \"<string>\",\n \"envs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"command\": \"<string>\",\n \"entrypoint\": \"<string>\",\n \"save\": true,\n \"networkVolume\": {\n \"volumeMounts\": [\n {\n \"type\": \"<string>\",\n \"id\": \"<string>\",\n \"mountPath\": \"<string>\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body接口说明
升级实例时,参数必须全量传递。请求头
枚举值:application/json。
Bearer 身份验证格式,例如:Bearer {{API 密钥}}。
请求体
要升级的实例 ID。
容器镜像地址。字符串,长度限制:1-500 字符。
镜像仓库认证 ID。
容器启动命令。字符串,长度限制:0-2047 字符。
容器启动 entrypoint。该配置会覆盖 Docker 镜像的 ENTRYPOINT。字符串,长度限制:0-2047 字符。
是否保存旧实例中的数据。布尔值,取值:true、false。
最后修改于 2026年6月16日
⌘I