Docs
Templates ›

Set template start

PUT/v1/templates/{id}/start

Sets 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
  1. import { Agental } from "agental-sdk";
  2. const agental = new Agental();
  3. const template = await agental.templates.get("tpl_0123456789abcdef");
  4. await template.setStart({ size: "medium" });
Answer200 OK · TemplateStart
  1. {
  2. "size": "tiny" | "small" | "medium" | "large",
  3. "snapshotId": string | null,
  4. "ttlSeconds": integer | null,
  5. }

The template's start from now on.

Path

idrequired
string
e.g. "tpl_0123456789abcdef"

Headers

Authorizationrequired
Bearer key
An API key that may make this call.

Body

sizerequired
"tiny" | "small" | "medium" | "large"
snapshotId
string or null
One of the snapshots of the template's account. Left out or null, a new machine.
ttlSeconds
integer 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
size
tinysmallmediumlarge
The size a sandbox made from the template is, when the create names none.
snapshotId
stringnull
The snapshot a sandbox made from the template starts as, when the create names none.
More Null starts a new machine.
ttlSeconds
integernull
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

400size_too_small the snapshot was taken on a size with more disk than this one.
400ttl_too_long ttlSeconds is over maxTtlSeconds of GET /v1/policy.
402size_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.
404not_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.