请求头
枚举值:application/json。
Bearer 身份验证格式,例如:Bearer {{API 密钥}}。
请求体
模板信息对象,用于定义实例模板配置。
Hide properties
Hide properties
模板 ID。长度:[1-255]。
模板名称。长度:[1-255]。
模板类型。可选值:
instance
模板可见性。可选值:
private
模板说明,支持 Markdown。长度:[0-102400]。
镜像地址,可为公共镜像或私有镜像。长度:[1-500]。
私有镜像认证信息 ID。长度:[0-255]。
启动命令。长度:[0-2047]。
系统盘大小(单位:GB)。取值范围:> 0。
模板支持的最小 CUDA 版本,需填写指定格式,例如:11.8、12.4。长度:[0-255]。
响应参数
模板 ID。
示例
请求示例
Copy
curl --location --request POST 'https://api.ppinfra.com/gpu-instance/openapi/v1/template/update' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{API 密钥}}' \
--data-raw '{
"template": {
"Id": "101036",
"name": "test",
"type": "instance",
"channel": "private",
"readme": "test create template",
"image": "nginx",
"imageAuth": "",
"startCommand": "echo test",
"rootfsSize": 60,
"ports": [
{"type": "http", "ports": [80, 443]},
{"type": "tcp", "ports": [90, 95]}
],
"envs": [
{"key": "test1", "value": "template1"},
{"key": "test2", "value": "test2"}
],
"minCudaVersion": "11.8"
}
}'
响应示例
Copy
{
"templateId": "101036"
}