WattsonSambaService#
- class wattson.services.management.wattson_samba_service.WattsonSambaService(service_configuration: ServiceConfiguration, network_node: WattsonNetworkNode)#
Bases:
WattsonService
Methods
Returns the command to be executed for starting this service on the network node
- returns:
Whether the service is currently running.
Sends the SIGKILL to the process.
Start the service.
Stop the service.
Update the service state (is_running, ...)
update_is_running
Attributes
id
name
- __init__(service_configuration: ServiceConfiguration, network_node: WattsonNetworkNode)#
- get_start_command() List[str] #
Returns the command to be executed for starting this service on the network node
- Returns:
The start command as a list of strings.
- Return type:
List[str]
- is_running(**kwargs)#
- Returns:
Whether the service is currently running.
- Return type:
bool
- kill() bool #
Sends the SIGKILL to the process.
- Returns:
True iff the service has been terminated.
- Return type:
bool
- start(refresh_config: bool = False)#
Start the service.
- Parameters:
refresh_config (bool, optional) – Whether to refresh the config even if it already exists. (Default value = False)
- Returns:
True iff the service has been started.
- Return type:
bool
- stop(wait_seconds: float = 5, auto_kill: bool = False, async_callback: Callable[[WattsonServiceInterface], None] | None = None) bool #
Stop the service.
- Parameters:
wait_seconds (float, optional) – Number of seconds to wait for the service to gracefully terminate. (Default value = 5)
auto_kill (bool, optional) – Whether to kill the service automatically after the waiting timeout has been exceeded. (Default value = False)
async_callback (Optional[Callable[['WattsonServiceInterface'], None]], optional) – An optional callback to call once the service has terminated. Makes the stop method return immediately. (Default value = None)
- Returns:
None if an async_callback is given, else True iff the service has been terminated.
- Return type:
bool
- update()#
Update the service state (is_running, …)