Xeonr Developer Docs
API SpecificationNamespaces

Move Namespace

POST
/containers.api.v1.NamespaceService/MoveNamespace

Moves a namespace and its persistent volumes to target_cluster_id. The controller drains it (refuses new workloads, suspends sandboxes, scales apps to zero, waits up to 15 minutes for running jobs and then cancels them), archives each persistent volume, places the namespace on the target and provisions its runner namespace there, re-seeds each persistent volume from its archive (populated on its first mount on the target; cache and scratch volumes are dropped and rebuilt on use), deletes the source's runner namespace and volumes, and brings apps back to their desired replicas; sandboxes stay suspended until resumed. Progress is Namespace.move. A failure before the volumes are re-seeded rolls back to the source, which still has everything. While a move runs, workload operations in the namespace and UpdateNamespace/DeleteNamespace are refused with FailedPrecondition. With dry_run nothing starts and the response carries the downtime estimate. The target must be a cluster the namespace's owner team may place on (PermissionDenied otherwise, NotFound if not visible) and CONNECTED (FailedPrecondition).

Access: a platform admin, or an admin of the namespace's owner team.

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
targetClusterId?string
Match^cl-[0-9a-f]{16}$
dryRun?boolean

Validate and estimate only; nothing starts. validate:skip a flag

[key: string]?never

Response Body

application/json

application/json

curl -X POST "https://containers.xeonr.io/containers.api.v1.NamespaceService/MoveNamespace" \  -H "Connect-Protocol-Version: 1" \  -H "Connect-Timeout-Ms: 1000" \  -H "Content-Type: application/json" \  -d '{}'
{
  "namespace": {
    "namespace": "string",
    "displayName": "string",
    "k8sRunnerNamespace": "string",
    "groups": [
      {
        "oidcGroup": "string",
        "role": "ROLE_UNSPECIFIED"
      }
    ],
    "defaultLimits": {
      "cpuMillis": 0,
      "memoryMb": 0,
      "ephemeralMb": 0,
      "pids": 0
    },
    "quotaCpuMillis": 0,
    "quotaMemoryMb": 0,
    "quotaMaxPods": 0,
    "quotaStorageMb": 0,
    "quotaMaxVolumes": 0,
    "internalTargets": [
      {
        "host": "string",
        "port": 1
      }
    ],
    "imagePullSecrets": [
      "string"
    ],
    "ownerTeam": "string",
    "clusterId": "string",
    "move": {
      "state": "STATE_UNSPECIFIED",
      "sourceClusterId": "string",
      "targetClusterId": "string",
      "startedAt": "2023-01-15T01:30:15.01Z",
      "updatedAt": "2023-01-15T01:30:15.01Z",
      "finishedAt": "2023-01-15T01:30:15.01Z",
      "message": "string",
      "rolledBack": true,
      "estimatedDowntimeSec": 0,
      "volumes": [
        {
          "volumeId": "string",
          "archiveSnapshotId": "string",
          "sourceNode": "string",
          "sourceState": "VOLUME_STATE_UNSPECIFIED",
          "reseeded": true
        }
      ],
      "startedBy": "string"
    }
  }
}
{
  "code": "not_found",
  "message": "string",
  "details": [
    {
      "type": "string",
      "value": "string",
      "debug": {}
    }
  ]
}