The signature of Start is:
(*System) Start(ctx context.Context, count int) ([]*bigmachine.Machine, error)
Whereas (its converse) Shutdown is:
It feels as though it would be more consistent , if Shutdown's signature included both context.Context and []*bigmachine.Machine, also returning an error.
Even then, bigmachine.Machine's type does not include a unique ID for the machine (beyond an IP address; often not used as a key), would it make sense to add one?
I'm not retaining the list of machines created by (Start in) the GCE implementation and so, conversely when asked to Shutdown, I must first enumerate all the instances that (I think) have been created (I'm doing this by tag, could potentially use IP) and then make a call to delete these.
The signature of
Startis:Whereas (its converse)
Shutdownis:It feels as though it would be more consistent , if
Shutdown's signature included bothcontext.Contextand[]*bigmachine.Machine, also returning an error.Even then,
bigmachine.Machine's type does not include a unique ID for the machine (beyond an IP address; often not used as a key), would it make sense to add one?I'm not retaining the list of machines created by (
Startin) the GCE implementation and so, conversely when asked toShutdown, I must first enumerate all the instances that (I think) have been created (I'm doing this by tag, could potentially use IP) and then make a call to delete these.