docs/api: add docstrings to {list_mdns_services, set_clan_details}

This commit is contained in:
Johannes Kirschbauer
2025-07-07 15:47:14 +02:00
parent f2cb6fef41
commit dab11cb020
2 changed files with 12 additions and 0 deletions

View File

@@ -89,6 +89,10 @@ def parse_avahi_output(output: str) -> DNSInfo:
@API.register
def list_mdns_services() -> DNSInfo:
"""List mDNS/DNS-SD services on the local network.
Returns:
DNSInfo: A dictionary containing discovered mDNS/DNS-SD services.
"""
cmd = nix_shell(
["avahi"],
[

View File

@@ -15,6 +15,14 @@ class UpdateOptions:
@API.register
def set_clan_details(options: UpdateOptions) -> InventorySnapshot:
"""Update the clan metadata in the inventory of a given flake.
Args:
options: UpdateOptions containing the flake and the new metadata.
Returns:
InventorySnapshot: The updated inventory snapshot after modifying the metadata.
Raises:
ClanError: If the flake does not exist or if the inventory is invalid (missing the meta attribute).
"""
inventory_store = InventoryStore(options.flake)
inventory = inventory_store.read()
set_value_by_path(inventory, "meta", options.meta)