跳转到内容
EN

设置构建标签

POST/sandbox/v1/templates/tags● 支持

请求体

  • targetstring必填

    Target template in "name:tag" format

  • tagsarray必填

    Tags to assign to the template

返回

200

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

请求示例

curl
curl https://api.deepraxis.com/sandbox/v1/templates/tags \
  -H "X-API-Key: $PRAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"target":"docs-template:b1","tags":["default","stable"]}'
Python
import requests

api_key = "$PRAXIS_API_KEY"

# templateID and buildID come from the preceding create response; replace the example IDs.
resp = requests.request("POST", "https://api.deepraxis.com/sandbox/v1/templates/tags",
    headers={"X-API-Key": api_key},
    json={"target":"docs-template:b1","tags":["default","stable"]},
)
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/tags", { method: "POST",
  headers: { "X-API-Key": apiKey, "Content-Type": "application/json" },
  body: JSON.stringify({"target":"docs-template:b1","tags":["default","stable"]}),
});
console.log(resp.status, await resp.text());

响应示例 200

{
  "tags": [
    "default",
    "stable"
  ],
  "buildID": "sbt_2158874f-2b56-49ee-beeb-f85922f8e362"
}

响应

HTTP 201

Tag assigned successfully

application/json

名称 类型 说明
tags array<string> Assigned tags of the template
buildID string Identifier of the build associated with these tags