Put the bundle of a version into the local cache
const url = 'https://example.com/v1/t/adapters/edge/functions/example/1/warmup';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/t/adapters/edge/functions/example/1/warmup \ --header 'Authorization: Bearer <token>'Makes the next run skip the bundle download. Does nothing when the
bundle is already on the local disk. Otherwise downloads it from the
bucket or rebuilds it from original_code.
Permission
This operation needs the permission tenant:scenario_template:manage.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Function name inside the account. Needs at least one [A-Za-z0-9_]
character and must not be by-id. Other characters are not rejected.
Header Parameters
Section titled “Header Parameters”Names the target tenant.
By principal:
- A tenant-scoped principal may omit it.
- A principal with no tenant of its own names one here.
Refused when:
- A tenant-scoped principal sends a value naming any other tenant.
- A principal with no tenant of its own omits it.
Responses
Section titled “Responses”The bundle is on the local disk
object
Example
{ "ok": true, "warmed_up": true}Domain error. A failed bundle comes as 400 with
err_code: INTERNAL_SERVER_ERROR. On a run route a bundle that could
not be rebuilt is this 400 too.
object
Example
{ "ok": false, "err_code": "UNAUTHORIZED"}Unauthorized
Forbidden
No version with these keys in the account
object
Example
{ "ok": false, "error": "Function not found", "err_code": "NOT_FOUND"}The body, query or path params did not pass the zod schema
object
Zod issues as is
object
Example
{ "ok": false, "error": "Validation failed"}Unexpected error, for example a database or a disk failure. The body
has err_code: INTERNAL_SERVER_ERROR.
object
Example
{ "ok": false, "err_code": "UNAUTHORIZED"}Bad gateway (upstream adapter error)