英文:
How do I batch a request to Compute Engine using the Python Google Cloud Client Libraries?
问题
在较早的Google API客户端库中,您可以使用googleapiclient
和discovery.build("compute", "v1").new_batch_http_request(...)
批处理请求来一次性为多个实例打标签。
使用新的建议的Cloud客户端库,您可以使用setLabels为一个实例设置标签,但我没有看到一种批处理这些请求的方法。
文档提到了批处理请求,但只能通过直接的HTTPS调用,我更愿意使用Python库。这份文档确实提到了一个Python库,但只适用于较早的Google API客户端库。
我不介意使用较早的Google API客户端库,但至少自2016年以来,尽管它们得到了官方支持,但它们存在严重的bug,导致调用失败(这是在它们的SSL实现中,参见1,2以及更多)。这使得它们不可用。
英文:
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".
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论