Add morph remove node command #14

Merged
anikeev-yadro merged 1 commit from anikeev-yadro/frostfs-testlib:anikeev/add_morph_remove_node into master 2023-03-16 14:43:03 +00:00

View file

@ -127,12 +127,12 @@ class FrostfsAdmMorph(CliCommand):
)
def force_new_epoch(
self, rpc_endpoint: Optional[str] = None, alphabet: Optional[str] = None
self, rpc_endpoint: Optional[str] = None, alphabet_wallets: Optional[str] = None
) -> CommandResult:
"""Create new FrostFS epoch event in the side chain.
Args:
alphabet: Path to alphabet wallets dir.
alphabet_wallets: Path to alphabet wallets dir.
rpc_endpoint: N3 RPC node endpoint.
Returns:
@ -354,3 +354,29 @@ class FrostfsAdmMorph(CliCommand):
if param not in ["self"]
},
)
def remove_nodes(
self, node_netmap_keys: list[str], rpc_endpoint: Optional[str] = None, alphabet_wallets: Optional[str] = None
) -> CommandResult:
""" Move node to the Offline state in the candidates list
and tick an epoch to update the netmap using frostfs-adm
Args:
node_netmap_keys: list of nodes netmap keys.
alphabet_wallets: Path to alphabet wallets dir.
rpc_endpoint: N3 RPC node endpoint.
Returns:
Command's result.
"""
if not len(node_netmap_keys):
raise AttributeError("Got empty node_netmap_keys list")
return self._execute(
f"morph remove-nodes {' '.join(node_netmap_keys)}",
**{
param: param_value
for param, param_value in locals().items()
if param not in ["self", "node_netmap_keys"]
},
)