设置构建标签
POST
/e2b/templates/tags● 支持请求体
targetstring必填Target template in "name:tag" format
tagsarray必填Tags to assign to the template
返回
200
错误按 E2B 格式返回,参见 错误码
请求示例
curl
curl https://api.deepraxis.com/e2b/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
opts = dict(
api_key="$PRAXIS_API_KEY",
api_url="https://api.deepraxis.com/e2b",
domain="sandbox.praxisusercontent.com",
)
# templateID and buildID come from the preceding create response; replace the example IDs.
resp = requests.request("POST", opts["api_url"] + "/templates/tags",
headers={"X-API-Key": opts["api_key"]},
json={"target":"docs-template:b1","tags":["default","stable"]},
)
print(resp.status_code, resp.text)TypeScript
const opts = {
apiKey: "$PRAXIS_API_KEY",
apiUrl: "https://api.deepraxis.com/e2b",
domain: "sandbox.praxisusercontent.com",
};
// templateID and buildID come from the preceding create response; replace the example IDs.
const resp = await fetch(opts.apiUrl + "/templates/tags", { method: "POST",
headers: { "X-API-Key": opts.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_e2d426b9-49b3-4082-ace8-ef369dd78c07"
}响应
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 |