chore(API): cleanup remove unnused functions
This commit is contained in:
@@ -57,28 +57,6 @@ def show_machine_hardware_config(clan_dir: Path, machine_name: str) -> HardwareC
|
||||
return HardwareConfig.detect_type(clan_dir, machine_name)
|
||||
|
||||
|
||||
@API.register
|
||||
def show_machine_deployment_target(clan_dir: Path, machine_name: str) -> str | None:
|
||||
"""
|
||||
Show deployment target for a machine returns None if none exist.
|
||||
"""
|
||||
config = nix_config()
|
||||
system = config["system"]
|
||||
cmd = nix_eval(
|
||||
[
|
||||
f"{clan_dir}#clanInternals.machines.{system}.{machine_name}",
|
||||
"--apply",
|
||||
"machine: { inherit (machine.config.clan.core.networking) targetHost; }",
|
||||
"--json",
|
||||
]
|
||||
)
|
||||
proc = run_no_stdout(cmd, RunOpts(prefix=machine_name))
|
||||
res = proc.stdout.strip()
|
||||
|
||||
target_host = json.loads(res)
|
||||
return target_host.get("targetHost", None)
|
||||
|
||||
|
||||
@API.register
|
||||
def show_machine_hardware_platform(clan_dir: Path, machine_name: str) -> str | None:
|
||||
"""
|
||||
|
||||
@@ -36,7 +36,7 @@ def set_machine(flake_url: Path, machine_name: str, machine: InventoryMachine) -
|
||||
|
||||
|
||||
@API.register
|
||||
def list_inventory_machines(flake_url: str | Path) -> dict[str, InventoryMachine]:
|
||||
def list_machines(flake_url: str | Path) -> dict[str, InventoryMachine]:
|
||||
inventory = load_inventory_eval(flake_url)
|
||||
return inventory.get("machines", {})
|
||||
|
||||
@@ -60,7 +60,7 @@ def extract_header(c: str) -> str:
|
||||
|
||||
|
||||
@API.register
|
||||
def get_inventory_machine_details(flake_url: Path, machine_name: str) -> MachineDetails:
|
||||
def get_machine_details(flake_url: Path, machine_name: str) -> MachineDetails:
|
||||
inventory = load_inventory_eval(flake_url)
|
||||
machine = inventory.get("machines", {}).get(machine_name)
|
||||
if machine is None:
|
||||
|
||||
Reference in New Issue
Block a user