Created
March 5, 2024 14:22
-
-
Save Intelrunner/daf0c501e889eef9b3f887b8f95aa10e to your computer and use it in GitHub Desktop.
Revisions
-
Intelrunner created this gist
Mar 5, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ #!/bin/bash # The Organization ID (Replace with your organization's ID) ORG_ID="your-organization-id" # Gather all projects under the specified organization PROJECT_IDS=$(gcloud projects list --organization=${ORG_ID} --format="value(projectId)") # Loop through each project for PROJECT_ID in ${PROJECT_IDS}; do echo "Checking project: ${PROJECT_ID}" # List enabled services and check if BigQuery API is enabled if gcloud services list --project=${PROJECT_ID} --enabled --format="value(config.name)" | grep -q "bigquery.googleapis.com"; then echo "BigQuery API is enabled in project: ${PROJECT_ID}" else echo "BigQuery API is not enabled in project: ${PROJECT_ID}" fi done