1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

feat(cmapi): MCOL-5133: Stage2 stand alone cli tool.

[fix] client class methods
[fix] Transaction management at endpoint handling level
[fix] add_node and set_mode methods to use TransactionManager
This commit is contained in:
mariadb-AlanMologorsky
2025-01-24 15:54:59 +03:00
committed by Leonid Fedorov
parent a60a5288d8
commit c40e4ba00d
4 changed files with 58 additions and 100 deletions

View File

@ -176,18 +176,24 @@ def start():
@app.command(rich_help_panel='cluster and single node commands')
@handle_output
@TransactionManager(
timeout=timedelta(days=1).total_seconds(), handle_signals=True
)
def restart():
"""Restart the Columnstore cluster."""
stop_result = client.shutdown_cluster()
stop_result = client.shutdown_cluster({'in_transaction': True})
if 'error' in stop_result:
return stop_result
result = client.start_cluster()
result = client.start_cluster({'in_transaction': True})
result['stop_timestamp'] = stop_result['timestamp']
return result
@node_app.command(rich_help_panel='cluster node commands')
@handle_output
@TransactionManager(
timeout=timedelta(days=1).total_seconds(), handle_signals=True
)
def add(
nodes: Optional[List[str]] = typer.Option(
...,
@ -225,6 +231,9 @@ def remove(nodes: Optional[List[str]] = typer.Option(
@set_app.command()
@handle_output
@TransactionManager(
timeout=timedelta(days=1).total_seconds(), handle_signals=True
)
def mode(cluster_mode: str = typer.Option(
...,
'--mode',