| Index: third_party/gsutil/gslib/cloud_api.py
|
| diff --git a/third_party/gsutil/gslib/cloud_api.py b/third_party/gsutil/gslib/cloud_api.py
|
| index b7af6b6eeac56ac0457c213753aa18d7878f5edb..79d592dc4b50cbdadba24128a9ed860ff43fe84e 100644
|
| --- a/third_party/gsutil/gslib/cloud_api.py
|
| +++ b/third_party/gsutil/gslib/cloud_api.py
|
| @@ -26,7 +26,8 @@ class CloudApi(object):
|
| a separate instance of the gsutil Cloud API should be instantiated per-thread.
|
| """
|
|
|
| - def __init__(self, bucket_storage_uri_class, logger, provider=None, debug=0):
|
| + def __init__(self, bucket_storage_uri_class, logger, provider=None,
|
| + debug=0, trace_token=None):
|
| """Performs necessary setup for interacting with the cloud storage provider.
|
|
|
| Args:
|
| @@ -36,11 +37,14 @@ class CloudApi(object):
|
| provider: Default provider prefix describing cloud storage provider to
|
| connect to.
|
| debug: Debug level for the API implementation (0..3).
|
| + trace_token: Google internal trace token to pass to the API
|
| + implementation (string).
|
| """
|
| self.bucket_storage_uri_class = bucket_storage_uri_class
|
| self.logger = logger
|
| self.provider = provider
|
| self.debug = debug
|
| + self.trace_token = trace_token
|
|
|
| def GetBucket(self, bucket_name, provider=None, fields=None):
|
| """Gets Bucket metadata.
|
| @@ -269,12 +273,13 @@ class CloudApi(object):
|
| start_byte: Starting point for download (for resumable downloads and
|
| range requests). Can be set to negative to request a range
|
| of bytes (python equivalent of [:-3])
|
| - end_byte: Ending point for download (for range requests).
|
| + end_byte: Ending byte number, inclusive, for download (for range
|
| + requests). If None, download the rest of the object.
|
| progress_callback: Optional callback function for progress notifications.
|
| Receives calls with arguments
|
| (bytes_transferred, total_size).
|
| - serialization_data: Implementation-specific dict containing serialization
|
| - information for the download.
|
| + serialization_data: Implementation-specific JSON string of a dict
|
| + containing serialization information for the download.
|
| digesters: Dict of {string : digester}, where string is a name of a hash
|
| algorithm, and digester is a validation digester that supports
|
| update(bytes) and digest() using that algorithm.
|
| @@ -602,6 +607,15 @@ class NotFoundException(ServiceException):
|
| """Exception raised when a resource is not found (404)."""
|
|
|
|
|
| +class BucketNotFoundException(NotFoundException):
|
| + """Exception raised when a bucket resource is not found (404)."""
|
| +
|
| + def __init__(self, reason, bucket_name, status=None, body=None):
|
| + super(BucketNotFoundException, self).__init__(reason, status=status,
|
| + body=body)
|
| + self.bucket_name = bucket_name
|
| +
|
| +
|
| class NotEmptyException(ServiceException):
|
| """Exception raised when trying to delete a bucket is not empty."""
|
|
|
|
|