forked from TrueCloudLab/frostfs-testlib
58 lines
1.9 KiB
Python
58 lines
1.9 KiB
Python
from typing import Optional
|
|
|
|
from frostfs_testlib.cli.cli_command import CliCommand
|
|
from frostfs_testlib.shell import CommandResult
|
|
|
|
|
|
class FrostfsCliControl(CliCommand):
|
|
def set_status(
|
|
self,
|
|
endpoint: str,
|
|
status: str,
|
|
wallet: Optional[str] = None,
|
|
force: Optional[bool] = None,
|
|
address: Optional[str] = None,
|
|
timeout: Optional[str] = None,
|
|
) -> CommandResult:
|
|
"""Set status of the storage node in FrostFS network map
|
|
|
|
Args:
|
|
wallet: Path to the wallet or binary key
|
|
address: Address of wallet account
|
|
endpoint: Remote node control address (as 'multiaddr' or '<host>:<port>')
|
|
force: Force turning to local maintenance
|
|
status: New netmap status keyword ('online', 'offline', 'maintenance')
|
|
timeout: Timeout for an operation (default 15s)
|
|
|
|
Returns:
|
|
Command`s result.
|
|
"""
|
|
return self._execute(
|
|
"control set-status",
|
|
**{param: value for param, value in locals().items() if param not in ["self"]},
|
|
)
|
|
|
|
def healthcheck(
|
|
self,
|
|
endpoint: str,
|
|
wallet: Optional[str] = None,
|
|
address: Optional[str] = None,
|
|
timeout: Optional[str] = None,
|
|
) -> CommandResult:
|
|
"""Set status of the storage node in FrostFS network map
|
|
|
|
Args:
|
|
wallet: Path to the wallet or binary key
|
|
address: Address of wallet account
|
|
endpoint: Remote node control address (as 'multiaddr' or '<host>:<port>')
|
|
force: Force turning to local maintenance
|
|
status: New netmap status keyword ('online', 'offline', 'maintenance')
|
|
timeout: Timeout for an operation (default 15s)
|
|
|
|
Returns:
|
|
Command`s result.
|
|
"""
|
|
return self._execute(
|
|
"control healthcheck",
|
|
**{param: value for param, value in locals().items() if param not in ["self"]},
|
|
)
|