Skip to content

Instantly share code, notes, and snippets.

@Intelrunner
Last active June 15, 2022 20:05
Show Gist options
  • Save Intelrunner/623916eba9468cd00fba9ea99ba712f1 to your computer and use it in GitHub Desktop.
Save Intelrunner/623916eba9468cd00fba9ea99ba712f1 to your computer and use it in GitHub Desktop.
Starting point to process all output from Google Cloud Compute Engine Recommendation Engine
#!/bin/bash
for project in $(gcloud projects list --format="value(projectId)")
do
for recommendation in $(gcloud recommender recommendations list --project=$project --location=global --recommender=google.compute.instance.MachineTypeRecommender)
do
# Here is where the logic for your 'what to do with each recommendation' goes
echo "$recommendation"
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment