将过滤器应用于 gcloud sql
我正在尝试根据 cloudsql
实例是否有使用 gcloud cli 的建议来过滤它们。
例如,我想列出接近存储容量的所有实例。
我尝试了这个,但没有运气:
➜ gcloud sql instances list --project <project-name> --filter='recommendations:on'
➜ gcloud sql instances list --project <project-name> --filter='recommendations:*'
WARNING: The following filter keys were not present in any resource : recommendations
Listed 0 items.
有什么帮助吗?
I am trying to filter a fleet of cloudsql
instances based on if they have a recommendation using gcloud cli.
For example I want to list the all the instances that are nearing storage capacity.
I tried this but no luck:
➜ gcloud sql instances list --project <project-name> --filter='recommendations:on'
➜ gcloud sql instances list --project <project-name> --filter='recommendations:*'
WARNING: The following filter keys were not present in any resource : recommendations
Listed 0 items.
Any help please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过 gcloud CLI 使用推荐器API,直接根据您的需求使用这些推荐实例。在这种情况下,请尝试使用
gcloud 推荐系统推荐列表
命令 并使用任何可用的 Cloud SQL 传递--recommender=RECOMMENDER
标志href="https://cloud.google.com/recommender/docs/recommenders" rel="nofollow noreferrer">建议(包括磁盘不足):为
gcloud sql 实例列表
添加更多上下文,即任何给定的可用过滤器可以通过对 YAML 输出进行采样(使用--format=yaml
)来查看gcloud
命令,如 文档。我尝试过,但推荐数据未作为可用属性返回。You can use the Recommender API through the gcloud CLI to work directly with these recommendations for your instances. In this case, try using the
gcloud recommender recommendations list
command and passing the--recommender=RECOMMENDER
flag with any of the available Cloud SQL recommendations (including out of disk):Adding more context for
gcloud sql instances list
, the available filters for any givengcloud
command can be seen by sampling the YAML output (using--format=yaml
), as noted in the documentation. I tried it, but recommendation data is not returned as an available property.