Control Plane API

The Control API for accounts, agents, deployments, promotions and fleets, and the fleet coordinator API used by fleet agents.

The control plane serves two APIs. The Control API is for people, the CLI, the console and CI. The fleet coordinator API is for fleet agents only. Both are defined as protobuf in api/proto/robotelos/, and the Control API is also served as REST under /api/v1/.

APIDefined inServed by roleCaller
Control API: Accounts, Agents, Deployments, Promotions, Fleetscontrolplane/v1/accounts.proto, platform.protoaccountsUsers, CLI, console, CI
Fleet coordinator: FleetSync, FleetWatch, FleetObservefleet/v1/fleet.protofleetsFleet agents

Roles are chosen with ROBOTELOS_CONTROLPLANE_ROLES (comma separated). Exit code 2 means the configuration is wrong.

For diagnosis, ROBOTELOS_CONTROLPLANE_DIAG_ADDR (for example 127.0.0.1:6060) serves the Go profiler on that address; the fleet agent has ROBOTELOS_FLEET_DIAG_ADDR. Both are off when empty and accept a loopback address only, because a profile holds memory and stacks.

Authentication and authorization

  • Control API: a signed-in user (OIDC; the CLI uses the device grant, the browser uses a session cookie) or an access token. Every account resource is named under an account, and the caller’s role in that account decides what they may do. ROBOTELOS_API_OIDC_AUDIENCE sets the expected token audience; the gRPC address and TLS files are ROBOTELOS_API_GRPC_ADDR, ROBOTELOS_API_GRPC_TLS_CERT_FILE and ROBOTELOS_API_GRPC_TLS_KEY_FILE.
  • Fleets service: platform administrators only (ROBOTELOS_PLATFORM_ADMINS). It is not scoped to an account.
  • Fleet coordinator: the fleet’s enrollment credential, plus optional mutual TLS with the certificate bound to the fleet (see Transports).

Conventions

  • Optimistic concurrency. UpdateAgentDraft takes the revision you read, and deployments and promotions take an expected_generation. A change made meanwhile is refused with Aborted; read again and retry.
  • Immutable versions. A version freezes the draft and compiles a release with a content digest (sha256: and 64 hex digits). Creating a version while the draft is unchanged returns the existing one.
  • Honest phases. A deployment reports Accepted, Progressing, Distributed, Applied, Ready or Degraded. Delivery is not application, and application is not readiness.
  • Production by promotion. DeployAgentRelease targets dev and stg only. prod is reached through a promotion.
  • Lists use page_token and next_page_token.

Accounts

RPCRESTPurpose
GetCurrentUserGET /api/v1/users/meThe signed-in user and active account
SetActiveAccountPOST /api/v1/users/me/active-accountSelect the active account
ListAccountsGET /api/v1/accountsAccounts you belong to
CreateAccountPOST /api/v1/accountsCreate an account
GetAccountMembersGET /api/v1/accounts/{account_id}/membersMembers and pending invitations
CreateAccountInvitationPOST /api/v1/accounts/{account_id}/invitationsInvite by email with a role
RevokeAccountInvitationDELETE /api/v1/accounts/{account_id}/invitations/{invitation_id}Withdraw an invitation
GetInvitationGET /api/v1/invitations/{token}Look up an invitation
AcceptInvitationPOST /api/v1/invitations/{token}/acceptJoin the account
IssueConversationTokenPOST /api/v1/accounts/{account_id}/conversation-tokenA short-lived credential for the conversation gateway

Agents

An agent has a freely editable draft and immutable versions.

RPCREST
CreateAgentPOST /api/v1/accounts/{account_id}/agents
GetAgentGET .../agents/{agent_id}
ListAgentsGET .../agents
GetAgentDraftGET .../agents/{agent_id}/draft
UpdateAgentDraftPUT .../agents/{agent_id}/draft
CreateAgentReleasePOST .../agents/{agent_id}/releases
ListAgentReleasesGET .../agents/{agent_id}/releases
GetAgentReleaseGET .../agents/{agent_id}/releases/{version}

(... is /api/v1/accounts/{account_id}.)

Deployments

RPCRESTPurpose
ListEnvironmentsGET .../environmentsThe environments and whether they are enabled
SetEnvironmentEnabledPATCH .../environments/{environment}Turn the optional stg on or off
DeployAgentReleasePOST .../agents/{agent_id}/environments/{environment}/deploymentsAssign a release to dev or stg
RollbackDeploymentPOST .../agents/{agent_id}/environments/{environment}:rollbackReturn to the previous version
RevokeDeploymentPOST .../agents/{agent_id}/environments/{environment}:revokeStop serving the agent there
GetDeploymentStatusGET .../agents/{agent_id}/environments/{environment}/statusDesired state, phase and per-fleet observation
ListDeploymentsGET .../agents/{agent_id}/environments/{environment}/deploymentsHistory
RecordEvaluationPOST .../agents/{agent_id}/evaluationsEvidence a promotion gate can require

A deployment has a kind (deploy, promotion, rollback, revoke), a status (applying, completed, failed, cancelled) and a generation. It is completed only when the fleets observed it Ready.

Promotions

A promotion moves a release that runs in one environment to the next, with gates and approval.

RPCREST
RequestPromotionPOST .../promotions
GetPromotionGET .../promotions/{promotion_id}
ListPromotionsGET .../agents/{agent_id}/promotions
ApprovePromotionPOST .../promotions/{promotion_id}:approve
RejectPromotionPOST .../promotions/{promotion_id}:reject
CancelPromotionPOST .../promotions/{promotion_id}:cancel

States: requested, awaiting_approval, approved, applying, succeeded, failed, rejected, cancelled. Approved is not succeeded: a promotion succeeds when the fleets observe the release Ready.

Fleets (platform administrators)

RPCRESTPurpose
CreateFleetPOST /api/v1/fleetsCreate a fleet of class nonprod (dev, stg) or prod. The enrollment credential is returned once and never stored.
ListFleetsGET /api/v1/fleetsEvery fleet with its observation: connected (last seen under 30 seconds ago; derived, there is no disconnect event), first_seen_time, last_seen_time, agent_version, releases_by_phase, pools, pools_ready, ready_replicas
ListAccountFleetsGET /api/v1/accounts/{account_id}/fleetsThe fleets granted to the account, with the same observation; releases are the account’s own. Needs deployments.read, no platform role
RotateFleetCredentialPOST /api/v1/fleets/{fleet_id}:rotate-credentialNew credential
GrantFleetAccount / RevokeFleetAccountPUT / DELETE /api/v1/fleets/{fleet_id}/accounts/{account_id}Which accounts a fleet serves
PutRuntimePoolPUT /api/v1/fleets/{fleet_id}/runtime-pools/{name}Declare a shared runtime pool
GetRuntimePool, ListRuntimePoolsGET .../runtime-pools[/{name}]Read pools and their observed state
DeleteRuntimePoolDELETE .../runtime-pools/{name}Mark the pool DELETING

Fleet coordinator API (fleet agents)

ServiceRPCPurpose
FleetSyncWaitRevisionLong poll until the fleet’s revision passes the one given
GetSnapshotThe fleet’s desired state: releases, pools, accounts
ReportStatus, ReportPoolsApplied generation and pool readiness (unary)
FleetWatchWatch (server stream)Bookmarks when the revision changes
FleetObserveObserve (bidirectional stream)Hello with epoch, state of the world, then upserts, deletes and heartbeats

The same operations are carried over HTTP/1.1 as JSON (/v1/fleet/revision:wait, /v1/fleet/snapshot, /v1/fleet/status, /v1/fleet/pools, and /v1/fleet/watch as a stream of JSON lines); Observe is gRPC’s alone. See Watch and Observe and Transports.

Next steps