Create server to get details of if no other available.
If you attempted to run 03-get-server-details.go on a cloud account
without a pre-existing cloud server, it would fail. Clearly, this isn't
intended, as it doesn't exercise the get-server-details functionality.
I alter the code, as a last resort, create a new server.
We check first to see if a -i parameter has been set, and if so, we use
it directly. Otherwise, we attempt to list servers available for the
user, and if at least one exists, we pick the first one we find. Only
if those two conditions fail do we attempt to create a new server.
2 files changed