Skip to Content
Xeonr Developer Docs
API SpecificationSandboxes

Move Persistent Sandbox

POST
/containers.api.v1.SandboxService/MoveSandbox

Admits a durable move of one persistent service sandbox and all of its exclusive writable volumes to another node in the same cluster. The control plane derives the complete mounted exclusive-volume set from the stored sandbox; callers cannot omit a world. Requires the current sandbox revision and execution generation. The operation fences and stops the source, verifies detach, copies and verifies the exact backing contents, atomically promotes all target backings, releases target CSI authority, and resumes only when the sandbox was previously desired to run.

Authorization

BearerAuth
AuthorizationBearer <token>

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

Connect-Protocol-Version?number

Define the version of the Connect protocol

Connect-Timeout-Ms?number

Define the timeout, in ms

Request Body

application/json

namespace?string
Length1 <= length <= 64
sandboxId?string
Length1 <= length <= 64
targetNodeId?string
Length1 <= length <= 128
expectedSandboxRevision?string
Formatint64
Range0 < value
expectedExecutionGeneration?string
Formatint64
Range0 < value
idempotencyKey?string
Length1 <= length <= 191
gracePeriodSec?integer
Range1 <= value <= 300
readinessPolicy?

Must exactly match the policy persisted at sandbox admission. The request hash therefore binds a move to the same immutable definition contract.

stopCommand?string
Length1 <= length <= 256

Response Body

application/json

application/json

curl -X POST "https://containers.xeonr.io/containers.api.v1.SandboxService/MoveSandbox" \  -H "Connect-Protocol-Version: 1" \  -H "Connect-Timeout-Ms: 1000" \  -H "Content-Type: application/json" \  -d '{}'
{
  "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"
  },
  "operation": {
    "id": "string",
    "owner": {
      "kind": "OPERATION_OWNER_KIND_UNSPECIFIED",
      "id": "string"
    },
    "kind": "string",
    "state": "OPERATION_STATE_UNSPECIFIED",
    "phase": "string",
    "revision": "string",
    "resources": [
      {
        "kind": "string",
        "id": "string"
      }
    ],
    "cancelRequested": true,
    "cancellationAllowed": true,
    "failure": {
      "code": "string",
      "message": "string",
      "retryable": true
    },
    "resultResources": [
      {
        "kind": "string",
        "id": "string"
      }
    ],
    "recoveryActions": [
      "string"
    ],
    "createdAt": "2023-01-15T01:30:15.01Z",
    "updatedAt": "2023-01-15T01:30:15.01Z",
    "completedAt": "2023-01-15T01:30:15.01Z",
    "deadlineAt": "2023-01-15T01:30:15.01Z",
    "cleanupPending": true,
    "targetGeneration": "string",
    "progress": {
      "transferredBytes": "string",
      "verifiedBytes": "string",
      "totalBytes": "string"
    },
    "warnings": [
      {
        "code": "string",
        "path": "string",
        "entryType": "string"
      }
    ],
    "warningCount": 0
  }
}