Existing sandboxes
A sandbox outlives the process that created it. The UUID and the metro are all that a later process needs to attach again.
Reconnect
Code
An instance UUID is per metro.
If the ref carries no metro, connect searches the scope for the UUID.
Name the metro to skip the search.
Through a client that you already hold, the same operation is get:
Code
List sandboxes
A sandbox is an instance, so the list of sandboxes is the instance list, filtered by plugin.
tags narrows it further:
Code
Wait after a restart
connect and get don't wait for the plugin, because the sandbox was already there.
After a start, or after a resume from standby, the plugin reloads, so wait for it before the first command:
Code
If the wait runs out of time, the error names the cause. The SDK reads the state of the instance and reports, for example, that the image didn't boot, or that the main process exited.
Delete
sandbox.delete() deletes the instance underneath the sandbox.
An await using declaration does this for you at the end of the scope.
Code
Reference
See ConnectSandboxOptions and ListSandboxesOptions in the source for the complete list of options.