frostfs-testlib/src/frostfs_testlib/cli/frostfs_cli/session.py
Andrey Berezin 25925c637b [#191] Credentials work overhaul
Signed-off-by: Andrey Berezin <a.berezin@yadro.com>
2024-03-11 19:23:10 +03:00

35 lines
1.1 KiB
Python

from typing import Optional
from frostfs_testlib.cli.cli_command import CliCommand
from frostfs_testlib.shell import CommandResult
class FrostfsCliSession(CliCommand):
def create(
self,
rpc_endpoint: str,
wallet: str,
out: str,
lifetime: Optional[int] = None,
address: Optional[str] = None,
json: Optional[bool] = False,
) -> CommandResult:
"""
Create session token.
Args:
address: Address of wallet account.
out: File to write session token to.
lifetime: Number of epochs for token to stay valid.
json: Output token in JSON.
wallet: WIF (NEP-2) string or path to the wallet or binary key.
wallet_password: Wallet password.
rpc_endpoint: Remote node address (as 'multiaddr' or '<host>:<port>').
Returns:
Command's result.
"""
return self._execute(
"session create",
**{param: value for param, value in locals().items() if param not in ["self"]},
)