如何使用Python Google Cloud客户端库批量请求Compute Engine?

huangapple go评论60阅读模式
英文:

How do I batch a request to Compute Engine using the Python Google Cloud Client Libraries?

问题

在较早的Google API客户端库中,您可以使用googleapiclientdiscovery.build("compute", "v1").new_batch_http_request(...)批处理请求来一次性为多个实例打标签。

使用新的建议的Cloud客户端库,您可以使用setLabels为一个实例设置标签,但我没有看到一种批处理这些请求的方法。

文档提到了批处理请求,但只能通过直接的HTTPS调用,我更愿意使用Python库。这份文档确实提到了一个Python库,但只适用于较早的Google API客户端库。

我不介意使用较早的Google API客户端库,但至少自2016年以来,尽管它们得到了官方支持,但它们存在严重的bug,导致调用失败(这是在它们的SSL实现中,参见12以及更多)。这使得它们不可用。

英文:

In the older Google API Client Libraries, you could batch a request to label many instances at once, using googleapiclient, discovery.build("compute", "v1").new_batch_http_request(...)

With the new, recommended Cloud Client Libraries, you can set labels on one instance with setLabels, but I don't see a way to batch these requests.

The documentation mentions the batching of requests, but only with a direct HTTPS call, and I would rather use a Python library. This documentation does refer to a Python library, but only the older Google API Client Libraries.

I don't mind using the older Google API Client libraries, but, though they are officially supported, they have had, since 2016 at least, severe bugs causing invocation failure. (This is in their SSL implementation, see 1, 2 and more). This makes them impossible to use.

答案1

得分: 0

不可能使用“云客户端库”批处理请求。

英文:

It is simply not possible to batch requests with the "Cloud Client Libraries".

huangapple
  • 本文由 发表于 2023年3月12日 19:41:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/75712871.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定