Xeonr Developer Docs
API Specification

containers.api.v1.ClusterService

ClusterService manages where namespaces run (BYOC, platform-docs container-platform/docs/BYOC.md §2). A cluster is one operator install: one enrolment, one credential, one owner team. Two teams installing on the same physical cluster produce two records, and the platform neither knows nor needs to know that they share hardware. The platform's own fleet is a cluster like any other, flagged GLOBAL and `default`, which is where a namespace lands when nothing names a cluster. A namespace is placed on exactly one cluster when it is created (Namespace.cluster_id) and everything beneath it — sandboxes, jobs, apps, environments, volumes, pools, keys — runs there. Placement is immutable: moving a namespace is a migration, not an update. Who may place a namespace on a cluster is its visibility: PRIVATE is the owner team only; SHARED adds the teams holding a grant; GLOBAL is every team, within the everyone-grant. A grant also caps how much of the cluster that team's namespaces may hold in total (BYOC.md §5.4): the sum of a team's namespace quotas on a cluster must fit its grant, and the owner team's grant is implicit and unbounded. GetCluster and ListClusters carry allow_api_keys: a namespace key reaches the cluster its namespace is placed on and nothing else. The mutations do not, for the reason CreateNamespace does not: each needs a team role, and no key holds one.

postCreate Cluster

Registers a cluster owned by `owner_team` in PENDING state with PRIVATE visibility. Nothing runs on it until an operator enrols (CreateEnrolmentToken, then the operator's first connection). A platform admin's `owner_team` is verified against Xeonr Auth and canonicalised to the team URN. **Access:** a platform admin, or an admin of the `owner_team` team.

postCreate Enrolment Token

Mints a one-time enrolment token for a cluster, valid for 15 minutes, which an operator install exchanges for its cluster credential on first start. The secret is returned exactly once. Minting a new token does not revoke an unspent earlier one until it expires. **Access:** admin of the owner team, or a platform admin. Other callers get NotFound.

postDelete Cluster

Deletes a cluster record and revokes its enrolment tokens. Fails with FailedPrecondition while any namespace is placed on it unless `force` is set, and always for the `default` cluster. A connected operator loses its credential on its next heartbeat. **Access:** admin of the owner team, or a platform admin. Other callers get NotFound.

postGet Cluster

Returns a cluster record. A cluster the caller cannot see is reported as NotFound. **Access:** a member of the owner team or of a team holding a grant, any caller for a GLOBAL cluster, a namespace API key for the cluster its namespace is placed on, or a platform admin.

postList Clusters

Lists the clusters visible to the caller, ordered by display name: those owned by a team they are in, those granting such a team, and every GLOBAL cluster (all of them for a platform admin; for a namespace API key, the clusters its namespaces are placed on). With `team` set, only the clusters that team owns or may place a namespace on; a team the caller is not in is NotFound. `limit` 0 means 50 and is at most 500; `cursor` is opaque, from `next_cursor`. **Access:** any authenticated caller; results are filtered to what the caller can see.

postUpdate Cluster

Updates the fields named in `update_mask` and nothing else; an empty mask is InvalidArgument. The owner team's admins may change `display_name`, `labels`, `grants` and switch `visibility` between PRIVATE and SHARED. Setting `visibility` to GLOBAL, `default`, `allow_runc` and the everyone-grant (a grant with an empty `team`) are platform-admin-only; naming them in the mask otherwise is PermissionDenied. At most one cluster is `default`, and it must be GLOBAL. `archive_interval_sec` (how often mounted volumes are archived; 0 disables, unset in the mask restores the 6-hour default) is the owner team's on its own cluster and platform-admin-only on a GLOBAL one. **Access:** admin of the owner team, or a platform admin. Other callers get NotFound.