fermilink.services module¶
- class fermilink.services.ServiceSpec[source]¶
Bases:
objectServiceSpec(name: ‘str’, command: ‘list[str]’, env: ‘dict[str, str]’)
- __init__(name, command, env)¶
- Parameters:
name (str)
command (list[str])
env (dict[str, str])
- Return type:
None
- command: list[str]¶
- env: dict[str, str]¶
- name: str¶
- fermilink.services.default_service_specs(*, web_app_path)[source]¶
Build default service specifications for FermiLink components.
- Parameters:
web_app_path (Path) – Path to the web application module entry file.
- Returns:
Mapping from component name to ServiceSpec.
- Return type:
dict[str, ServiceSpec]
- fermilink.services.normalize_components(values)[source]¶
Normalize requested service component names.
- Parameters:
values (list[str] | None) – Requested component names from CLI input.
- Returns:
Normalized component list with canonical names.
- Return type:
list[str]
- fermilink.services.service_status(runtime_root, service)[source]¶
Collect runtime status for a managed service component.
- Parameters:
runtime_root (Path) – Runtime root used for service pid/status/log files.
service (str) – Managed service component name.
- Returns:
Service status payload including pid, health, and metadata.
- Return type:
dict[str, Any]
- fermilink.services.start_service(runtime_root, spec)[source]¶
Start a managed service process and persist runtime metadata.
- Parameters:
runtime_root (Path) – Runtime root used for service pid/status/log files.
spec (ServiceSpec) – Service specification describing command and runtime paths.
- Returns:
Start result payload including final status and process metadata.
- Return type:
dict[str, Any]
- fermilink.services.stop_service(runtime_root, service)[source]¶
Stop a managed service process and update runtime metadata.
- Parameters:
runtime_root (Path) – Runtime root used for service pid/status/log files.
service (str) – Managed service component name.
- Returns:
Stop result payload including final status and cleanup metadata.
- Return type:
dict[str, Any]