列出模板
GET
/sandbox/v1/templates● 支持请求参数
teamIDstring可选query: Upstream team selector; Praxis always lists the authenticated organization's templates.
nextTokenstring可选query: Cursor to start the list from
limitinteger可选query: Maximum number of items to return per page
返回
200
错误按 E2B 格式返回,参见 错误码
请求示例
curl
curl https://api.deepraxis.com/sandbox/v1/templates \
-H "X-API-Key: $PRAXIS_API_KEY"Python
import requests
api_key = "$PRAXIS_API_KEY"
# Call /sandbox/v1 directly over HTTP.
resp = requests.get(
"https://api.deepraxis.com/sandbox/v1/templates",
headers={"X-API-Key": api_key},
)
print(resp.status_code, resp.text)TypeScript
const apiKey = "$PRAXIS_API_KEY";
// Call /sandbox/v1 directly over HTTP.
const resp = await fetch(`https://api.deepraxis.com/sandbox/v1/templates`, {
headers: { "X-API-Key": apiKey },
});
console.log(resp.status, await resp.text());响应示例 200
[
{
"templateID": "node22",
"buildID": "sbr_base-base_node22@e2ba43b98ce1226ab5242303c33b5f36958784ad06dbc42c0ec439bea6e6dfcb",
"cpuCount": 1,
"memoryMB": 1983,
"diskSizeMB": 24242,
"public": true,
"aliases": [],
"names": [
"node22"
],
"createdAt": "1970-01-01T00:00:00.000Z",
"updatedAt": "1970-01-01T00:00:00.000Z",
"createdBy": null,
"lastSpawnedAt": null,
"spawnCount": 0,
"buildCount": 1,
"envdVersion": "0.9.0",
"buildStatus": "ready"
}
]响应
HTTP 200
Successfully returned all templates
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| [].templateID | string | Identifier of the template |
| [].buildID | string | Identifier of the last successful build for given template |
| [].cpuCount | integer | Requested virtual CPU count; a positive integer, default 2 for template builds. |
| [].memoryMB | integer | Requested build memory in MiB; a positive integer, default 1024. |
| [].diskSizeMB | integer | Disk size for the sandbox in MiB |
| [].public | boolean | Whether the template is public or only accessible by the team |
| [].aliases | array<string> | Aliases of the template |
| [].names | array<string> | Names of the template (namespace/alias format when namespaced) |
| [].createdAt | string | Time when the template was created |
| [].updatedAt | string | Time when the template was last updated |
| [].createdBy | object | Identity of the template creator; null for official templates. |
| [].createdBy.id | string | Identifier of the user |
| [].createdBy.email | string | Email of the user |
| [].lastSpawnedAt | string | Time when the template was last used |
| [].spawnCount | integer | Number of times the template was used |
| [].buildCount | integer | Number of times the template was built |
| [].envdVersion | string | Version of the envd running in the sandbox |
| [].buildStatus | string | Status of the template build |
| [].official | boolean | True for an official catalog template; false for your organization's custom templates. |
| [].sourceKind | string | dockerfile means Dockerfile source; image means a container image source; snapshot means a captured sandbox. Omitted on official templates and waiting builds with no source yet. |