Batches#

Batch updates / deletes of storage buckets / blobs.

See: https://cloud.google.com/storage/docs/json_api/v1/how-tos/batch

class google.cloud.storage.batch.Batch(client)[source]#

Bases: google.cloud.storage._http.Connection

Proxy an underlying connection, batching up change operations.

Parameters:client (google.cloud.storage.client.Client) – The client to use for making connections.
current()[source]#

Return the topmost batch, or None.

finish()[source]#

Submit a single multipart/mixed request with deferred requests.

Return type:list of tuples
Returns:one (headers, payload) tuple per deferred request.
class google.cloud.storage.batch.MIMEApplicationHTTP(method, uri, headers, body)[source]#

Bases: email.mime.application.MIMEApplication

MIME type for application/http.

Constructs payload from headers and body

Parameters:
  • method (str) – HTTP method
  • uri (str) – URI for HTTP request
  • headers (dict) – HTTP headers
  • body (str) – (Optional) HTTP payload
class google.cloud.storage.batch.NoContent[source]#

Bases: object

Emulate an HTTP ‘204 No Content’ response.