Loading
Add status --json and list --json
Closes #22 (closed)
A client driving the simulator could not read a rig's configuration: status printed text only, there was no list, and up dropped the machine type, disk size, budget and max run it was given.
status --jsonprints one object andlist --jsonan array of them: an allowlist of the instance state's keys underschema_version1, merged with the VM's machine type, creation time and labels (vm, null when GCE cannot be read). An unlisted key never prints, a key an older record lacks reads null, and an unknown instance prints a JSON error object and exits 1.listwithout--jsonprints one line per rig. The text form ofstatusis unchanged.uprecordsmachine_type,disk_size,budgetandmax_runtimein state.- The engine self-test plants a secret under a new key, a token, a password and a licence path, and asserts none reaches either JSON form; it also covers the null fields of an older record and the unknown-instance error.
- The keys are documented in
gce/operations.md. The word ceiling holds: the words come out of the same page andgce/dev-base.md. The Prettier fallback there no longer names a remote-package runner, which the authored scan flagged on main.
Verified live on GCE with an omnibus rig: status --json and list --json report the same machine type and creation time as gcloud compute instances describe; the rig was then deleted.