Google cloud platform 传递多个过滤器选项
我正在尝试根据区域和名称标准列出我的计算磁盘 但是,以下命令:Google cloud platform 传递多个过滤器选项,google-cloud-platform,gcloud,Google Cloud Platform,Gcloud,我正在尝试根据区域和名称标准列出我的计算磁盘 但是,以下命令: ▶ gcloud compute disks list --filter="zone=europe-west4-a AND name=redash-postgres-data" WARNING: --filter : operator evaluation is changing for consistency across Google APIs. zone=europe-west4-a currently does not m
▶ gcloud compute disks list --filter="zone=europe-west4-a AND name=redash-postgres-data"
WARNING: --filter : operator evaluation is changing for consistency across Google APIs. zone=europe-west4-a currently does not match but will match in the near future. Run `gcloud topic filters` for details.
Listed 0 items.
a)不会返回任何结果,尽管存在这样一个磁盘
▶ gcloud compute disks list
NAME LOCATION LOCATION_SCOPE SIZE_GB TYPE STATUS
redash-postgres-data us-east4-b zone 50 pd-standard READY
gke-redash-test-cluster-redash-pool1-4db01a9f-1986 europe-west4-a zone 100 pd-standard READY
gke-redash-test-cluster-redash-pool1-4db01a9f-t34m europe-west4-a zone 100 pd-standard READY
redash-postgres-data europe-west4-a zone 60 pd-standard READY
b)我们应该如何制定查询,以便根据上述警告进行未来验证?我使用的示例来自于帮助返回,通过运行上述警告消息所建议的
gcloud主题过滤器,EDIT:该Kolban@linked实际上还提到了与简单模式匹配的替代语法,并允许使用短区域名称:
--filter="zone:( us-east4-a )"
因此,您的gcloud命令实际上可以如下所示:
gcloud compute disks list --filter="zone:( us-east4-a) AND name=redash-postgres-data"
当通过gcloud compute disks description disk\u name
检查磁盘资源时,您会看到,在其他信息旁边,区域被描述为完全限定的URL:
https://www.googleapis.com/compute/v1/projects/PROJECT_NAME/zones/us-east4-a
使用此完整URL筛选列表
命令将有效:
gcloud compute disks list --filter="zone=https://www.googleapis.com/compute/v1/projects/PROJECT_NAME/zones/us-east4-a AND name=redash-postgres-data"
回答得好。。。但是有点讨厌。。。正如OP所说,如果我们看看这里。。。这里没有提到完整的URL,而是只显示区域名称。