跳转到内容
EN

检查构建文件

GET/sandbox/v1/templates/{templateID}/files/{hash}○ 未支持

请求参数

  • templateIDstring必填

    path: Template identifier from templates.create or templates.list. Use your organization's templateID, not a provider handle.

  • hashstring必填

    path: Upstream file-content hash. Local COPY/ADD uploads are unavailable and this request returns 400.

返回

400

501 平台还没有实现这个端点;调用会得到下面这个响应:

错误按 E2B 格式返回,参见 错误码

请求示例

curl
curl https://api.deepraxis.com/sandbox/v1/templates/sbe_example/files/example-hash \
  -H "X-API-Key: $PRAXIS_API_KEY"
Python
import requests

api_key = "$PRAXIS_API_KEY"

# templateID and buildID come from the preceding create response; replace the example IDs.
resp = requests.request("GET", "https://api.deepraxis.com/sandbox/v1/templates/sbe_example/files/example-hash",
    headers={"X-API-Key": api_key},
)
print(resp.status_code, resp.text)
TypeScript
const apiKey = "$PRAXIS_API_KEY";

// templateID and buildID come from the preceding create response; replace the example IDs.
const resp = await fetch("https://api.deepraxis.com/sandbox/v1/templates/sbe_example/files/example-hash", { method: "GET",
  headers: { "X-API-Key": apiKey },
});
console.log(resp.status, await resp.text());

响应示例 400

{
  "code": 400,
  "error_code": "InvalidArgumentError",
  "message": "INVALID_PARAMS: 暂不支持 COPY 本地文件,请改用 RUN curl / git clone"
}

响应

HTTP 201

The upload link where to upload the tar file

application/json

名称 类型 说明
present boolean Whether the file is already present in the cache
url string Url where the file should be uploaded to
headers object Request headers that must be sent with the upload request