Score:0

Getting a list of all project owners , folder path from GCP

fi flag

I am trying to get a list of all GCP projects on the domain and the project owners and export it to a CSV, I have written a script which provide me details of projectid, name, projectnumber date and time. But not able to fetch - projectowner, folderpath, cost centre, environment.

#!/bin/bash
> project_data.csv
gcloud projects list --format="value(project_id, name, project_number, project_owner, tags, labels.org,  createTime.date(tz=LOCAL))" >whole_project_details.txt
echo project_id, project_name, project_number, project_owner, project_tag, project_label, project_time >project_data.csv
while read project_details
do
project_id=`echo $project_details | awk '{print $1}'`
project_name=`echo  $project_details | awk '{print $2}'`
project_number=`echo $project_details | awk '{print $3}'`
project_time=`echo $project_details | awk '{print $4}'`
project_owner=`echo $project_details | awk '{print $5}'`
project_label=`echo $project_details | awk '{print $6}'`
project_tag=`echo $project_details | awk '{print $7}'`
echo $project_id, $project_name, $project_number, $project_owner, $project_tag, $project_label, $project_time  >> project_data.csv
done < whole_project_details.txt

Please help me, how can fetch that data. As i'm new in GCP platform.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.