Skip to content
Pre-release. HostCraft is in testing and not yet for sale. These docs describe the current build and may change. Join the waitlist to hear when it launches.

Cluster API

Source: daemon/proto/hostcraft/v1/cluster.proto

ClusterService manages a panel node's agents: nodes, enrolment tokens, decommission and drain, account moves, topology and the event feed. REST: /api/v1/cluster. Agent enrolment itself (POST /api/v1/cluster/enrol, authenticated by the one-time token) is REST only; agents and the panel talk mTLS over NATS, not this API.

Method REST route Permission Streaming
ListNodes GET /api/v1/cluster/nodes ClusterRead unary
GetNode GET /api/v1/cluster/nodes/{id} ClusterRead unary
DecommissionNode POST /api/v1/cluster/nodes/{id}/decommission ClusterDecommissionNode unary
TriggerHealthCheck POST /api/v1/cluster/nodes/{id}/health-check ClusterWrite unary
RotateNodeCert POST /api/v1/cluster/nodes/{id}/rotate-cert ClusterWrite unary
CreateEnrolmentToken POST /api/v1/cluster/enrolment-tokens ClusterTokenCreate unary
ListEnrolmentTokens GET /api/v1/cluster/enrolment-tokens ClusterRead unary
RevokeEnrolmentToken DELETE /api/v1/cluster/enrolment-tokens/{token} ClusterTokenRevoke unary
GetTopology GET /api/v1/cluster/topology ClusterRead unary
MoveAccount POST /api/v1/cluster/moves ClusterMoveAccount unary
ListMoves GET /api/v1/cluster/moves ClusterRead unary
GetMove GET /api/v1/cluster/moves/{id} ClusterRead unary
StreamClusterEvents native ClusterRead server

/hostcraft.v1.ClusterService/ListNodes

/hostcraft.v1.ClusterService/GetNode

DecommissionNode removes an agent. With drain set, every account on the node is first moved (to target_node, or the least loaded agent) by the cluster.drain saga; force skips the drain safety checks.

/hostcraft.v1.ClusterService/DecommissionNode

/hostcraft.v1.ClusterService/TriggerHealthCheck

/hostcraft.v1.ClusterService/RotateNodeCert

/hostcraft.v1.ClusterService/CreateEnrolmentToken

/hostcraft.v1.ClusterService/ListEnrolmentTokens

/hostcraft.v1.ClusterService/RevokeEnrolmentToken

/hostcraft.v1.ClusterService/GetTopology

MoveAccount migrates one account to another node (files, databases, mail, config) through the cluster.move saga.

/hostcraft.v1.ClusterService/MoveAccount

/hostcraft.v1.ClusterService/ListMoves

/hostcraft.v1.ClusterService/GetMove

StreamClusterEvents streams node joined/left/health events until the client cancels. REST equivalent: GET /api/v1/cluster/events (SSE).

/hostcraft.v1.ClusterService/StreamClusterEvents

Field Type Number Description
id string 1 -
account_id string 2 -
source_node string 3 -
target_node string 4 -
drain_id string 5 -
workflow_id string 6 -
status string 7 -
step string 8 -
bytes_total int64 9 -
bytes_done int64 10 -
error string 11 -
warnings string 12 -
created_at google.protobuf.Timestamp 13 -
updated_at google.protobuf.Timestamp 14 -
Field Type Number Description
kind string 1 -
node_id string 2 -
detail string 3 -
at google.protobuf.Timestamp 4 -
Field Type Number Description
id string 1 -
hostname string 2 -
role string 3 panel | agent | standalone
status string 4 healthy | degraded | unreachable | decommissioning
version string 5 -
ip_address string 6 -
last_heartbeat_at google.protobuf.Timestamp 7 -
joined_at google.protobuf.Timestamp 8 -
certificate_expires_at google.protobuf.Timestamp 9 -
capabilities repeated string 10 -
account_count int64 11 -
site_count int64 12 -
mailbox_count int64 13 -
db_count int64 14 -
Field Type Number Description
panel_node_id string 1 -
agent_node_ids repeated string 2 -
total_capacity int64 3 -
current_load int64 4 -
Field Type Number Description
target_role string 1 -
ttl_seconds int64 2 -
Field Type Number Description
id string 1 -
drain bool 2 -
force bool 3 -
target_node string 4 -

Empty is returned by RPCs whose REST route answers with an empty object or 204 No Content.

No fields.

Field Type Number Description
token string 1 -
target_role string 2 -
created_by_user_id string 3 -
created_at google.protobuf.Timestamp 4 -
expires_at google.protobuf.Timestamp 5 -
used_at google.protobuf.Timestamp 6 -
used_by_node_id string 7 -
join_url string 8 -
revoked bool 9 -
Field Type Number Description
id string 1 -
Field Type Number Description
id string 1 -

No fields.

Field Type Number Description
include_used bool 1 -
include_expired bool 2 -
Field Type Number Description
tokens repeated EnrolmentToken 1 -
Field Type Number Description
account_id string 1 -
drain_id string 2 -
limit int64 3 -
Field Type Number Description
moves repeated AccountMove 1 -
Field Type Number Description
role string 1 -
status string 2 -
limit int64 3 -
offset int64 4 -
Field Type Number Description
nodes repeated ClusterNode 1 -
Field Type Number Description
account_id string 1 -
target_node string 2 -
Field Type Number Description
move AccountMove 1 -
workflow_id string 2 -
Field Type Number Description
token string 1 -
Field Type Number Description
id string 1 -

No fields.

Field Type Number Description
id string 1 -

WorkflowAccepted is the body of every 202 response that only starts a workflow saga. Follow progress with WorkflowService.StreamWorkflow.

Field Type Number Description
workflow_id string 1 -