diff options
author | Alex Auvolat <lx@deuxfleurs.fr> | 2025-02-05 14:22:10 +0100 |
---|---|---|
committer | Alex Auvolat <lx@deuxfleurs.fr> | 2025-02-05 14:22:10 +0100 |
commit | 9f468b4439bdd5e2e67a6215f941556310877155 (patch) | |
tree | 7524ac5326e069d014fd25b624d794d52aa5e745 /src/garage/cli | |
parent | 97be7b38fa3bd3172895f6ab44157e5236d65cd6 (diff) | |
download | garage-9f468b4439bdd5e2e67a6215f941556310877155.tar.gz garage-9f468b4439bdd5e2e67a6215f941556310877155.zip |
cli_v2: implement CreateMetadataSnapshot
Diffstat (limited to 'src/garage/cli')
-rw-r--r-- | src/garage/cli/cmd.rs | 18 | ||||
-rw-r--r-- | src/garage/cli/layout.rs | 13 |
2 files changed, 13 insertions, 18 deletions
diff --git a/src/garage/cli/cmd.rs b/src/garage/cli/cmd.rs index e5af461c..1a9c7841 100644 --- a/src/garage/cli/cmd.rs +++ b/src/garage/cli/cmd.rs @@ -1,6 +1,3 @@ -use garage_util::error::*; - -use garage_rpc::system::*; use garage_rpc::*; use garage_model::helper::error::Error as HelperError; @@ -22,18 +19,3 @@ pub async fn cmd_admin( } Ok(()) } - -// ---- utility ---- - -pub async fn fetch_status( - rpc_cli: &Endpoint<SystemRpc, ()>, - rpc_host: NodeID, -) -> Result<Vec<KnownNodeInfo>, Error> { - match rpc_cli - .call(&rpc_host, SystemRpc::GetKnownNodes, PRIO_NORMAL) - .await?? - { - SystemRpc::ReturnKnownNodes(nodes) => Ok(nodes), - resp => Err(Error::unexpected_rpc_message(resp)), - } -} diff --git a/src/garage/cli/layout.rs b/src/garage/cli/layout.rs index bb81d144..15040aaa 100644 --- a/src/garage/cli/layout.rs +++ b/src/garage/cli/layout.rs @@ -260,6 +260,19 @@ pub async fn cmd_layout_skip_dead_nodes( // --- utility --- +pub async fn fetch_status( + rpc_cli: &Endpoint<SystemRpc, ()>, + rpc_host: NodeID, +) -> Result<Vec<KnownNodeInfo>, Error> { + match rpc_cli + .call(&rpc_host, SystemRpc::GetKnownNodes, PRIO_NORMAL) + .await?? + { + SystemRpc::ReturnKnownNodes(nodes) => Ok(nodes), + resp => Err(Error::unexpected_rpc_message(resp)), + } +} + pub async fn fetch_layout( rpc_cli: &Endpoint<SystemRpc, ()>, rpc_host: NodeID, |