3 ms·
In (most?) places throughout the web-based console you can click a little link to show you the REST API equivalent of your resource (whether it's an instance, a
by boulos 11y ago
In (most?) places throughout the web-based console you can click a little link to show you the REST API equivalent of your resource (whether it's an instance, a disk, or a command you're about to do). You might be able to make the job of "exporting your infrastructure" somewhat straightforward from those, though I think I'd personally just write against the handful of APIs in Go. All of our newer offerings (meaning GCS, GCE, etc.) have really sane object models that just map directly to a fairly obvious, autogenerated struct in the Go client library. Here's the struct for an Instance:
https://godoc.org/google.golang.org/api/compute/v1#Instance
- lobster_johnson 11y agoThanks, being able to see the API call for a resource is a nice convenience. But part of my point was that while you can code together something with APIs, you still need to write the diffing and converging logic to accomplish what I suggested. For example, if someone has gone through the console and added something, so that you now have a conflict, you want to be able to resolve the conflict. First by either accepting or rejecting the conflicting change, and then, if you rejected it, remove it as part of the next push.