POST /sandboxes
Create sandbox
Create a sandbox from the template
Тело запроса
Обязательно: да
application/json
Схема: NewSandbox
templateID·string· обязательноIdentifier of the required template
timeout·integer· необязательноTime to live for the sandbox in seconds.
Формат:
int32По умолчанию:
15Минимум:
0autoPause·boolean· необязательноAutomatically pauses the sandbox after the timeout
По умолчанию:
falseautoPauseMemory·boolean· необязательноControls the snapshot kind taken when the sandbox auto-pauses on timeout (only relevant when autoPause is true). When false, the auto-pause drops the in-memory state and persists only the filesystem (a filesystem-only snapshot); resuming it cold-boots (reboots) the sandbox from disk. Such a snapshot cannot be auto-resumed by traffic and must be resumed explicitly, so it cannot be combined with autoResume. Defaults to true (full memory snapshot).
По умолчанию:
trueautoResume·SandboxAutoResumeConfig· необязательноAuto-resume configuration for paused sandboxes.
autoResume.enabled·SandboxAutoResumeEnabled· обязательноAuto-resume enabled flag for paused sandboxes. Default false.
По умолчанию:
falsesecure·boolean· необязательноSecure all system communication with sandbox
allow_internet_access·boolean· необязательноAllow sandbox to access the internet. When set to false, it behaves the same as specifying denyOut to 0.0.0.0/0 in the network config.
network·SandboxNetworkConfig· необязательноnetwork.allowPublicTraffic·boolean· необязательноSpecify if the sandbox URLs should be accessible only with authentication.
По умолчанию:
truenetwork.allowOut·array<string>· необязательноList of allowed destinations for egress traffic. Each entry can be a CIDR block (e.g. "8.8.8.8/32"), a bare IP address (e.g. "8.8.8.8"), or a domain name (e.g. "example.com", "*.example.com"). Allowed entries always take precedence over denied entries.
network.denyOut·array<string>· необязательноList of denied CIDR blocks or IP addresses for egress traffic. Domain names are not supported for deny rules.
network.maskRequestHost·string· необязательноSpecify host mask which will be used for all sandbox requests
network.rules·object· необязательноPer-domain transform rules applied to matching egress HTTP/HTTPS requests. Keys are domains (e.g. "api.example.com", "example.com"). A domain listed here is not automatically allowed - use allowOut to permit the traffic.
network.rules.*·array<SandboxNetworkRule>· additional propertynetwork.rules.*.transform·SandboxNetworkTransform· необязательноTransformations applied to matching egress requests before forwarding.
network.rules.*.transform.headers·object· необязательноHTTP headers to inject or override in matching requests. An existing header with the same name is replaced. Values are plain strings; secret resolution happens client-side before sending to the API.
network.rules.*.transform.headers.*·string· additional propertymetadata·SandboxMetadata· необязательноmetadata.*·string· additional propertyMetadata of the sandbox
envVars·EnvVars· необязательноenvVars.*·string· additional propertyEnvironment variables for the sandbox
iam·SandboxIam· необязательноSandbox workload identity configuration. A non-empty, valid tokens map enables workload identity for the sandbox.
iam.tokens·SandboxIamTokens· необязательноNamed workload-token definitions, keyed by a caller-chosen token name.
iam.tokens.*·SandboxIamToken· additional propertyiam.tokens.*.audience·string· обязательноAudience of the workload token, stored exactly as provided.
iam.tokens.*.tokenType·string· обязательноWorkload token type.
Ответы
201
The sandbox was created successfully
Content-Type: application/json
Схема: Sandbox
templateID·string· обязательноIdentifier of the template from which is the sandbox created
sandboxID·string· обязательноIdentifier of the sandbox
alias·string· необязательноAlias of the template
envdVersion·EnvdVersion· обязательноVersion of the envd running in the sandbox
domain·string | null· необязательноBase domain where the sandbox traffic is accessible
401
Authentication error
Content-Type: application/json
Схема: Error
code·integer· обязательноError code
Формат:
int32message·string· обязательноError
400
Bad request
Content-Type: application/json
Схема: Error
code·integer· обязательноError code
Формат:
int32message·string· обязательноError
500
Server error
Content-Type: application/json
Схема: Error
code·integer· обязательноError code
Формат:
int32message·string· обязательноError