IOperatorHub
Namespace: Meshmakers.Octo.Communication.Contracts.Hubs
Server-side hub interface for operator management connections. Used by the central Communication Operator to register for Cloud deployment site deploy / undeploy notifications.
public interface IOperatorHub
Methods
RegisterOperatorAsync(Nullable<Boolean>)
Registers the operator for receiving Cloud deployment site deploy / undeploy events.
Task<IEnumerable<DeployedDeploymentSiteDto>> RegisterOperatorAsync(Nullable<bool> autoManageDeploymentSites)
Parameters
autoManageDeploymentSites Nullable<Boolean>
The calling operator's AutoManageDeploymentSites setting:
true = central operator (creates / deletes CRs in response to
controller broadcasts), false = edge operator (CRs are managed
out-of-band on the edge cluster). The controller stores this per
connection and validates it against RtDeploymentSite.Environment on every
IOperatorHub.RegisterDeploymentSiteAsync(String, String) call so a Cloud deployment site cannot be claimed
by an edge operator (and vice versa). null means the operator
did not declare a mode (legacy build pre-dating this parameter); the
controller logs and audit-records the registration but does not
enforce mode/environment matching, so a rolling upgrade does not break
existing connections.
Returns
Task<IEnumerable<DeployedDeploymentSiteDto>>
All currently-deployed Cloud deployment sites across every tenant, so a freshly
(re)connected operator can synchronize its desired state without
missing deployment sites that were deployed while it was offline.
UnregisterOperatorAsync()
Unregisters the operator from receiving deployment site deploy / undeploy events.
Task UnregisterOperatorAsync()
Returns
ReportDeployedStateAsync(IReadOnlyList<OperatorDeployedDeploymentSiteReportDto>)
Self-healing reverse-sync called by a Cloud operator after
IOperatorHub.RegisterOperatorAsync(Nullable<Boolean>) on a fresh connection. The
operator reports every deployment site / workload it currently has a healthy
helm release for, and the controller restores
DeploymentState=Deployed on any entity that is not already
Deployed — closing the "operator restarts → tracking lost,
CommunicationState ≠ DeploymentState" gap without requiring a
human to re-click Deploy.
Edge operators (AutoManageDeploymentSites=false) and operators that
did not declare a mode are rejected with a HubException;
the Cloud-only restriction matches the existing deployment site-environment
enforcement on IOperatorHub.RegisterDeploymentSiteAsync(String, String). Deployment sites whose
Environment is not Cloud are silently skipped inside the
handler.
Task ReportDeployedStateAsync(IReadOnlyList<OperatorDeployedDeploymentSiteReportDto> deployedDeploymentSites)
Parameters
deployedDeploymentSites IReadOnlyList<OperatorDeployedDeploymentSiteReportDto>
Returns
ReportWorkloadDeploymentStatusAsync(WorkloadDeploymentStatusDto)
Reports the outcome of a per-workload helm upgrade --install
back to the controller. The controller writes the result onto the
runtime entity's DeploymentState / StatusMessage
attributes so the UI reflects what actually happened in the
cluster — without this call, a failed helm run would only be
visible in operator logs.
Task ReportWorkloadDeploymentStatusAsync(WorkloadDeploymentStatusDto status)
Parameters
status WorkloadDeploymentStatusDto
Returns
ReportWorkloadDeploymentProgressAsync(WorkloadDeploymentProgressDto)
Live progress report fired while a helm upgrade --install is
still in flight. The operator polls the cluster for failure-relevant
pod / event signals (ImagePullBackOff, FailedScheduling,
CrashLoopBackOff, …) and pushes them through this channel so the UI
reflects the root cause within seconds, rather than waiting for the
terminal IOperatorHub.ReportWorkloadDeploymentStatusAsync(WorkloadDeploymentStatusDto) at the
end of helm's atomic timeout.
Controller writes StatusMessage only and leaves
DeploymentState at Pending — helm may still recover
(e.g. transient registry outage), so the terminal state machine
stays owned by IOperatorHub.ReportWorkloadDeploymentStatusAsync(WorkloadDeploymentStatusDto).
Task ReportWorkloadDeploymentProgressAsync(WorkloadDeploymentProgressDto progress)
Parameters
progress WorkloadDeploymentProgressDto
Returns
ReportWorkloadScaleStatusAsync(WorkloadScaleStatusDto)
Reports the outcome of a ScaleWorkloadAsync attempt back to the
controller (AB#4917). The controller advances the workload's lifecycle
state machine (AB#4914): a successful scale-to-0 ack completes the
Draining → Hibernated transition; a failed scale surfaces on the
workload's StatusMessage and as an audit event.
Task ReportWorkloadScaleStatusAsync(WorkloadScaleStatusDto status)
Parameters
status WorkloadScaleStatusDto
Returns
RegisterDeploymentSiteAsync(String, String)
Registers a DeploymentSite the operator currently manages. The
controller writes the deployment site's CommunicationState to
Online and remembers the operator's SignalR connection id, so
that when the connection drops every deployment site registered through it goes
back to Offline automatically (via the hub's
OnDisconnectedAsync).
The (tenant, deploymentSiteRtId) tuple is the controller-side lookup key:
stable across deployment site renames, DNS-safe, and what the operator uses
for every derived Kubernetes resource (CR name, broker secret,
release name). The human-readable deployment site display name lives on the
controller's RtDeploymentSite.Name attribute and surfaces in Studio;
it is not sent over the wire.
Replaces the legacy per-pool /poolHub connection — each
operator now keeps a single multiplexed /operatorHub channel
regardless of how many deployment sites it owns.
Task RegisterDeploymentSiteAsync(string tenantId, string deploymentSiteRtId)
Parameters
tenantId String
deploymentSiteRtId String
Returns
UnregisterDeploymentSiteAsync(String, String)
Unregisters a DeploymentSite. The controller flips the deployment site's
CommunicationState to Unregistered and forgets the
(connection, tenant, deploymentSiteRtId) tuple. Called by the operator when
its DeploymentSite CR is deleted (graceful shutdown of
one deployment site while the operator keeps running for others).
Task UnregisterDeploymentSiteAsync(string tenantId, string deploymentSiteRtId)
Parameters
tenantId String
deploymentSiteRtId String