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 --json prints one object and list --json an array of them: an allowlist of the instance state's keys under schema_version 1, 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. list without --json prints one line per rig. The text form of status is unchanged.
  • up records machine_type, disk_size, budget and max_runtime in 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 and gce/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.

Merge request reports

Loading
Loading