Coverage for gws-app/gws/server/cli.py: 0%
25 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-17 01:37 +0200
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-17 01:37 +0200
1"""Command-line server commands."""
3from typing import Optional
5import gws
7from . import control
10class Params(gws.CliParams):
11 config: Optional[str]
12 """configuration file"""
13 manifest: Optional[str]
14 """manifest file"""
17gws.ext.new.cli('server')
20class Object(gws.Node):
22 @gws.ext.command.cli('serverStart')
23 def do_start(self, p: Params):
24 """Configure and start the server."""
26 control.start(p.manifest, p.config)
28 @gws.ext.command.cli('serverReload')
29 def do_reload(self, p: Params):
30 """Restart the server."""
32 control.reload_all()
34 @gws.ext.command.cli('serverReconfigure')
35 def do_reconfigure(self, p: Params):
36 """Reconfigure and restart the server."""
38 control.reconfigure(p.manifest, p.config)
40 @gws.ext.command.cli('serverConfigure')
41 def do_configure(self, p: Params):
42 """Configure the server, but do not restart."""
44 control.configure_and_store(p.manifest, p.config)
46 @gws.ext.command.cli('serverConfigtest')
47 def do_configtest(self, p: Params):
48 """Test the configuration."""
50 control.configure(p.manifest, p.config)