Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete coomposer from all regions #2

Open
turbaszek opened this issue Feb 6, 2021 · 1 comment
Open

Delete coomposer from all regions #2

turbaszek opened this issue Feb 6, 2021 · 1 comment

Comments

@turbaszek
Copy link
Member

Hello,

Currently, the script looks at all possible Compute regions and checks if there is a Cloud Composer instance there, even if the region is not officially supported by Cloud Composer. This can be done much easier if we use Assets Inventory.

gcloud alpha asset list --project polidea-airflow --asset-types=composer.googleapis.com/Environment

This is equivalent to an HTTP request:

==== request start ====
uri: https://cloudasset.googleapis.com/v1p5beta1/projects/polidea-airflow/assets?alt=json&assetTypes=composer.googleapis.com%2FEnvironment&contentType=CONTENT_TYPE_UNSPECIFIED
method: GET
== headers start ==
b'X-Goog-User-Project': b'polidea-airflow'
b'accept': b'application/json'
b'accept-encoding': b'gzip, deflate'
b'authorization': --- Token Redacted ---
b'content-length': b'0'
b'user-agent': b'google-cloud-sdk gcloud/320.0.0 command/gcloud.alpha.asset.list invocation-id/b8260cf3f01f4a68b01784f6d1f43a3b environment/None environment-version/None interactive/True from-script/False python/3.7.2 term/xterm-256color (Macintosh; Intel Mac OS X 20.2.0)'
== headers end ==
== body start ==

== body end ==
==== request end ====

Best regards,
Kamil Breguła

@turbaszek
Copy link
Member Author

Should we be able to use assets API?
https://cloud.google.com/asset-inventory/docs/reference/rest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant