This command works to limit regions to the ones I specify
gcloud compute networks subnets list --network=MYNW --filter="region:(us-west1 us-west2)"
But when I use this, it fails. Of course, I can iterate over the items in an array but was wondering if we can get this to work
gcloud compute networks subnets delete MYNW --filter="region:(us-west1 us-west2)"
Per @JohnHanley:
The command flag --filter
is not supported by subnets delete
. Compare the documentation for list and delete. The first specifies that --filter
is supported, the second does not even mention filters.
If you want to provide an expression to delete subnets, using shell scripts like Python make this very easy. Since the command flags that you are looking for are currently a limitation at the moment, kindly raise a feature request through this link so it can be considered in the future.