pub struct ClusterRegistry { /* private fields */ }Expand description
Cluster registry for managing federated clusters
Implementations§
Source§impl ClusterRegistry
impl ClusterRegistry
Sourcepub fn new(discovery_config: DiscoveryConfig) -> Self
pub fn new(discovery_config: DiscoveryConfig) -> Self
Create a new cluster registry
Sourcepub fn register_cluster(&self, cluster: RemoteCluster) -> Result<()>
pub fn register_cluster(&self, cluster: RemoteCluster) -> Result<()>
Register a remote cluster
Sourcepub fn unregister_cluster(&self, cluster_id: &ClusterId) -> Result<()>
pub fn unregister_cluster(&self, cluster_id: &ClusterId) -> Result<()>
Unregister a cluster
Sourcepub fn get_cluster(&self, cluster_id: &ClusterId) -> Option<RemoteCluster>
pub fn get_cluster(&self, cluster_id: &ClusterId) -> Option<RemoteCluster>
Get a cluster by ID
Sourcepub fn list_clusters(&self) -> Vec<RemoteCluster>
pub fn list_clusters(&self) -> Vec<RemoteCluster>
List all registered clusters
Sourcepub fn healthy_clusters(&self) -> Vec<RemoteCluster>
pub fn healthy_clusters(&self) -> Vec<RemoteCluster>
List healthy clusters only
Sourcepub async fn health_check(
&self,
cluster_id: &ClusterId,
) -> Result<ClusterStatus>
pub async fn health_check( &self, cluster_id: &ClusterId, ) -> Result<ClusterStatus>
Perform health check on a cluster
Sourcepub async fn health_check_all(&self) -> HashMap<ClusterId, ClusterStatus>
pub async fn health_check_all(&self) -> HashMap<ClusterId, ClusterStatus>
Perform health checks on all clusters
Sourcepub async fn discover_clusters(&self) -> Result<Vec<RemoteCluster>>
pub async fn discover_clusters(&self) -> Result<Vec<RemoteCluster>>
Discover clusters automatically (if enabled)
Auto Trait Implementations§
impl Freeze for ClusterRegistry
impl !RefUnwindSafe for ClusterRegistry
impl Send for ClusterRegistry
impl Sync for ClusterRegistry
impl Unpin for ClusterRegistry
impl !UnwindSafe for ClusterRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request