pylav.storage.models.node package#
Submodules#
pylav.storage.models.node.mocked module#
- class pylav.storage.models.node.mocked.NodeMock(*, id: 'int', data: 'JSON_DICT_TYPE')[source]#
Bases:
CachedModel
- async add_to_disabled_sources(source)[source]#
Add a source to the node’s disabled sources in the database
- async bulk_add_to_disabled_sources(sources)[source]#
Add sources to the node’s disabled sources in the database
- async bulk_remove_from_disabled_sources(sources)[source]#
Remove sources from the node’s disabled sources in the database
- data#
- async static exists()[source]#
Check if the node exists in the database.
- Returns:
Whether the node exists in the database.
- Return type:
- async fetch_disabled_sources()[source]#
Fetch the node’s disabled sources from the database.
- Returns:
The node’s disabled sources.
- Return type:
list[str]
- async fetch_extras()[source]#
Fetch the node’s extras from the database.
- Returns:
The node’s extras.
- Return type:
- async fetch_managed()[source]#
Fetch the node’s managed setting from the database.
- Returns:
The node’s managed setting.
- Return type:
- async fetch_name()[source]#
Fetch the node from the database.
- Returns:
The node’s name.
- Return type:
ste
- async fetch_reconnect_attempts()[source]#
Fetch the node’s reconnect attempts from the database.
- Returns:
The node’s reconnect attempts.
- Return type:
- async fetch_resume_timeout()[source]#
Fetch the node’s resume timeout from the database.
- Returns:
The node’s resume timeout.
- Return type:
- async fetch_search_only()[source]#
Fetch the node’s search only setting from the database.
- Returns:
The node’s search only setting.
- Return type:
- async fetch_session()[source]#
Fetch the node’s session from the database.
- Returns:
The node’s session.
- Return type:
str | None
- async fetch_ssl()[source]#
Fetch the node’s ssl setting from the database.
- Returns:
The node’s ssl setting.
- Return type:
- async fetch_yaml()[source]#
Fetch the node’s yaml from the database.
- Returns:
The node’s yaml.
- Return type:
- async get_connection_args()[source]#
Get the connection args for the node.
- Returns:
The connection args.
- Return type:
- id#
- async remove_from_disabled_sources(source)[source]#
Remove a source from the node’s disabled sources in the database
- session_id#
- async update_disabled_sources(disabled_sources)[source]#
Update the node’s disabled sources in the database
- async update_reconnect_attempts(reconnect_attempts)[source]#
Update the node’s reconnect attempts in the database
- async update_resume_timeout(resume_timeout)[source]#
Update the node’s resume timeout in the database
pylav.storage.models.node.real module#
- class pylav.storage.models.node.real.Node(*args: 'Any', **kwargs: 'Any')[source]#
Bases:
CachedModel
- async add_to_disabled_sources(source)[source]#
Add a source to the node’s disabled sources in the database
- async bulk_add_to_disabled_sources(sources)[source]#
Add sources to the node’s disabled sources in the database
- async bulk_remove_from_disabled_sources(sources)[source]#
Remove sources from the node’s disabled sources in the database
- async bulk_update(host, port, password, resume_timeout=60, name=None, reconnect_attempts=-1, ssl=False, search_only=False, managed=False, extras=None, yaml=None, disabled_sources=None)[source]#
Update the node’s data in the database
- async exists()[source]#
Check if the node exists in the database.
- Returns:
Whether the node exists in the database.
- Return type:
- async fetch_disabled_sources()[source]#
Fetch the node’s disabled sources from the database.
- Returns:
The node’s disabled sources.
- Return type:
list[str]
- async fetch_extras()[source]#
Fetch the node’s extras from the database.
- Returns:
The node’s extras.
- Return type:
- async fetch_managed()[source]#
Fetch the node’s managed setting from the database.
- Returns:
The node’s managed setting.
- Return type:
- async fetch_name()[source]#
Fetch the node from the database.
- Returns:
The node’s name.
- Return type:
- async fetch_reconnect_attempts()[source]#
Fetch the node’s reconnect attempts from the database.
- Returns:
The node’s reconnect attempts.
- Return type:
- async fetch_resume_timeout()[source]#
Fetch the node’s resume timeout from the database.
- Returns:
The node’s resume timeout.
- Return type:
- async fetch_search_only()[source]#
Fetch the node’s search only setting from the database.
- Returns:
The node’s search only setting.
- Return type:
- async fetch_ssl()[source]#
Fetch the node’s ssl setting from the database.
- Returns:
The node’s ssl setting.
- Return type:
- async fetch_yaml()[source]#
Fetch the node’s yaml from the database.
- Returns:
The node’s yaml.
- Return type:
- async get_connection_args()[source]#
Get the connection args for the node.
- Returns:
The connection args.
- Return type:
- id#
- async remove_from_disabled_sources(source)[source]#
Remove a source from the node’s disabled sources in the database
- async update_disabled_sources(disabled_sources)[source]#
Update the node’s disabled sources in the database
- async update_reconnect_attempts(reconnect_attempts)[source]#
Update the node’s reconnect attempts in the database
- async update_resume_timeout(resume_timeout)[source]#
Update the node’s resume timeout in the database