#!/usr/bin/env bash
# fake maas: serves read endpoints from fixture files; dry-run never calls mutations.
prof="${1:-}"; obj="${2:-}"; act="${3:-}"
[ "$obj" = machines ]   && [ "$act" = read ] && { cat "${FIX_MACHINES:?}"; exit 0; }
[ "$obj" = machine ]    && [ "$act" = read ] && { cat "${FIX_MACHINE:?}";  exit 0; }
[ "$obj" = subnets ]    && [ "$act" = read ] && { cat "${FIX_SUBNETS:?}";  exit 0; }
[ "$obj" = interfaces ] && [ "$act" = read ] && { cat "${FIX_IFACES:?}";   exit 0; }
echo "fake-maas: UNMATCHED call: $*" >&2; exit 1   # fail loud: an uncovered call must never pass silently
