Batches#

Batch updates / deletes of storage buckets / blobs.

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

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

Bases: gcloud.storage.connection.Connection

Proxy an underlying connection, batching up change operations.

Parameters:client (gcloud.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 w/ deferred requests.

Return type:list of tuples
Returns:one (headers, payload) tuple per deferred request.
class gcloud.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 (string) – HTTP method
  • uri (string) – URI for HTTP request
  • headers (dict) – HTTP headers
  • body (text or None) – HTTP payload
class gcloud.storage.batch.NoContent[source]#

Bases: object

Emulate an HTTP ‘204 No Content’ response.

status = 204#