跳转到主要内容
GET
/
gpu-instance
/
openapi
/
v1
/
template
获取模板详情
curl --request GET \
  --url https://api.ppinfra.com/gpu-instance/openapi/v1/template \
  --header 'Authorization: <authorization>'
{
  "template": {
    "Id": "<string>",
    "name": "<string>",
    "readme": "<string>",
    "type": "<string>",
    "channel": "<string>",
    "image": "<string>",
    "imageAuth": "<string>",
    "startCommand": "<string>",
    "rootfsSize": 123,
    "ports": [
      {}
    ],
    "envs": [
      {}
    ],
    "tools": [
      {}
    ],
    "createdAt": "<string>",
    "recommendCards": [
      {}
    ],
    "minCudaVersion": "<string>"
  }
}

请求头

Authorization
string
required
Bearer 身份验证格式,例如:Bearer {{API 密钥}}。

查询参数

templateId
string
required
模板 ID。

响应参数

template
object
required
模板信息。

示例

请求示例

curl --location --request GET 'https://api.ppinfra.com/gpu-instance/openapi/v1/template?templateId=101038' \
--header 'Authorization: Bearer {{API 密钥}}'

响应示例

{
  "template": {
    "Id": "1",
    "name": "Pytorch:v2",
    "readme": "...",
    "type": "instance",
    "channel": "official",
    "image": "test-image.ppinfra.com/test-public/pytorch:v2",
    "imageAuth": "",
    "startCommand": "",
    "rootfsSize": 100,
    "ports": [
      {"type": "http", "ports": [80]},
      {"type": "tcp", "ports": [7860]}
    ],
    "envs": [{"key": "test", "value": "template"}],
    "tools": [{"name": "Jupyter", "describe": "Start Jupyter Notebook", "port": 8888, "type": "http"}],
    "createdAt": "1715760544",
    "recommendCards": [{"gpuSpecId": "4090.18c.60g", "cardNum": "2"}],
    "minCudaVersion": "11.8"
  }
}
I