Templates ›
Set template start
PUT
/v1/templates/{id}/startSets what a sandbox made from the template starts as, from now on: its size, a snapshot or a new machine, and how long it runs after each start. Sandboxes made before are never changed by it: their size, their disk and their time limit are their own. size, snapshotId and ttlSeconds sent with POST /v1/sandboxes win over this. size is sent each time, and a snapshotId left out is a new machine; a ttlSeconds left out stays as it was.
RequestTypeScript
- import { Agental } from "agental-sdk";
- const agental = new Agental();
- const template = await agental.templates.get("tpl_0123456789abcdef");
- await template.setStart({ size: "medium" });
Answer200 OK · TemplateStart
- {
- "size": "tiny" | "small" | "medium" | "large",
- "snapshotId": string | null,
- "ttlSeconds": integer | null,
- }
The template's start from now on.
Path
idrequiredstring | e.g. "tpl_0123456789abcdef" |
Headers
AuthorizationrequiredBearer key | An API key that may make this call. |
Body
sizerequired"tiny" | "small" | "medium" | "large" | |
snapshotIdstring or null | One of the snapshots of the template's account. Left out or null, a new machine. |
ttlSecondsinteger or null | Seconds a sandbox made from the template runs after each start before it is stopped. Null is the deployment's default, and left out it stays as it was. At most maxTtlSeconds of GET /v1/policy. Sandboxes made before keep their own. e.g. 7200 |
Returns
200 The template's start from now on.
TemplateStart3 fields
sizetinysmallmediumlarge
The size a sandbox made from the template is, when the create names none.
snapshotIdstringnull
The snapshot a sandbox made from the template starts as, when the create names none.
More
Null starts a new machine.ttlSecondsintegernull
Seconds a sandbox made from the template runs after each start before it is stopped, when the create names none.
More
Null is the deployment's default.Errors and other answers
| 400 | size_too_small the snapshot was taken on a size with more disk than this one. |
| 400 | ttl_too_long ttlSeconds is over maxTtlSeconds of GET /v1/policy. |
| 402 | size_not_on_plan the plan of the template's account does not make sandboxes of this size, and the message names the plan that does. The start is left as it was. The size it starts as already is never refused, so its snapshot alone can be changed. |
| 404 | not_found no such template, or no such snapshot in the template's account. |
Every error answers { "error": { "code", "message" } }; a key without the action a call needs answers 403 key_action_forbidden, naming it.