Docs
Templates ›

Get template network

GET/v1/templates/{id}/network

What a sandbox on the template may reach outside itself, before the addresses of its own.

RequestTypeScript
  1. import { Agental } from "agental-sdk";
  2. const agental = new Agental();
  3. const template = await agental.templates.get("tpl_0123456789abcdef");
  4. const network = await template.network();
Answer200 OK · TemplateNetwork
  1. {
  2. "outbound": "open" | "blocked" | "allowlist",
  3. "allow": string[],
  4. }

The template's outbound rule.

Path

idrequired
string
e.g. "tpl_0123456789abcdef"

Headers

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

Returns

200 The template's outbound rule. One that was never set is open.

TemplateNetwork2 fields
outbound
openblockedallowlist
What a sandbox on the template may reach outside itself, before its own addresses.
More open is the internet, which is what a sandbox has when nothing is asked. blocked lets nothing out: names still resolve, and no connection leaves. allowlist lets out only what goes to an address in allow. It is enforced outside the sandbox, on the server it runs on, so nothing running in the sandbox can change it, root included. What reaches the sandbox is not affected: commands, files and its public addresses work as before. Whatever this says, no sandbox reaches another sandbox or a private network, or delivers mail on port 25.
allow
string[]
The IPv4 addresses and ranges an allowlist lets out to, over any protocol and port.
More Empty for open and blocked.

Errors and other answers

404 Not found.

Every error answers { "error": { "code", "message" } }; a key without the action a call needs answers 403 key_action_forbidden, naming it.