genvid.toolbox.ServiceTool

class genvid.toolbox.ServiceTool(**kwargs)

ベースクラス: genvid.toolbox.network.NetworkTool

すべてのサービスのベース class。

共通のユーティリティと、サービスに関連づけられたコマンドを提供する。

BASE_COMMANDS = {'start': 'Start an installed service.', 'stop': 'Stop a service.', 'restart': 'Restart a service.', 'status': 'Check the status of the service.', 'install': 'Install the service.', 'uninstall': 'Uninstall the service.', 'reinstall': 'Reinstall the services.'}

ベースコマンドのリストと、サービスのヘルプテキスト。

class DEFAULT_OPTIONS

ベースクラス: object

mode = 'dev'
datacenter = 'dc1'
region = 'global'
bootstrap = 1
replace_dns = False
wan = None
bind = None
name = None
node_class = ''
node_id = None
servers = []
ec2_tag = None
ec2_value = None
join_policy = None
set_default_options(**kwargs)
install(**kwargs)

サービスの構成をインストールする。

uninstall(clean: bool = False)

サービスの構成をアンインストールする。

reinstall(**config)

サービスを再インストールする。

古い設定を新しいもので置き換える。

restart()

サービスを再開する。

prestart()

開始前に実行する。

poststart()

開始後に実行する。

get_startup_timeout()
add_service_commands()

サービスコマンドをパーサーに追加する。

add_commands() から実行し、サービスコマンドをパーサーに追加する。

run_service_command(command, options)

コマンドがサービスコマンドかどうかを検出し、実行する。

run_command() から呼び出して、サービスコマンドを処理する。 add_service_commands() により、サービスコマンドが追加される。

戻り値:

handled, result: コマンドを処理したかどうかを示す、ブール値のトプル。
処理した場合は結果を返す。
run_command(command, options)
class service.ServiceTool

genvid.toolbox.ServiceTool の実装