mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-08 22:33:22 +00:00
move admin router to rustfs, add pool stats/list admin api
This commit is contained in:
@@ -405,7 +405,7 @@ pub struct PoolEndpoints {
|
||||
}
|
||||
|
||||
/// list of list of endpoints
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub struct EndpointServerPools(pub Vec<PoolEndpoints>);
|
||||
|
||||
impl From<Vec<PoolEndpoints>> for EndpointServerPools {
|
||||
@@ -430,6 +430,17 @@ impl EndpointServerPools {
|
||||
pub fn reset(&mut self, eps: Vec<PoolEndpoints>) {
|
||||
self.0 = eps;
|
||||
}
|
||||
pub fn legacy(&self) -> bool {
|
||||
self.0.len() == 1 && self.0[0].legacy
|
||||
}
|
||||
pub fn get_pool_idx(&self, cmd_line: &str) -> Option<usize> {
|
||||
for (idx, eps) in self.0.iter().enumerate() {
|
||||
if eps.cmd_line.as_str() == cmd_line {
|
||||
return Some(idx);
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
pub fn from_volumes(server_addr: &str, endpoints: Vec<String>) -> Result<(EndpointServerPools, SetupType)> {
|
||||
let layouts = DisksLayout::from_volumes(endpoints.as_slice())?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user