我正在尝试过滤Google Cloud Platform API中的区域列表
但我无法在Google中找到任何说明在API中添加过滤器的文档:
req := computeService.Zones.List(project)
上面的代码行将列出Google Cloud Compute中的区域
在命令行中我们也可以这样做
gcloud compute zones list --filter="name:us-"
谢谢,希德
在以下情况下它会帮助某人:
req := computeService.Zones.List("ProjectName")
if err := req.Filter("name=us*").Pages(ctx, func(page *compute.ZoneList) error {
//Your code
}