pi_portal.modules.system.supervisor.SupervisorClient

class pi_portal.modules.system.supervisor.SupervisorClient(host: str = 'localhost', port: int = 9001)[source]

Bases: object

A Supervisor client that connects via the local unix socket.

Parameters:
  • host (str) – Unused, instead the transport uses a unix socket.

  • port (int) – Unused, instead the transport uses a unix socket.

__init__(host: str = 'localhost', port: int = 9001)[source]
start(process: ProcessList) None[source]

Start the specified Supervisor process.

Parameters:

process (ProcessList) – The process to start.

Raises:

SupervisorException

start_time(process: ProcessList) str[source]

Retrieve the start time of the specified Supervisor process.

Parameters:

process (ProcessList) – The process to retrieve the uptime of.

Returns:

The uptime of the queried process.

Raises:

SupervisorException

Return type:

str

status(process: ProcessList) ProcessStatus[source]

Retrieve the current state of the specified Supervisor process.

Parameters:

process (ProcessList) – The process to retrieve the status of.

Returns:

The status of the queried process.

Raises:

SupervisorException

Return type:

ProcessStatus

stop(process: ProcessList) None[source]

Stop the specified Supervisor process.

Parameters:

process (ProcessList) – The process to stop.

Raises:

SupervisorException