New-ZrWorkspace
Creates and persists a named Zaris workspace — a set of managers that admin cmdlets target — by claiming the given managers into it, and optionally activates it.
Syntax
New-ZrWorkspace
-Name <string>
-Managers <string[]>
[-Token <string>]
[-Force]
[-Activate]
[-Supervisor]
[-Attach]
[-WhatIf] [-Confirm]
Description
New-ZrWorkspace records a named workspace under ~/.clustron so it survives sessions, then server-side claims the given managers into it. It claims only currently-unclaimed managers: if a seed manager already belongs to another workspace the create is rejected (join it with Use-ZrWorkspace or release it first). Each manager should observe a single cluster, so a manager already bookmarked in another local workspace produces a warning but does not block.
The deployment mode is set from -Supervisor or -Attach (mutually exclusive); when neither is given it is auto-detected by probing the first manager's /health. All seed managers must report the same mode — a mixed set is rejected.
The workspace is not activated unless -Activate is passed (equivalent to running Use-ZrWorkspace afterward).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
-Name | string | Yes | Name of the workspace to create. Position 0. |
-Managers | string[] | Yes | Manager endpoints (host:port or full URL), each an observer of one cluster. Position 1. At least one is required and malformed endpoints are rejected up front. |
-Token | string | No | Admin bearer token recorded for authenticated control-plane calls. |
-Force | switch | No | Replace an existing local workspace of the same name. |
-Activate | switch | No | Activate the workspace immediately after creating it (equivalent to Use-ZrWorkspace). |
-Supervisor | switch | No | Mark the cluster supervisor-model (each manager forks and owns its local nodes — native/Windows). Mutually exclusive with -Attach. |
-Attach | switch | No | Mark the cluster attach-model (nodes run under an orchestrator; the manager only observes — docker/k8s). Mutually exclusive with -Supervisor. |
Supports -WhatIf and -Confirm.
Examples
Create a workspace targeting two managers without activating it.
New-ZrWorkspace -Name prod -Managers "10.0.0.10:7801","10.0.0.11:7801"
Create and immediately activate a workspace, letting the mode auto-detect from the first manager.
New-ZrWorkspace -Name prod -Managers "10.0.0.10:7801","10.0.0.11:7801" -Activate
Create an explicitly attach-model workspace for an orchestrator-run cluster, recording an admin token.
New-ZrWorkspace -Name k8s-prod -Managers "zaris-mgr.svc:7801" -Attach -Token $env:ZR_ADMIN_TOKEN -Activate