pyrolab.configure.PyroLabConfiguration

pyrolab.configure.PyroLabConfiguration#

class PyroLabConfiguration(_env_file: DotenvType | None = '<object object>', _env_file_encoding: str | None = None, _env_nested_delimiter: str | None = None, _secrets_dir: StrPath | None = None, *, version: str = '1.0', nameservers: Dict[str, NameServerConfiguration] = {}, daemons: Dict[str, DaemonConfiguration] = {}, services: Dict[str, ServiceConfiguration] = {}, autolaunch: AutolaunchSettings = AutolaunchSettings(nameservers=[], daemons=[]))[source]#

Bases: BaseSettings, YAMLMixin

Global configuration options for PyroLab.

Warning

The YAML load function can run arbitrary code on your machine. Only load trusted or untampered files! If in doubt, examine the file first. It’s a short text file, and should not be hard to vet.

Please call initialize_nameservers() anytime after modifying the nameservers dictionary. Nameservers themselves contain a private attribute of their own name, which can only be given to them by the parent configuration object.

Methods

construct([_fields_set])

Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.

copy(*[, include, exclude, update, deep])

Duplicate a model, optionally choose which fields to include, exclude and change.

dict(*[, include, exclude, by_alias, ...])

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

from_file(filename)

Loads a configuration from a YAML file.

from_yaml(yaml)

Loads a YAML representation of the configuration.

json(*[, include, exclude, by_alias, ...])

Generate a JSON representation of the model, include and exclude arguments as per dict().

update_forward_refs(**localns)

Try to update ForwardRefs on fields based on this Model, globalns and localns.

yaml([sort_keys, default_flow_style, ...])

Returns a YAML representation of the configuration.

Config

from_orm

get_daemon_settings

get_nameserver_settings

initialize_nameservers

parse_file

parse_obj

parse_raw

schema

schema_json

validate