googleapis / gapic-generator-python

Generate Python API client libraries from Protocol Buffers.
Apache License 2.0
121 stars 66 forks source link

Support batch operations for Compute Engine #1519

Open tpdownes opened 2 years ago

tpdownes commented 2 years ago

The googleapiclient.discovery library supports the Compute Engine-specific batch operation interface:

https://googleapis.github.io/google-api-python-client/docs/dyn/compute_v1.html#new_batch_http_request

Some of the other contemporary Python libraries for each Cloud API also support batch operations. For example:

https://github.com/googleapis/python-storage/blob/main/google/cloud/storage/batch.py

Can be used to run something like:

with storage_client.batch():
    for blob in blobs_to_delete:
        blob.delete()

and it "just works". It should also "just work" for the Compute Engine API. The Python docs for GCS don't spell out this mode of operations but it follows the example from the Datastore docs:

https://cloud.google.com/python/docs/reference/datastore/latest/google.cloud.datastore.batch.Batch

parthea commented 1 year ago

I'm going to transfer this feature request to the gapic-generator-python repository as the code in this repository is autogenerated.