A demo/draft of spreadsheet code for asset management #700
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I put a test spreadsheet in the shared drive: https://docs.google.com/spreadsheets/d/1isOybP49rb6n7uX2vtT_azKj-sgRzp7RWkOHxFSsSKE/edit?gid=591394540#gid=591394540
Idea is you paste that link in and it'll do the thing. For the "unique resource identifier", that'll need to be the full resource name you get from the cloud asset API. Sarah T said that because that full name is long and verbose, it'd be great to also have the tail end of it put in a separate short asset name column.
You'll need to set up ADC in a specific way for this to work.
The calendar scope is helpful for Beehive's read-workbench-protection-calendar feature, while the spreadsheet scope is what powers this read-and-mutate-spreadsheet thingy. I don't think we'll need to explicitly list those scopes for Kubernetes or anything but you will need to enable the API in the project.
That cloud asset API is here https://pkg.go.dev/cloud.google.com/go/asset/apiv1. https://pkg.go.dev/cloud.google.com/go/asset/apiv1#Client.QueryAssets is probably what you want.