Add morph remove node command

Signed-off-by: anikeev-yadro <a.anikeev@yadro.com>
This commit is contained in:
anikeev-yadro 2023-03-13 15:45:06 +03:00
parent f2ecce44bf
commit e73585cf50

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"]
},
)