pub struct DogtagPool { /* private fields */ }Expand description
Connection pool managing multiple Dogtag CA instances.
Routes enrollment and certificate operations to healthy CA backends. Integrates with kipuka’s HA subsystem for consistent failover behavior across all CA backend types.
§Health Checking
The pool periodically probes each backend via GET /ca/rest/info.
Backends that fail consecutive health checks are marked unhealthy
and excluded from request routing until they recover.
§Thread Safety
DogtagPool is Send + Sync and designed to be shared via
Arc<DogtagPool> across the async runtime.
Implementations§
Source§impl DogtagPool
impl DogtagPool
Sourcepub fn new(
configs: &[DogtagConfig],
failure_threshold: u32,
cooldown_secs: u64,
) -> DogtagResult<Self>
pub fn new( configs: &[DogtagConfig], failure_threshold: u32, cooldown_secs: u64, ) -> DogtagResult<Self>
Create a pool from multiple Dogtag configurations.
Each configuration represents a separate CA instance. The pool
creates a DogtagClient for each and begins tracking health.
Sourcepub fn get_client(&self) -> DogtagResult<Arc<DogtagClient>>
pub fn get_client(&self) -> DogtagResult<Arc<DogtagClient>>
Get a healthy client from the pool.
Returns the first healthy backend. If no backend is healthy,
returns DogtagError::NoHealthyBackend.
Sourcepub async fn health_check_all(&self)
pub async fn health_check_all(&self)
Run a single health check pass across all backends.
Probes each backend via GET /ca/rest/info and updates health
state. Unhealthy backends in cooldown are skipped.
Sourcepub fn healthy_count(&self) -> usize
pub fn healthy_count(&self) -> usize
Return the number of backends currently considered healthy.
Sourcepub fn total_count(&self) -> usize
pub fn total_count(&self) -> usize
Return the total number of backends in the pool.