To write a Python script to collect various details about all projects deployed in the organization, how can we find which shared-vpc host project/network is being used?
There's a gcloud command that provides details
gcloud compute shared-vpc get-host-project strong-bad-2g0v
## provides results
results
kind: compute#project
name: shared-vpc-host-52ey86a9
However, I want to use Python for the script, so following the docs on how to use the Python Client and searching Google Cloud Python Client repo for "shared-vpc" or "vpc" doesn't provide relevant results. Looking under /compute_v1 (assuming a similar structure as gcloud), doesn't show results for "shared-vpc" or "vpc"
Using the flag
--log-http
with cloud provides more details about the API being called.seeing that the path element "getXpnHost", return to Google Cloud Python Client repo and search and found examples.