查询模板详情
curl --request GET \
--url https://api.ppio.com/gpus/v2/templates/{template_id} \
--header 'Authorization: <authorization>'import requests
url = "https://api.ppio.com/gpus/v2/templates/{template_id}"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.ppio.com/gpus/v2/templates/{template_id}', 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/gpus/v2/templates/{template_id}",
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>"
],
]);
$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/gpus/v2/templates/{template_id}"
req, _ := http.NewRequest("GET", url, nil)
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/gpus/v2/templates/{template_id}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ppio.com/gpus/v2/templates/{template_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"id": "tpl-001",
"owner_id": "owner-001",
"name": "pytorch-2.3-cuda12",
"type": "instance",
"visibility": "community",
"image": "registry.example.com/ml/pytorch:2.3-cuda12",
"registry_auth_id": "auth-001",
"command": "",
"entrypoint": "/bin/bash",
"rootfs_size_gb": 50,
"ports": [
{
"protocol": "http",
"port": 8888
}
],
"envs": [
{
"key": "ENV",
"value": "prod"
}
],
"metadata": {
"readme": "PyTorch 2.3 with CUDA 12",
"logo": "https://example.com/logo.png",
"description": "PyTorch development template",
"author": "PAI",
"tags": [
"pytorch",
"cuda"
]
},
"min_cuda_version": "12.2",
"created_at": 1715750400,
"updated_at": 1715750400,
"member_id": "550e8400-e29b-41d4-a716-446655440000"
}模板
查询模板详情
GET
/
gpus
/
v2
/
templates
/
{template_id}
查询模板详情
curl --request GET \
--url https://api.ppio.com/gpus/v2/templates/{template_id} \
--header 'Authorization: <authorization>'import requests
url = "https://api.ppio.com/gpus/v2/templates/{template_id}"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.ppio.com/gpus/v2/templates/{template_id}', 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/gpus/v2/templates/{template_id}",
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>"
],
]);
$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/gpus/v2/templates/{template_id}"
req, _ := http.NewRequest("GET", url, nil)
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/gpus/v2/templates/{template_id}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ppio.com/gpus/v2/templates/{template_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"id": "tpl-001",
"owner_id": "owner-001",
"name": "pytorch-2.3-cuda12",
"type": "instance",
"visibility": "community",
"image": "registry.example.com/ml/pytorch:2.3-cuda12",
"registry_auth_id": "auth-001",
"command": "",
"entrypoint": "/bin/bash",
"rootfs_size_gb": 50,
"ports": [
{
"protocol": "http",
"port": 8888
}
],
"envs": [
{
"key": "ENV",
"value": "prod"
}
],
"metadata": {
"readme": "PyTorch 2.3 with CUDA 12",
"logo": "https://example.com/logo.png",
"description": "PyTorch development template",
"author": "PAI",
"tags": [
"pytorch",
"cuda"
]
},
"min_cuda_version": "12.2",
"created_at": 1715750400,
"updated_at": 1715750400,
"member_id": "550e8400-e29b-41d4-a716-446655440000"
}请求头
Bearer 身份验证格式,例如:Bearer {{API 密钥}}。
路径参数
模板 ID。字符串,长度限制:1-255 字符。
查询参数
是否查询社区模板。
响应
200 - application/json
成功
模板 ID
示例:
"tpl-001"
所属用户 ID
示例:
"owner-001"
模板名称
示例:
"pytorch-2.3-cuda12"
模板类型
示例:
"instance"
可见性
示例:
"community"
镜像地址
示例:
"registry.example.com/ml/pytorch:2.3-cuda12"
镜像仓库认证 ID
示例:
"auth-001"
启动命令
示例:
""
镜像入口命令
示例:
"/bin/bash"
系统盘大小。单位为 GB
示例:
50
暴露端口配置
Show child attributes
Show child attributes
环境变量
Show child attributes
Show child attributes
模板元数据
Show child attributes
Show child attributes
最低 CUDA 版本
示例:
"12.2"
创建时间。Unix 时间戳
示例:
1715750400
更新时间。Unix 时间戳
示例:
1715750400
创建成员 ID
示例:
"550e8400-e29b-41d4-a716-446655440000"
最后修改于 2026年6月22日
⌘I