Grant Egress
Adds one additive, independently revocable egress grant on top of the sandbox's base policy; the egress in force is the base unioned with every active grant. Takes effect on the proxy through the live policy feed without a restart. ttl_sec 0 means no expiry; otherwise at most 86400. The reason is recorded in the audit log. Rejects a missing policy (InvalidArgument) and a sandbox created without egress configured (FailedPrecondition); Unimplemented when egress signing is not configured. Returns the new grant id.
Access: namespace OPERATOR or above (write)
Authorization
BearerAuth A namespace-scoped API key (cpk_…) for machines, or a Xeonr Auth OIDC
token for humans. The key's namespace and role are pinned server-side.
In: header
Header Parameters
Define the version of the Connect protocol
Define the timeout, in ms
Request Body
application/json
1 <= length <= 640 = no expiry; the grant persists until RevokeEgress. At most 86400 (24h).
value <= 86400lands in the audit log
length <= 65535Response Body
application/json
application/json
curl -X POST "https://containers.xeonr.io/containers.api.v1.SandboxService/GrantEgress" \ -H "Connect-Protocol-Version: 1" \ -H "Connect-Timeout-Ms: 1000" \ -H "Content-Type: application/json" \ -d '{ "policy": {} }'{
"sandbox": {
"sandboxId": "string",
"namespace": "string",
"environmentId": "string",
"workspaceId": "string",
"state": "SANDBOX_STATE_UNSPECIFIED",
"ports": [
{
"port": 0,
"url": "string",
"accessToken": "string",
"auth": "AUTH_UNSPECIFIED"
}
],
"createdAtUnix": "string",
"resources": {
"cpuMillis": 0,
"memoryMb": 0,
"ephemeralMb": 0,
"pids": 0,
"cpuLimitMillis": 1024000,
"memoryLimitMb": 4194304
},
"idleSuspendSec": 0,
"maxLifetimeSec": 0,
"workspaceCache": {
"policy": "POLICY_UNSPECIFIED",
"writebackSec": 0
},
"egressGrant": {
"mode": "MODE_UNSPECIFIED",
"expiresAtUnix": "string",
"reason": "string",
"policy": {
"mode": "MODE_UNSPECIFIED",
"allow": [
{
"hostPattern": "string",
"ports": [
0
],
"mode": "RULE_MODE_UNSPECIFIED",
"pathPrefixes": [
"string"
],
"methods": [
"string"
],
"maxResponseBytes": "string",
"allowPlainHttp": true
}
],
"presets": [
"string"
],
"allowPlainHttp": true
},
"id": "string"
},
"runtimeEgress": {
"mode": "MODE_UNSPECIFIED",
"allow": [
{
"hostPattern": "string",
"ports": [
0
],
"mode": "RULE_MODE_UNSPECIFIED",
"pathPrefixes": [
"string"
],
"methods": [
"string"
],
"maxResponseBytes": "string",
"allowPlainHttp": true
}
],
"presets": [
"string"
],
"allowPlainHttp": true
},
"label": "string",
"egressGrants": [
{
"mode": "MODE_UNSPECIFIED",
"expiresAtUnix": "string",
"reason": "string",
"policy": {
"mode": "MODE_UNSPECIFIED",
"allow": [
{
"hostPattern": "string",
"ports": [
0
],
"mode": "RULE_MODE_UNSPECIFIED",
"pathPrefixes": [
"string"
],
"methods": [
"string"
],
"maxResponseBytes": "string",
"allowPlainHttp": true
}
],
"presets": [
"string"
],
"allowPlainHttp": true
},
"id": "string"
}
],
"env": {
"property1": "string",
"property2": "string"
},
"workspaces": [
{
"snapshotId": "string",
"mountPath": "string",
"readOnly": true,
"workspaceId": "string",
"ephemeral": true,
"ephemeralFromSnapshotId": "string",
"volume": {
"backingId": "string",
"backingGeneration": "string",
"attachmentId": "string",
"attachmentGeneration": "string",
"executionAuthorityRequired": true,
"nodeId": "string",
"sizeMb": "string",
"seedSnapshotId": "string",
"cacheKey": "string"
}
}
],
"workingDir": "string",
"argv": [
"string"
],
"restart": "SANDBOX_RESTART_UNSPECIFIED",
"onExit": "SANDBOX_ON_EXIT_UNSPECIFIED",
"runState": "RUN_STATE_UNSPECIFIED",
"run": 0,
"lastExitCode": 0,
"lifecycleProfile": "SANDBOX_LIFECYCLE_PROFILE_UNSPECIFIED",
"desiredState": "SANDBOX_DESIRED_STATE_UNSPECIFIED",
"executionGeneration": "string",
"executionAuthorityRequired": true,
"executionPodUid": "string",
"executionOperatorEpoch": "string",
"managedNetwork": {
"serverId": "string",
"allocationIds": [
"string"
]
},
"executionJobId": "string",
"managedNetworkAgents": [
{
"allocationId": "string",
"teamUrn": "string",
"name": "string",
"protocol": "tcp",
"targetPort": 1,
"label": "string",
"policy": "string",
"secretName": "string",
"connectUrl": "string"
}
],
"revision": "string",
"moveOperationId": "string",
"readinessPolicy": {
"mode": "SANDBOX_READINESS_MODE_UNSPECIFIED",
"markers": [
"string"
],
"stripAnsi": true,
"timeoutSeconds": 1
},
"stateReason": "string"
},
"expiresAtUnix": "string",
"grantId": "string"
}Get Sandbox Logs POST
Returns retained run-log chunks of a sandbox (the same records TailSandboxLogs streams). With `from_offset` 0 it returns the latest chunks, oldest first; otherwise the chunks after that cursor. At most `limit` chunks (0 means 200, at most 2000) and about `limit_bytes` of output (0 means 65536, at most 1048576; a chunk is never split). `next_offset` is the cursor of the last chunk returned, for a forward read; `more` says later chunks exist. **Access:** namespace VIEWER or above (read) **Required scopes:** `container-platform:namespaces:read`
Keep Sandbox Alive POST
Restarts the idle-suspend clock without running anything in the sandbox, and returns when the sandbox would next be idle-suspended (0 when idle_suspend_sec is 0). Deliberately a read-level operation. FailedPrecondition when the sandbox is not RUNNING. **Access:** namespace VIEWER or above (read)