【问题标题】:How to filter Google Cloud Instances using google-compute-engine python client?如何使用 google-compute-engine python 客户端过滤 Google Cloud 实例?
【发布时间】:2021-11-01 01:46:54
【问题描述】:

我正在使用

Package                  Version
------------------------ ---------
google-api-core          2.0.1
google-auth              2.0.2
google-cloud-compute     0.5.0
google-compute-engine    2.8.13

检索谷歌云实例数据。我指的是docs 来获取实例的聚合列表。我无法根据计算 VM 实例的标签过滤实例。是否有使用 python 的特殊方法,因为在documentation 中没有特别提及它。 ?

【问题讨论】:

    标签: python-3.x google-cloud-platform filter google-compute-engine google-api-python-client


    【解决方案1】:

    请附上您的代码。

    您应该能够将Filter 应用于AggregatedListInstancesRequest,并且您应该能够指定标签,请参阅Filtering searches using labels。我有信心(!?)API 是一致的。

    【讨论】:

      猜你喜欢
      • 2020-04-30
      • 1970-01-01
      • 2021-05-15
      • 1970-01-01
      • 2018-07-31
      • 1970-01-01
      • 2018-02-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多