docs/api: add docstrings to {list_mdns_services, set_clan_details}
This commit is contained in:
@@ -89,6 +89,10 @@ def parse_avahi_output(output: str) -> DNSInfo:
|
|||||||
|
|
||||||
@API.register
|
@API.register
|
||||||
def list_mdns_services() -> DNSInfo:
|
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(
|
cmd = nix_shell(
|
||||||
["avahi"],
|
["avahi"],
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -15,6 +15,14 @@ class UpdateOptions:
|
|||||||
|
|
||||||
@API.register
|
@API.register
|
||||||
def set_clan_details(options: UpdateOptions) -> InventorySnapshot:
|
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_store = InventoryStore(options.flake)
|
||||||
inventory = inventory_store.read()
|
inventory = inventory_store.read()
|
||||||
set_value_by_path(inventory, "meta", options.meta)
|
set_value_by_path(inventory, "meta", options.meta)
|
||||||
|
|||||||
Reference in New Issue
Block a user