项目作者: onetwopunch

项目描述 :
Like the unix tree command but for GCP Org Heirarchy
高级语言: Python
项目地址: git://github.com/onetwopunch/gcptree.git
创建时间: 2021-04-08T16:15:23Z
项目社区:https://github.com/onetwopunch/gcptree

开源协议:MIT License

下载


gcptree

Like the unix tree command but for GCP Org Heirarchy.

For a note on coloring, the org node is green, folders and blue, and projects that are not ACTIVE are dimmed. These styles won’t show up if you redirect output and Windows is supported by virtue of the colorama package.

Installation

  1. pip install gcptree

Usage

First make sure you are authenticated to gcloud and have your application default credentials set using:

  1. gcloud auth login --update-adc

You just need your org id, which you can find in the GCP console under the popup for picking organizations. It should be a long number around 12 digits or so.

  1. gcptree $ORG_ID

The flags are fairly simple and can be seen with the --help flag.

  1. $ gcptree --help
  2. usage: gcptree [-h] [--format FORMAT] [--full-resource] org_id
  3. Print out a GCP org heirarchy
  4. positional arguments:
  5. org_id GCP Organization ID
  6. optional arguments:
  7. -h, --help show this help message and exit
  8. --format FORMAT Output format (json or text)
  9. --full-resource API-parsable nodes where org and folder resource names are not resolved, i.e org/123 instead of example.com

Permissions

The minimum role you’ll need at the organization level is:

  • roles/browser
  • roles/cloudasset.viewer