Adding timeout for more cli actions

Signed-off-by: Andrey Berezin <a.berezin@yadro.com>
This commit is contained in:
Andrey Berezin 2023-03-09 14:25:39 +03:00 committed by Gitea
parent 8ed26cef7d
commit f2ecce44bf
6 changed files with 57 additions and 19 deletions

View file

@ -13,6 +13,7 @@ class FrostfsCliShards(CliCommand):
id: Optional[list[str]],
address: Optional[str] = None,
all: bool = False,
timeout: Optional[str] = None,
) -> CommandResult:
"""
Flush objects from the write-cache to the main storage.
@ -24,6 +25,7 @@ class FrostfsCliShards(CliCommand):
endpoint: Remote node address (as 'multiaddr' or '<host>:<port>').
wallet: WIF (NEP-2) string or path to the wallet or binary key.
wallet_password: Wallet password.
timeout: Timeout for an operation (default 15s).
Returns:
Command's result.
@ -44,6 +46,7 @@ class FrostfsCliShards(CliCommand):
address: Optional[str] = None,
all: bool = False,
clear_errors: bool = False,
timeout: Optional[str] = None,
) -> CommandResult:
"""
Set work mode of the shard.
@ -57,12 +60,13 @@ class FrostfsCliShards(CliCommand):
endpoint: Remote node address (as 'multiaddr' or '<host>:<port>').
wallet: WIF (NEP-2) string or path to the wallet or binary key.
wallet_password: Wallet password.
timeout: Timeout for an operation (default 15s).
Returns:
Command's result.
"""
return self._execute_with_password(
f"control shards set-mode",
"control shards set-mode",
wallet_password,
**{
param: value
@ -80,6 +84,7 @@ class FrostfsCliShards(CliCommand):
path: str,
address: Optional[str] = None,
no_errors: bool = False,
timeout: Optional[str] = None,
) -> CommandResult:
"""
Dump objects from shard to a file.
@ -92,12 +97,13 @@ class FrostfsCliShards(CliCommand):
endpoint: Remote node address (as 'multiaddr' or '<host>:<port>').
wallet: WIF (NEP-2) string or path to the wallet or binary key.
wallet_password: Wallet password.
timeout: Timeout for an operation (default 15s).
Returns:
Command's result.
"""
return self._execute_with_password(
f"control shards dump",
"control shards dump",
wallet_password,
**{
param: value
@ -113,6 +119,7 @@ class FrostfsCliShards(CliCommand):
wallet_password: str,
address: Optional[str] = None,
json_mode: bool = False,
timeout: Optional[str] = None,
) -> CommandResult:
"""
List shards of the storage node.
@ -123,12 +130,13 @@ class FrostfsCliShards(CliCommand):
endpoint: Remote node address (as 'multiaddr' or '<host>:<port>').
wallet: WIF (NEP-2) string or path to the wallet or binary key.
wallet_password: Wallet password.
timeout: Timeout for an operation (default 15s).
Returns:
Command's result.
"""
return self._execute_with_password(
f"control shards list",
"control shards list",
wallet_password,
**{
param: value